From 348d14c3307a059cf38f446a305f284bc85e0533 Mon Sep 17 00:00:00 2001 From: Mandel Olaiya Date: Sun, 26 Apr 2026 14:13:57 +0200 Subject: [PATCH] jenkins: sync staging source before deploy --- Jenkinsfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index b515ea7..dc8a02f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -130,6 +130,19 @@ PY } } } + stage('Sync Staging Source') { + agent { label 'built-in' } + options { + timeout(time: 5, unit: 'MINUTES') + } + steps { + sh ''' + set -e + REMOTE_CMD="cd '${STAGING_AUDIT_PROJECT_DIR}' && if [ -d .git ]; then git fetch --prune origin && git reset --hard origin/master && git rev-parse --short HEAD; else echo 'NO_GIT_REPO'; fi" + sudo -n -u mandel -g www-data /srv/apps/mandel-dashboard/.venv/bin/python /srv/apps/mandel-dashboard/bin/deploy_stg_from_jenkins.py "${STAGING_AUDIT_PROJECT_NAME}" --command "$REMOTE_CMD" + ''' + } + } stage('Deploy Staging') { steps { echo 'Triggering staging deploy for mandelstudio after successful CI build.'