update jenkinfile
This commit is contained in:
5
Jenkinsfile
vendored
5
Jenkinsfile
vendored
@@ -47,6 +47,9 @@ pipeline {
|
||||
|
||||
stage('Deploy via SSH') {
|
||||
steps {
|
||||
script {
|
||||
env.DEPLOY_BRANCH = env.BRANCH_NAME ?: 'main'
|
||||
}
|
||||
sshagent(credentials: ['deploy-ssh-key']) {
|
||||
sh """
|
||||
ssh -o StrictHostKeyChecking=no ${env.DEPLOY_USER}@${env.DEPLOY_HOST} << 'DEPLOY_EOF'
|
||||
@@ -56,7 +59,7 @@ pipeline {
|
||||
# Clone or pull the repo (contains docker-compose.yml)
|
||||
if [ -d .git ]; then
|
||||
git fetch origin
|
||||
git reset --hard origin/${env.BRANCH_NAME}
|
||||
git reset --hard origin/${env.DEPLOY_BRANCH}
|
||||
else
|
||||
git clone ${env.GIT_REPO_URL} .
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user