jenkins: sync staging source before deploy
This commit is contained in:
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
@@ -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.'
|
||||
|
||||
Reference in New Issue
Block a user