1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-14 02:50:12 +01:00

Merge branch 'build-publish-staging-test' into 'master'

build/publish staging test

See merge request !207
This commit is contained in:
Hans-Christoph Steiner 2017-02-13 19:42:21 +00:00
commit bb5c2ec3de
3 changed files with 54 additions and 15 deletions

View File

@ -246,6 +246,8 @@ def release_vm():
def build_server(app, build, vcs, build_dir, output_dir, force):
"""Do a build on the build server."""
global buildserverid
try:
paramiko
except NameError:
@ -258,6 +260,10 @@ def build_server(app, build, vcs, build_dir, output_dir, force):
sshinfo = get_clean_vm()
try:
if not buildserverid:
buildserverid = subprocess.check_output(['vagrant', 'ssh', '-c',
'cat /home/vagrant/buildserverid'],
cwd='builder').rstrip()
# Open SSH connection...
logging.info("Connecting to virtual machine...")
@ -389,7 +395,10 @@ def build_server(app, build, vcs, build_dir, output_dir, force):
cmdline += ' --verbose'
cmdline += " %s:%s" % (app.id, build.vercode)
chan.exec_command('bash --login -c "' + cmdline + '"')
output = bytes()
output += b'== Installed Android Tools ==\n\n'
output += get_android_tools_version_log(build.ndk_path()).encode()
while not chan.exit_status_ready():
while chan.recv_ready():
output += chan.recv(1024)
@ -952,9 +961,11 @@ def trybuild(app, build, build_dir, output_dir, also_check_dir, srclib_dir, extl
return True
def get_android_tools_versions(sdk_path, ndk_path=None):
def get_android_tools_versions(ndk_path=None):
'''get a list of the versions of all installed Android SDK/NDK components'''
global config
sdk_path = config['sdk_path']
if sdk_path[-1] != '/':
sdk_path += '/'
components = []
@ -976,10 +987,10 @@ def get_android_tools_versions(sdk_path, ndk_path=None):
return components
def get_android_tools_version_log(sdk_path, ndk_path):
def get_android_tools_version_log(ndk_path):
'''get a list of the versions of all installed Android SDK/NDK components'''
log = ''
components = get_android_tools_versions(sdk_path, ndk_path)
components = get_android_tools_versions(ndk_path)
for name, version in sorted(components):
log += '* ' + name + ' (' + version + ')\n'
@ -1034,11 +1045,12 @@ def parse_commandline():
options = None
config = None
buildserverid = None
def main():
global options, config
global options, config, buildserverid
options, parser = parse_commandline()
@ -1137,7 +1149,7 @@ def main():
for build in app.builds:
wikilog = None
tools_version_log = '== Installed Android Tools ==\n\n'
tools_version_log += get_android_tools_version_log(config['sdk_path'], build.ndk_path())
tools_version_log += get_android_tools_version_log(build.ndk_path())
try:
# For the first build of a particular app, we need to set up
@ -1206,12 +1218,15 @@ def main():
lastbuildpage = appid + '/lastbuild_' + build.vercode
newpage = site.Pages[lastbuildpage]
with open(os.path.join('tmp', 'fdroidserverid')) as fp:
fdroidserverid = fp.read()
fdroidserverid = fp.read().rstrip()
txt = "* build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + '\n' \
+ '* fdroidserverid: [https://gitlab.com/fdroid/fdroidserver/commit/' \
+ fdroidserverid + ' ' + fdroidserverid + ']\n\n' \
+ tools_version_log + '\n\n' \
+ '== Build Log ==\n\n' + wikilog
+ fdroidserverid + ' ' + fdroidserverid + ']\n\n'
if options.onserver:
txt += '* buildserverid: [https://gitlab.com/fdroid/fdroidserver/commit/' \
+ buildserverid + ' ' + buildserverid + ']\n\n'
txt += tools_version_log + '\n\n'
txt += '== Build Log ==\n\n' + wikilog
newpage.save(txt, summary='Build log')
# Redirect from /lastbuild to the most recent build log
newpage = site.Pages[appid + '/lastbuild']

View File

@ -54,15 +54,31 @@ echo "apt_package_cache = True" >> $WORKSPACE/makebuildserver.config.py
# this can be handled in the jenkins job, or here:
if [ -e fdroiddata ]; then
cd fdroiddata
git remote update -p
git checkout master
git pull
git reset --hard origin/master
cd ..
else
git clone --depth 1 https://gitlab.com/fdroid/fdroiddata.git fdroiddata
fi
cd fdroiddata
echo "build_server_always = True" > config.py
if [ -z $ANDROID_HOME ]; then
if [ -e ~/.android/bashrc ]; then
. ~/.android/bashrc
else
echo "ANDROID_HOME must be set!"
exit
fi
fi
../fdroid init --verbose
export GNUPGHOME=$WORKSPACE/tests/gnupghome
echo "gpghome = '$GNUPGHOME'" >> config.py
echo "gpgkey = 'CE71F7FB'" >> config.py
echo "build_server_always = True" >> config.py
# if it can't build fdroid, then its really broken
../fdroid build --verbose --stop --latest org.fdroid.fdroid
# Gradle, JNI, preassemble
@ -71,5 +87,13 @@ echo "build_server_always = True" > config.py
../fdroid build --verbose --stop info.guardianproject.checkey:101
# building old versions should still work
../fdroid build --verbose --stop org.fdroid.fdroid:96150
# VLC is important, and uses cmake
../fdroid build --verbose --stop org.videolan.vlc:12000604
# test OTA update ZIP build and publish
../fdroid build --verbose --stop --latest org.fdroid.fdroid.privileged.ota
# publish process when building and signing are on separate machines
test -d repo || mkdir repo
test -d archive || mkdir archive
../fdroid publish --verbose
../fdroid gpgsign --verbose
../fdroid update --verbose --nosign
../fdroid signindex --verbose

View File

@ -121,8 +121,8 @@ if config['apt_package_cache']:
config['aptcachedir'] = cachedir + '/apt/archives'
cachefiles = [
('https://dl.google.com/android/repository/tools_r25.2.2-linux.zip',
'10d5185af8fee80a7ee093585bf84962d0a877b92a8fef489e2030e910f6a360'),
('https://dl.google.com/android/repository/tools_r25.2.3-linux.zip',
'1b35bcb94e9a686dff6460c8bca903aa0281c6696001067f34ec00093145b560'),
('https://dl.google.com/android/repository/android_m2repository_r43.zip',
'8a9aa55c894f9c79e835e3930654b26cc829c35260463b6868296d65782e18d1'),
('https://dl.google.com/android/repository/android-1.5_r04-linux.zip',