1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 22:40:12 +01:00
fdroidserver/jenkins-build-all
Hans-Christoph Steiner fdbfb4d1a2 build: stop git from waiting forever at username/password prompts
If a git fetch/clone/submodule URL points to gitlab, github, bitbucket, etc
and that repo does not exist any more, those services will prompt the user
for a username/password so that the service can check if its a private
repo.  Private repos show up the same as non-existent repos.  This employs
two techniques for making sure that git never waits at those prompts.  It
instead should just fail immediately.  The buildserver has been hanging on
these prompts forever, until manually killed.  This change will apply to
updates both on the buildserver host, and the buildserver guest vm.

This uses the "insteadOf" git config option to rewrite URLs to always use
HTTPS and then include a fake username/password so that git will use those
in the prompts and fail immediately.  This trick has been in use on the
verification server for a long while and has been working well.  It has
also been used on jenkins.debian.net in the host.
https://f-droid.org/en/docs/Verification_Server/

It also includes GIT_TERMINAL_PROMPT, which also prevents the bad behavior,
which was added in git 2.3.
https://github.com/blog/1957-git-2-3-has-been-released
2017-11-23 23:31:37 +01:00

84 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
#
# this is the script run by the Jenkins server to run the build tests. Be
# sure to always run it in its dir, i.e. ./jenkins-build, otherwise it might
# remove things that you don't want it to.
#
# runs here:
# https://jenkins.debian.net/job/reproducible_fdroid_build_apps
if [ `dirname $0` != "." ]; then
echo "only run this script like ./`basename $0`"
exit
fi
# jenkins.debian.net slaves do not export WORKSPACE
if [ -z $WORKSPACE ]; then
export WORKSPACE=`pwd`
fi
set -e
set -x
# report info about virtualization
(dmesg | grep -i -e hypervisor -e qemu -e kvm) || true
(lspci | grep -i -e virtio -e virtualbox -e qemu -e kvm) || true
lsmod
if systemd-detect-virt -q ; then
echo "Virtualization is used:" `systemd-detect-virt`
else
echo "No virtualization is used."
fi
sudo /bin/chmod -R a+rX /var/lib/libvirt/images
ulimit -n 2048
echo 'maximum allowed number of open file descriptors: ' `ulimit -n`
ls -ld /var/lib/libvirt/images
ls -l /var/lib/libvirt/images || echo no access
ls -lR ~/.vagrant.d/ || echo no access
virsh --connect qemu:///system list --all || echo cannot virsh list
cat /etc/issue
/sbin/ifconfig || true
hostname || true
# point to the Vagrant/VirtualBox configs created by reproducible_setup_fdroid_build_environment.sh
# these variables are actually set in fdroidserver/jenkins-build-makebuildserver
export SETUP_WORKSPACE=$(dirname $WORKSPACE)/reproducible_setup_fdroid_build_environment
export XDG_CONFIG_HOME=$SETUP_WORKSPACE
export VBOX_USER_HOME=$SETUP_WORKSPACE/VirtualBox
export VAGRANT_HOME=$SETUP_WORKSPACE/vagrant.d
# make sure we have the right buildserver paths and its ready for use
vagrant global-status | grep reproducible_setup_fdroid_build_environment
# the way we handle jenkins slaves doesn't copy the workspace to the slaves
# so we need to "manually" clone the git repo here…
cd $WORKSPACE
# set up Android SDK to use the Debian packages in stretch
export ANDROID_HOME=/usr/lib/android-sdk
# now build the whole archive
cd $WORKSPACE
# this can be handled in the jenkins job, or here:
if [ -e fdroiddata ]; then
cd fdroiddata
git remote update -p
git checkout master
git reset --hard origin/master
# keep all the cloned source repos
git clean -fdx --exclude build --exclude repo --exclude unsigned
else
git clone https://gitlab.com/fdroid/fdroiddata.git fdroiddata
cd fdroiddata
fi
echo "build_server_always = True" > config.py
$WORKSPACE/fdroid build --verbose --latest --no-tarball --all
vagrant global-status
cd builder
vagrant status