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.'