Compare commits
2 Commits
fix/cl9-mo
...
fix/cl9-je
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e2dd1bfc7 | |||
| 99f020f560 |
44
Jenkinsfile
vendored
44
Jenkinsfile
vendored
@@ -11,7 +11,7 @@ pipeline {
|
|||||||
APP_HOST = "${env.APP_HOST ?: '192.168.68.89'}"
|
APP_HOST = "${env.APP_HOST ?: '192.168.68.89'}"
|
||||||
APP_USER = "${env.APP_USER ?: 'deploy'}"
|
APP_USER = "${env.APP_USER ?: 'deploy'}"
|
||||||
DEPLOY_PATH = "${env.DEPLOY_PATH ?: '/opt/plesk-agency-portal'}"
|
DEPLOY_PATH = "${env.DEPLOY_PATH ?: '/opt/plesk-agency-portal'}"
|
||||||
APP_BASE_URL = "${env.APP_BASE_URL ?: 'https://portal.rdbcloud.co.uk}"
|
APP_BASE_URL = "${env.APP_BASE_URL ?: 'http://192.168.68.89:3000'}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,34 +79,34 @@ stage('Deploy') {
|
|||||||
keyFileVariable: 'SSH_KEY'
|
keyFileVariable: 'SSH_KEY'
|
||||||
)]) {
|
)]) {
|
||||||
sh '''
|
sh '''
|
||||||
bash -eo pipefail << 'EOF'
|
bash -eo pipefail << 'EOF'
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
ssh -i "$SSH_KEY" "$APP_USER@$APP_HOST" "mkdir -p $DEPLOY_PATH/scripts"
|
ssh -i "$SSH_KEY" "$APP_USER@$APP_HOST" "mkdir -p $DEPLOY_PATH/scripts"
|
||||||
|
|
||||||
rsync -az \
|
rsync -az \
|
||||||
-e "ssh -i $SSH_KEY" \
|
-e "ssh -i $SSH_KEY" \
|
||||||
docker-compose.prod.yml \
|
docker-compose.prod.yml \
|
||||||
"$APP_USER@$APP_HOST:$DEPLOY_PATH/"
|
"$APP_USER@$APP_HOST:$DEPLOY_PATH/"
|
||||||
|
|
||||||
rsync -az \
|
rsync -az \
|
||||||
-e "ssh -i $SSH_KEY" \
|
-e "ssh -i $SSH_KEY" \
|
||||||
scripts/ \
|
scripts/ \
|
||||||
"$APP_USER@$APP_HOST:$DEPLOY_PATH/scripts/"
|
"$APP_USER@$APP_HOST:$DEPLOY_PATH/scripts/"
|
||||||
|
|
||||||
docker save ${IMAGE_LATEST} ${IMAGE_BUILD} \
|
docker save ${IMAGE_LATEST} ${IMAGE_BUILD} \
|
||||||
| ssh -i "$SSH_KEY" "$APP_USER@$APP_HOST" 'docker load'
|
| ssh -i "$SSH_KEY" "$APP_USER@$APP_HOST" 'docker load'
|
||||||
|
|
||||||
ssh -i "$SSH_KEY" "$APP_USER@$APP_HOST" \
|
ssh -i "$SSH_KEY" "$APP_USER@$APP_HOST" \
|
||||||
"cd $DEPLOY_PATH && chmod +x ./scripts/deploy-prod.sh ./scripts/smoke-check.sh ./scripts/rollback-prod.sh"
|
"cd $DEPLOY_PATH && chmod +x ./scripts/deploy-prod.sh ./scripts/smoke-check.sh ./scripts/rollback-prod.sh"
|
||||||
|
|
||||||
ssh -i "$SSH_KEY" "$APP_USER@$APP_HOST" \
|
ssh -i "$SSH_KEY" "$APP_USER@$APP_HOST" \
|
||||||
"cd $DEPLOY_PATH && ./scripts/deploy-prod.sh"
|
"cd $DEPLOY_PATH && ./scripts/deploy-prod.sh"
|
||||||
EOF
|
EOF
|
||||||
'''
|
'''
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Smoke check') {
|
stage('Smoke check') {
|
||||||
steps {
|
steps {
|
||||||
|
|||||||
Reference in New Issue
Block a user