From 5e49eb93a2f1566e9f5e02a2bea2f1e5ae44bb0a Mon Sep 17 00:00:00 2001 From: Mandel Olaiya Date: Fri, 10 Apr 2026 18:54:30 +0200 Subject: [PATCH] Run multilingual audit on Jenkins built-in node --- Jenkinsfile | 26 +++++++++++++++++++++++--- Jenkinsfile.multilingual-nightly | 7 ++++++- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a404560..48cb378 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -142,13 +142,33 @@ PY } } stage('Post-Deploy Multilingual Audit') { + agent { label 'built-in' } options { timeout(time: 10, unit: 'MINUTES') } steps { - sh 'mkdir -p artifacts && chmod +x scripts/run_remote_multilingual_audit.sh' - withCredentials([sshUserPrivateKey(credentialsId: env.STAGING_AUDIT_SSH_CREDENTIALS_ID, keyFileVariable: 'STAGING_SSH_KEYFILE')]) { - sh './scripts/run_remote_multilingual_audit.sh' + withCredentials([ + sshUserPrivateKey(credentialsId: 'gitea-ssh', keyFileVariable: 'GIT_KEYFILE'), + sshUserPrivateKey(credentialsId: env.STAGING_AUDIT_SSH_CREDENTIALS_ID, keyFileVariable: 'STAGING_SSH_KEYFILE') + ]) { + sh ''' + export GIT_SSH_COMMAND="ssh -i $GIT_KEYFILE -o StrictHostKeyChecking=accept-new" + if [ -d .git ]; then + if git remote get-url origin >/dev/null 2>&1; then + git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git + else + git remote add origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git + fi + git fetch --tags --force --progress origin +refs/heads/master:refs/remotes/origin/master + else + git clone ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git . + git fetch --tags --force --progress origin +refs/heads/master:refs/remotes/origin/master + fi + git checkout -f refs/remotes/origin/master + mkdir -p artifacts + chmod +x scripts/run_remote_multilingual_audit.sh + ./scripts/run_remote_multilingual_audit.sh + ''' } script { int status = sh(script: 'python3 scripts/multilingual_audit_ci.py --json artifacts/multilingual-audit.json', returnStatus: true) diff --git a/Jenkinsfile.multilingual-nightly b/Jenkinsfile.multilingual-nightly index 621b11b..f6893c7 100644 --- a/Jenkinsfile.multilingual-nightly +++ b/Jenkinsfile.multilingual-nightly @@ -17,12 +17,17 @@ pipeline { } stages { stage('Checkout') { + agent { label 'built-in' } steps { withCredentials([sshUserPrivateKey(credentialsId: 'gitea-ssh', keyFileVariable: 'GIT_KEYFILE')]) { sh ''' export GIT_SSH_COMMAND="ssh -i $GIT_KEYFILE -o StrictHostKeyChecking=accept-new" if [ -d .git ]; then - git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git + if git remote get-url origin >/dev/null 2>&1; then + git remote set-url origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git + else + git remote add origin ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git + fi git fetch --tags --force --progress origin +refs/heads/master:refs/remotes/origin/master else git clone ssh://git@git.mandelblog.com:2222/salt/mandelstudio.git .