diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-09-09 15:35:55 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-09-09 15:35:55 +0200 |
commit | d59690bcecfdf97111b91b4fad8017b2b2efcf16 (patch) | |
tree | 447eea143d0911f6a2edde1417925901585528ea /bin | |
parent | 4c53f625b65425d9ad4d9e27addf8e79e0090716 (diff) | |
download | jenkins.debian.net-d59690bcecfdf97111b91b4fad8017b2b2efcf16.tar.xz |
reproducible: add new job, nodes_info, to collect environment variables from build nodes
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/jenkins_node_wrapper.sh | 4 | ||||
-rwxr-xr-x | bin/reproducible_info.sh | 4 | ||||
-rwxr-xr-x | bin/reproducible_nodes_info.sh | 32 |
3 files changed, 35 insertions, 5 deletions
diff --git a/bin/jenkins_node_wrapper.sh b/bin/jenkins_node_wrapper.sh index cf2dd3b4..054ea2a3 100755 --- a/bin/jenkins_node_wrapper.sh +++ b/bin/jenkins_node_wrapper.sh @@ -56,8 +56,6 @@ fi set "dummy" ${SSH_ORIGINAL_COMMAND} shift -info "remote_host called with $*" - allowed_cmds=() if [[ "$*" =~ /bin/nc\ localhost\ 4949 ]] ; then @@ -67,6 +65,8 @@ elif [[ "$*" =~ rebootstrap_.* ]] ; then REBOOTSTRAPSH="/srv/jenkins/bin/rebootstrap.sh $@" export LC_ALL=C exec $REBOOTSTRAPSH; croak "Exec failed"; +elif [ "$1" = "/srv/jenkins/bin/reproducible_info" ] ; then + exec /srv/jenkins/bin/reproducible_info.sh "$2" ; croak "Exec failed"; elif [ "$1" = "/srv/jenkins/bin/reproducible_build.sh" ] && ( [ "$2" = "1" ] || [ "$2" = "2" ] ) ; then exec /srv/jenkins/bin/reproducible_build.sh "$2" "$3" "$4" "$5" ; croak "Exec failed"; elif [[ "$*" =~ rsync\ --server\ --sender\ .*\ .\ /srv/reproducible-results/tmp.* ]] ; then diff --git a/bin/reproducible_info.sh b/bin/reproducible_info.sh index 41a4c630..e6d0bb54 100755 --- a/bin/reproducible_info.sh +++ b/bin/reproducible_info.sh @@ -11,7 +11,5 @@ CPU_MODEL=$(cat /proc/cpuinfo |grep "model name"|head -1|cut -d ":" -f2|xargs ec DATETIME=$(date +'%Y-%m-%d %H:%M %Z') for i in ARCH NUM_CPU CPU_MODEL DATETIME ; do - if [ "$1" = "$i" ] ; then - echo "${!i}" - fi + echo "$i=${!i}" done diff --git a/bin/reproducible_nodes_info.sh b/bin/reproducible_nodes_info.sh new file mode 100755 index 00000000..6c6ab7ed --- /dev/null +++ b/bin/reproducible_nodes_info.sh @@ -0,0 +1,32 @@ +#!/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 bpi0-armhf-rb.debian.net hb0-armhf-rb.debian.net wbq0-armhf-rb.debian.net cbxi4pro0-armhf-rb.debian.net profitbricks-build1-amd64.debian.net profitbricks-build2-amd64.debian.net ; do + # call jenkins_master_wrapper.sh so we only need to track different ssh ports in one place... + /srv/jenkins/bin/jenkins_master_wrapper.sh $NODE dummy-job /srv/jenkins/bin/reproducible_info.sh > $TMPFILE_SRC + for KEY in ARCH NUM_CPU CPU_MODEL DATETIME ; 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 + fi + rm -f $TMPFILE_SRC $TMPFILE_NODE +done + |