summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_build_service.sh
blob: fe50e2e3b7c78526102a1c5c3998919fbcba9907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash

# Copyright © 2017 Holger Levsen (holger@layer-acht.org)
# released under the GPLv=2

# normally defined by jenkins
JENKINS_URL=https://jenkins.debian.net

DEBUG=false
. /srv/jenkins/bin/common-functions.sh
common_init "$@"

# common code defining db access
. /srv/jenkins/bin/reproducible_common.sh

set -e
set -x
# sleep 1-23 secs to randomize start times
/bin/sleep $(echo "scale=1 ; $(shuf -i 1-230 -n 1)/10" | bc )

BUILD_URL=https://jenkins.debian.net/userContent/build_service/$1
BUILD_BASE=/var/lib/jenkins/userContent/reproducible/debian/build_service/$1
mkdir -p $BUILD_BASE
OLD_ID=$((ls -1rt $BUILD_BASE||echo 0)|tail -1)
let BUILD_ID=OLD_ID+1

case $1 in
	arm64_builder1)		NODE1=codethink-sled12-arm64	NODE2=codethink-sled15-arm64 ;;
	*)			echo "Sleeping 60min" 
				sleep 60m
				exit 0
				;;
esac

/srv/jenkins/bin/reproducible_build.sh $NODE1 $NODE2 >$BUILD_BASE/$BUILD_ID.log 2>&1

# <      h01ger> | we could still make the logs accessable to browsers
# <      h01ger> | and we need maintenance to cleanup the log files eventually
# <      h01ger> | and translate that yaml to crontab entries