Merge lp:~tomasgroth/openlp/appveyor-no-bzr into lp:openlp

Proposed by Tomas Groth
Status: Merged
Merged at revision: 2824
Proposed branch: lp:~tomasgroth/openlp/appveyor-no-bzr
Merge into: lp:openlp
Diff against target: 93 lines (+18/-16)
2 files modified
scripts/appveyor-webhook.py (+11/-8)
scripts/appveyor.yml (+7/-8)
To merge this branch: bzr merge lp:~tomasgroth/openlp/appveyor-no-bzr
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Review via email: mp+352222@code.launchpad.net

Commit message

Workaround for bazaar no longer working on appveyor. We now download a tarball instead of checking out the code.

To post a comment you must log in.
Revision history for this message
Tomas Groth (tomasgroth) wrote :
Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'scripts/appveyor-webhook.py'
--- scripts/appveyor-webhook.py 2017-12-29 09:15:48 +0000
+++ scripts/appveyor-webhook.py 2018-08-02 20:19:12 +0000
@@ -81,7 +81,7 @@
81 latest = output.decode('utf-8').split(':')[0]81 latest = output.decode('utf-8').split(':')[0]
82 version_string = latest == revision and tag or 'r%s' % latest82 version_string = latest == revision and tag or 'r%s' % latest
83 # Save decimal version in case we need to do a portable build.83 # Save decimal version in case we need to do a portable build.
84 version = latest == revision and tag or '%s.%s' % (tag, latest)84 version = latest == revision and tag or '%s-bzr%s' % (tag, latest)
85 return version_string, version85 return version_string, version
8686
8787
@@ -92,21 +92,24 @@
92 f = open('appveyor.yml')92 f = open('appveyor.yml')
93 yml_text = f.read()93 yml_text = f.read()
94 f.close()94 f.close()
95 yml_text = yml_text.replace('BRANCHNAME', branch)95 version_string, version = get_version()
96 yml_text = yml_text.replace('TAG', version)
96 if build_type in ['openlp', 'trunk']:97 if build_type in ['openlp', 'trunk']:
98 yml_text = yml_text.replace('BRANCHPATH', '~openlp-core/openlp/trunk')
97 yml_text = yml_text.replace('BUILD_DOCS', '$TRUE')99 yml_text = yml_text.replace('BUILD_DOCS', '$TRUE')
98 else:100 else:
101 yml_text = yml_text.replace('BRANCHPATH', branch.split(':')[1])
99 yml_text = yml_text.replace('BUILD_DOCS', '$FALSE')102 yml_text = yml_text.replace('BUILD_DOCS', '$FALSE')
100 return yml_text103 return yml_text, version_string
101104
102105
103def hook(webhook_url, yml):106def hook(webhook_url, branch, build_type):
104 """107 """
105 Activate the webhook to start the build108 Activate the webhook to start the build
106 """109 """
110 yml, version_string = get_yml(branch, build_type)
107 webhook_element['config'] = yml111 webhook_element['config'] = yml
108 webhook_element['commit']['message'] = 'Building ' + branch112 webhook_element['commit']['message'] = 'Building ' + branch
109 version_string, version = get_version()
110 webhook_element['commit']['id'] = version_string113 webhook_element['commit']['id'] = version_string
111 request = urllib.request.Request(webhook_url)114 request = urllib.request.Request(webhook_url)
112 request.add_header('Content-Type', 'application/json;charset=utf-8')115 request.add_header('Content-Type', 'application/json;charset=utf-8')
@@ -137,7 +140,7 @@
137 if build_type not in ['dev', 'trunk', 'openlp']:140 if build_type not in ['dev', 'trunk', 'openlp']:
138 print('Invalid build type\nUsage: %s <webhook-url> <branch> <dev|trunk|openlp>' % sys.argv[0])141 print('Invalid build type\nUsage: %s <webhook-url> <branch> <dev|trunk|openlp>' % sys.argv[0])
139 exit()142 exit()
140 hook(webhook_url, get_yml(branch, build_type))143 hook(webhook_url, branch, build_type)
141 # Wait 5 seconds to make sure the hook has been triggered144 # Wait 5 seconds to make sure the hook has been triggered
142 time.sleep(5)145 time.sleep(5)
143 get_appveyor_build_url(build_type)146 get_appveyor_build_url(build_type)
144147
=== modified file 'scripts/appveyor.yml'
--- scripts/appveyor.yml 2017-09-25 19:01:54 +0000
+++ scripts/appveyor.yml 2018-08-02 20:19:12 +0000
@@ -1,18 +1,17 @@
1version: OpenLP-win-ci-b{build}1version: OpenLP-win-ci-b{build}
22
3init:
4 - choco install -y --force bzr
5 - set PATH=C:\Program Files (x86)\Bazaar;%PATH%
6
7clone_script:3clone_script:
8 - bzr checkout --lightweight BRANCHNAME openlp-branch4 - curl -L https://bazaar.launchpad.net/BRANCHPATH/tarball -o sourcecode.tar.gz
5 - 7z e sourcecode.tar.gz
6 - 7z x sourcecode.tar
7 - mv BRANCHPATH openlp-branch
98
10environment:9environment:
11 PYTHON: C:\\Python3410 PYTHON: C:\\Python34
1211
13install:12install:
14 # Install dependencies from pypi13 # Install dependencies from pypi
15 - "%PYTHON%\\python.exe -m pip install sqlalchemy alembic chardet beautifulsoup4 Mako nose mock pyodbc==4.0.8 psycopg2 pypiwin32 pyenchant websockets asyncio waitress six webob requests"14 - "%PYTHON%\\python.exe -m pip install sqlalchemy alembic chardet beautifulsoup4 Mako nose mock pyodbc==4.0.8 psycopg2 pypiwin32==219 pyenchant websockets asyncio waitress six webob requests"
16 # Install mysql dependency15 # Install mysql dependency
17 - "%PYTHON%\\python.exe -m pip install http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.0.4.zip#md5=3df394d89300db95163f17c843ef49df"16 - "%PYTHON%\\python.exe -m pip install http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.0.4.zip#md5=3df394d89300db95163f17c843ef49df"
18 # Download and install lxml and pyicu (originally from http://www.lfd.uci.edu/~gohlke/pythonlibs/)17 # Download and install lxml and pyicu (originally from http://www.lfd.uci.edu/~gohlke/pythonlibs/)
@@ -74,10 +73,10 @@
74 7z x documentation.tar73 7z x documentation.tar
75 mv ~openlp-core/openlp/documentation documentation74 mv ~openlp-core/openlp/documentation documentation
76 cd packaging75 cd packaging
77 &"$env:PYTHON\python.exe" builders/windows-builder.py --skip-update -c windows/config-appveyor.ini -b ../openlp-branch -d ../documentation --portable76 &"$env:PYTHON\python.exe" builders/windows-builder.py --skip-update -c windows/config-appveyor.ini -b ../openlp-branch -d ../documentation --portable --tag-override TAG
78 } else {77 } else {
79 cd packaging78 cd packaging
80 &"$env:PYTHON\python.exe" builders/windows-builder.py --skip-update --skip-translations -c windows/config-appveyor.ini -b ../openlp-branch --portable79 &"$env:PYTHON\python.exe" builders/windows-builder.py --skip-update --skip-translations -c windows/config-appveyor.ini -b ../openlp-branch --portable --tag-override TAG
81 }80 }
8281
83artifacts:82artifacts: