Update to the appveyor integration script to work with the new packaging builder.

bzr-revno: 2712
This commit is contained in:
second@tgc.dk 2016-12-18 14:56:51 +01:00 committed by Tomas Groth
commit b197e59610
2 changed files with 29 additions and 12 deletions

View File

@ -42,7 +42,7 @@ webhook_element = \
{ {
'commit': { 'commit': {
'author': { 'author': {
'email': 'open@contributer', 'email': 'contributer@openlp',
'name': 'OpenLP Contributor' 'name': 'OpenLP Contributor'
}, },
'id': None, 'id': None,
@ -92,6 +92,10 @@ def get_yml(branch):
yml_text = f.read() yml_text = f.read()
f.close() f.close()
yml_text = yml_text.replace('BRANCHNAME', branch) yml_text = yml_text.replace('BRANCHNAME', branch)
if 'openlp-core/openlp/trunk' in branch:
yml_text = yml_text.replace('BUILD_DOCS', '$TRUE')
else:
yml_text = yml_text.replace('BUILD_DOCS', '$FALSE')
return yml_text return yml_text
@ -115,8 +119,6 @@ def get_appveyor_build_url(branch):
""" """
Get the url of the build. Get the url of the build.
""" """
# Wait 10 seconds to make sure the hook has been triggered
time.sleep(10)
responce = urllib.request.urlopen(appveyor_api_url) responce = urllib.request.urlopen(appveyor_api_url)
json_str = responce.read().decode('utf-8') json_str = responce.read().decode('utf-8')
build_json = json.loads(json_str) build_json = json.loads(json_str)
@ -130,4 +132,6 @@ else:
webhook_url = sys.argv[1] webhook_url = sys.argv[1]
branch = sys.argv[2] branch = sys.argv[2]
hook(webhook_url, get_yml(branch)) hook(webhook_url, get_yml(branch))
# Wait 5 seconds to make sure the hook has been triggered
time.sleep(5)
get_appveyor_build_url(branch) get_appveyor_build_url(branch)

View File

@ -3,7 +3,6 @@ version: OpenLP-win-ci-b{build}
init: init:
- choco install -y --force bzr - choco install -y --force bzr
- set PATH=C:\Program Files (x86)\Bazaar;%PATH% - set PATH=C:\Program Files (x86)\Bazaar;%PATH%
- bzr --version
clone_script: clone_script:
- bzr checkout --lightweight BRANCHNAME openlp-branch - bzr checkout --lightweight BRANCHNAME openlp-branch
@ -32,11 +31,11 @@ install:
- 7z x -oMediaInfo MediaInfo_CLI_0.7.90_Windows_i386.zip - 7z x -oMediaInfo MediaInfo_CLI_0.7.90_Windows_i386.zip
- cp MediaInfo\\MediaInfo.exe openlp-branch\\MediaInfo.exe - cp MediaInfo\\MediaInfo.exe openlp-branch\\MediaInfo.exe
build: off build: off
test_script: test_script:
- cd openlp-branch - cd openlp-branch
# Run the tests
- "%PYTHON%\\python.exe -m nose -v tests" - "%PYTHON%\\python.exe -m nose -v tests"
# Go back to the user root folder # Go back to the user root folder
- cd.. - cd..
@ -44,10 +43,10 @@ test_script:
after_test: after_test:
# This is where we create a package using PyInstaller # This is where we create a package using PyInstaller
# First get PyInstaller # First get PyInstaller
- curl -L -O https://github.com/pyinstaller/pyinstaller/archive/develop.zip - curl -L -O https://github.com/pyinstaller/pyinstaller/releases/download/v3.2/PyInstaller-3.2.zip
- 7z x develop.zip - 7z x PyInstaller-3.2.zip
# Install PyInstaller dependencies # Install PyInstaller dependencies
- "%PYTHON%\\python.exe -m pip install future" - "%PYTHON%\\python.exe -m pip install future pefile"
# Download and install Inno Setup - used for packaging # Download and install Inno Setup - used for packaging
- curl -L -O http://www.jrsoftware.org/download.php/is-unicode.exe - curl -L -O http://www.jrsoftware.org/download.php/is-unicode.exe
- is-unicode.exe /VERYSILENT /SUPPRESSMSGBOXES /SP- - is-unicode.exe /VERYSILENT /SUPPRESSMSGBOXES /SP-
@ -62,10 +61,24 @@ after_test:
# - curl -L -O http://downloads.sourceforge.net/project/portableapps/NSIS%20Portable/NSISPortable_3.0_English.paf.exe # - curl -L -O http://downloads.sourceforge.net/project/portableapps/NSIS%20Portable/NSISPortable_3.0_English.paf.exe
# - NSISPortable_3.0_English.paf.exe /S # - NSISPortable_3.0_English.paf.exe /S
# Get the packaging code # Get the packaging code
- bzr checkout --lightweight lp:openlp/packaging packaging - curl -L http://bazaar.launchpad.net/~openlp-core/openlp/packaging/tarball -o packaging.tar.gz
# Build the bundle - 7z e packaging.tar.gz
- cd packaging - 7z x packaging.tar
- "%PYTHON%\\python.exe windows/windows-builder.py -v -u -t -c windows/config-appveyor.ini -b ../openlp-branch" - mv ~openlp-core/openlp/packaging packaging
# If this is trunk we should also build the manual
- ps: >-
If (BUILD_DOCS) {
&"$env:PYTHON\python.exe" -m pip install sphinx
Invoke-WebRequest -Uri "http://bazaar.launchpad.net/~openlp-core/openlp/documentation/tarball" -OutFile documentation.tar.gz
7z e documentation.tar.gz
7z x documentation.tar
mv ~openlp-core/openlp/documentation documentation
cd packaging
&"$env:PYTHON\python.exe" builders/windows-builder.py --skip-update --skip-translations -c windows/config-appveyor.ini -b ../openlp-branch -d ../documentation --portable
} else {
cd packaging
&"$env:PYTHON\python.exe" builders/windows-builder.py --skip-update --skip-translations -c windows/config-appveyor.ini -b ../openlp-branch --portable
}
artifacts: artifacts:
- path: openlp-branch\dist\*.exe - path: openlp-branch\dist\*.exe