From b830d52bef0f306f721441b56aee872234e69a2a Mon Sep 17 00:00:00 2001 From: Luke Sikina Date: Mon, 28 Oct 2024 11:11:36 -0400 Subject: [PATCH] [ALS-7703] Patches for GIC release - Bump jenkins version - Fix Update User Token job to work with psama >=3.2.x - Long awaited fix to persist DOCKER_CONFIG_DIR, and MYSQL_NETWORK vars through restart --- initial-configuration/jenkins/jenkins-docker/Dockerfile | 2 +- .../jenkins/jenkins-docker/jobs/Update User Token/config.xml | 2 +- update-jenkins.sh | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/initial-configuration/jenkins/jenkins-docker/Dockerfile b/initial-configuration/jenkins/jenkins-docker/Dockerfile index a8ade3e6..12c9d0fd 100644 --- a/initial-configuration/jenkins/jenkins-docker/Dockerfile +++ b/initial-configuration/jenkins/jenkins-docker/Dockerfile @@ -1,4 +1,4 @@ -FROM jenkins/jenkins:2.440-jdk11 +FROM jenkins/jenkins:2.442-jdk11 COPY plugins.yml /usr/share/jenkins/ref/plugins.yml diff --git a/initial-configuration/jenkins/jenkins-docker/jobs/Update User Token/config.xml b/initial-configuration/jenkins/jenkins-docker/jobs/Update User Token/config.xml index 4a0a9b74..967fa68d 100644 --- a/initial-configuration/jenkins/jenkins-docker/jobs/Update User Token/config.xml +++ b/initial-configuration/jenkins/jenkins-docker/jobs/Update User Token/config.xml @@ -61,7 +61,7 @@ grep client_secret /usr/local/docker-config/wildfly/standalone.xml | cut -d &apo export USER_SUBJECT=`docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -N -e \ "SELECT subject FROM auth.user where email='$USERNAME'; "` -export user_token=`java -jar generateJwt.jar secret.txt sub "${USER_SUBJECT}" ${DAYSUNTILEXPIRATION} day | grep -v "Generating"` +export user_token=`java -jar generateJwt.jar secret.txt sub "LONG_TERM_TOKEN|${USER_SUBJECT}" ${DAYSUNTILEXPIRATION} day | grep -v "Generating"` docker run -i -v /root/.my.cnf:/root/.my.cnf --network=${MYSQL_NETWORK:-host} mysql mysql -e \ "update auth.user set long_term_token='$user_token' where email='$USERNAME';" diff --git a/update-jenkins.sh b/update-jenkins.sh index 67f57d7d..28d6b32e 100755 --- a/update-jenkins.sh +++ b/update-jenkins.sh @@ -35,6 +35,8 @@ fi # Pull through previous PICSURE configurations sed -i "s|__PROJECT_SPECIFIC_OVERRIDE_REPO__|`cat /var/jenkins_home_bak/config.xml | grep -A1 project_specific_override_repo | tail -1 | sed 's/<\/*string>//g' | sed 's/ //g' `|g" /var/jenkins_home/config.xml sed -i "s|__RELEASE_CONTROL_REPO__|`cat /var/jenkins_home_bak/config.xml | grep -A1 release_control_repo | tail -1 | sed 's/<\/*string>//g' | sed 's/ //g' `|g" /var/jenkins_home/config.xml +sed -i "s|/usr/local/docker-config/|`cat /var/jenkins_home_bak/config.xml | grep -A1 DOCKER_CONFIG_DIR | tail -1 | sed 's/<\/*string>//g' | sed 's/ //g' `|g" /var/jenkins_home/config.xml +sed -i "s|host|`cat /var/jenkins_home_bak/config.xml | grep -A1 MYSQL_NETWORK | tail -1 | sed 's/<\/*string>//g' | sed 's/ //g' `|g" /var/jenkins_home/config.xml sed -i "s|*/master|`cat /var/jenkins_home_bak/config.xml | grep -A1 release_control_branch | tail -1 | sed 's/<\/*string>//g' | sed 's/ //g' `|g" /var/jenkins_home/config.xml