[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] 2 commits: init_node: shellcheck

Mattia Rizzolo gitlab at salsa.debian.org
Wed Jul 1 17:54:14 BST 2020



Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net


Commits:
cf70ea0a by Mattia Rizzolo at 2020-07-01T18:51:42+02:00
init_node: shellcheck

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -
99bdf68c by Mattia Rizzolo at 2020-07-01T18:51:57+02:00
init_node: use sudo instead of log out and log ins, etc

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


1 changed file:

- init_node


Changes:

=====================================
init_node
=====================================
@@ -10,7 +10,7 @@
 #   and run there manually once :)
 
 # let's check our assumptions first…
-if [ $(id -u) -ne 0 ] ; then
+if [ "$(id -u)" -ne 0 ] ; then
 	echo This needs to be run as root… exiting.
 	exit 1
 fi
@@ -19,7 +19,7 @@ START=$(date +'%s')
 GIT_REPO="https://salsa.debian.org/qa/jenkins.debian.net.git"
 
 echo
-echo "$(date -u)"
+date -u
 set -e
 export LANG=C
 set -x
@@ -42,12 +42,14 @@ set +x
 set +e
 
 END=$(date +'%s')
-DURATION=$(( $END - $START ))
-HOUR=$(( $DURATION/3600 ))
-MIN=$(( ($DURATION-$HOUR*3600)/60 ))
-SEC=$(( $DURATION-$HOUR*3600-$MIN*60 ))
+DURATION=$(( END - START ))
+HOUR=$(( DURATION/3600 ))
+MIN=$(( (DURATION-HOUR*3600)/60 ))
+SEC=$(( DURATION-HOUR*3600-MIN*60 ))
 echo "$(date -u) - total duration: ${HOUR}h ${MIN}m ${SEC}s."
 echo
-echo "Now log out and log in as jenkins-adm and run:"
+echo "Now finish the deployment by running:"
 echo "        cd ~jenkins-adm/jenkins.debian.net/"
-echo "        ./update_jdn.sh 2>&1 | sudo tee -a /var/log/jenkins/update_jdn.log"
+# this assumes that the user you are running this script can sudo to root.
+# "usually" sudo-to-root is passwordless but sudo-to-others is not, so workaround that
+echo "        sudo sudo -u jenkins-adm ./update_jdn.sh 2>&1 | sudo tee -a /var/log/jenkins/update_jdn.log"



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/5c7968afd6bccfb8276be893d4f55c055abd0952...99bdf68c1b742e01e8fa3b2a76bf2aefe28a54de

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/5c7968afd6bccfb8276be893d4f55c055abd0952...99bdf68c1b742e01e8fa3b2a76bf2aefe28a54de
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20200701/31fe4b68/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list