blob: fd5baafd6dc6922aad46702b150656a6aa11daa0 (
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
|
#!/bin/bash
# Copyright © 2015 Holger Levsen <holger@layer-acht.org>
# released under the GPLv=2
DEBUG=false
. /srv/jenkins/bin/common-functions.sh
common_init "$@"
# common code defining db access
. /srv/jenkins/bin/reproducible_common.sh
TARGET_DIR=/srv/reproducible-results/node-information/
mkdir -p $TARGET_DIR
TMPFILE_SRC=$(mktemp)
TMPFILE_NODE=$(mktemp)
for NODE in $BUILD_NODES ; do
# call jenkins_master_wrapper.sh so we only need to track different ssh ports in one place
# jenkins_master_wrapper.sh needs NODE_NAME and JOB_NAME
export NODE_NAME=$NODE
export JOB_NAME=/srv/jenkins/bin/reproducible_info.sh
/srv/jenkins/bin/jenkins_master_wrapper.sh > $TMPFILE_SRC
for KEY in $BUILD_ENV_VARS ; do
VALUE=$(egrep "^$KEY=" $TMPFILE_SRC | cut -d "=" -f2-)
if [ ! -z "$VALUE" ] ; then
echo "$KEY=$VALUE" >> $TMPFILE_NODE
fi
done
if [ -s $TMPFILE_NODE ] ; then
mv $TMPFILE_NODE $TARGET_DIR/$NODE
echo "$(date -u) - $TARGET_DIR/$NODE updated."
cat $TARGET_DIR/$NODE
fi
rm -f $TMPFILE_SRC $TMPFILE_NODE
done
|