forked from openlp/openlp
Workaround for bazaar no longer working on appveyor. We now download a tarball instead of checking out the code.
bzr-revno: 2824
This commit is contained in:
commit
19922d38d9
@ -81,7 +81,7 @@ def get_version():
|
|||||||
latest = output.decode('utf-8').split(':')[0]
|
latest = output.decode('utf-8').split(':')[0]
|
||||||
version_string = latest == revision and tag or 'r%s' % latest
|
version_string = latest == revision and tag or 'r%s' % latest
|
||||||
# Save decimal version in case we need to do a portable build.
|
# Save decimal version in case we need to do a portable build.
|
||||||
version = latest == revision and tag or '%s.%s' % (tag, latest)
|
version = latest == revision and tag or '%s-bzr%s' % (tag, latest)
|
||||||
return version_string, version
|
return version_string, version
|
||||||
|
|
||||||
|
|
||||||
@ -92,21 +92,24 @@ def get_yml(branch, build_type):
|
|||||||
f = open('appveyor.yml')
|
f = open('appveyor.yml')
|
||||||
yml_text = f.read()
|
yml_text = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
yml_text = yml_text.replace('BRANCHNAME', branch)
|
version_string, version = get_version()
|
||||||
|
yml_text = yml_text.replace('TAG', version)
|
||||||
if build_type in ['openlp', 'trunk']:
|
if build_type in ['openlp', 'trunk']:
|
||||||
|
yml_text = yml_text.replace('BRANCHPATH', '~openlp-core/openlp/trunk')
|
||||||
yml_text = yml_text.replace('BUILD_DOCS', '$TRUE')
|
yml_text = yml_text.replace('BUILD_DOCS', '$TRUE')
|
||||||
else:
|
else:
|
||||||
|
yml_text = yml_text.replace('BRANCHPATH', branch.split(':')[1])
|
||||||
yml_text = yml_text.replace('BUILD_DOCS', '$FALSE')
|
yml_text = yml_text.replace('BUILD_DOCS', '$FALSE')
|
||||||
return yml_text
|
return yml_text, version_string
|
||||||
|
|
||||||
|
|
||||||
def hook(webhook_url, yml):
|
def hook(webhook_url, branch, build_type):
|
||||||
"""
|
"""
|
||||||
Activate the webhook to start the build
|
Activate the webhook to start the build
|
||||||
"""
|
"""
|
||||||
|
yml, version_string = get_yml(branch, build_type)
|
||||||
webhook_element['config'] = yml
|
webhook_element['config'] = yml
|
||||||
webhook_element['commit']['message'] = 'Building ' + branch
|
webhook_element['commit']['message'] = 'Building ' + branch
|
||||||
version_string, version = get_version()
|
|
||||||
webhook_element['commit']['id'] = version_string
|
webhook_element['commit']['id'] = version_string
|
||||||
request = urllib.request.Request(webhook_url)
|
request = urllib.request.Request(webhook_url)
|
||||||
request.add_header('Content-Type', 'application/json;charset=utf-8')
|
request.add_header('Content-Type', 'application/json;charset=utf-8')
|
||||||
@ -137,7 +140,7 @@ else:
|
|||||||
if build_type not in ['dev', 'trunk', 'openlp']:
|
if build_type not in ['dev', 'trunk', 'openlp']:
|
||||||
print('Invalid build type\nUsage: %s <webhook-url> <branch> <dev|trunk|openlp>' % sys.argv[0])
|
print('Invalid build type\nUsage: %s <webhook-url> <branch> <dev|trunk|openlp>' % sys.argv[0])
|
||||||
exit()
|
exit()
|
||||||
hook(webhook_url, get_yml(branch, build_type))
|
hook(webhook_url, branch, build_type)
|
||||||
# Wait 5 seconds to make sure the hook has been triggered
|
# Wait 5 seconds to make sure the hook has been triggered
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
get_appveyor_build_url(build_type)
|
get_appveyor_build_url(build_type)
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
version: OpenLP-win-ci-b{build}
|
version: OpenLP-win-ci-b{build}
|
||||||
|
|
||||||
init:
|
|
||||||
- choco install -y --force bzr
|
|
||||||
- set PATH=C:\Program Files (x86)\Bazaar;%PATH%
|
|
||||||
|
|
||||||
clone_script:
|
clone_script:
|
||||||
- bzr checkout --lightweight BRANCHNAME openlp-branch
|
- curl -L https://bazaar.launchpad.net/BRANCHPATH/tarball -o sourcecode.tar.gz
|
||||||
|
- 7z e sourcecode.tar.gz
|
||||||
|
- 7z x sourcecode.tar
|
||||||
|
- mv BRANCHPATH openlp-branch
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
PYTHON: C:\\Python34
|
PYTHON: C:\\Python34
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# Install dependencies from pypi
|
# Install dependencies from pypi
|
||||||
- "%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"
|
- "%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"
|
||||||
# Install mysql dependency
|
# Install mysql dependency
|
||||||
- "%PYTHON%\\python.exe -m pip install http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.0.4.zip#md5=3df394d89300db95163f17c843ef49df"
|
- "%PYTHON%\\python.exe -m pip install http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.0.4.zip#md5=3df394d89300db95163f17c843ef49df"
|
||||||
# Download and install lxml and pyicu (originally from http://www.lfd.uci.edu/~gohlke/pythonlibs/)
|
# Download and install lxml and pyicu (originally from http://www.lfd.uci.edu/~gohlke/pythonlibs/)
|
||||||
@ -74,10 +73,10 @@ after_test:
|
|||||||
7z x documentation.tar
|
7z x documentation.tar
|
||||||
mv ~openlp-core/openlp/documentation documentation
|
mv ~openlp-core/openlp/documentation documentation
|
||||||
cd packaging
|
cd packaging
|
||||||
&"$env:PYTHON\python.exe" builders/windows-builder.py --skip-update -c windows/config-appveyor.ini -b ../openlp-branch -d ../documentation --portable
|
&"$env:PYTHON\python.exe" builders/windows-builder.py --skip-update -c windows/config-appveyor.ini -b ../openlp-branch -d ../documentation --portable --tag-override TAG
|
||||||
} else {
|
} else {
|
||||||
cd packaging
|
cd packaging
|
||||||
&"$env:PYTHON\python.exe" builders/windows-builder.py --skip-update --skip-translations -c windows/config-appveyor.ini -b ../openlp-branch --portable
|
&"$env:PYTHON\python.exe" builders/windows-builder.py --skip-update --skip-translations -c windows/config-appveyor.ini -b ../openlp-branch --portable --tag-override TAG
|
||||||
}
|
}
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
|
Loading…
Reference in New Issue
Block a user