Update Jenkinsfile to change Git repository URL and credentials for deployment
This commit is contained in:
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
@@ -23,8 +23,8 @@ pipeline {
|
||||
$class: 'GitSCM',
|
||||
branches: [[name: "*/${params.ENVIRONMENT}"]],
|
||||
userRemoteConfigs: [[
|
||||
url: 'git@gitea.company.com:repo/anexo76.git',
|
||||
credentialsId: 'gitea-ssh'
|
||||
url: 'https://git.aduanasoft.com/ADUANASOFT/anexo76.git',
|
||||
credentialsId: 'gitea_acazares'
|
||||
]],
|
||||
extensions: [[$class: 'CloneOption', depth: 0, shallow: false]]
|
||||
])
|
||||
@@ -129,14 +129,15 @@ pipeline {
|
||||
expression { params.ENVIRONMENT == 'main' }
|
||||
}
|
||||
steps {
|
||||
sshagent(credentials: ['gitea-ssh']) {
|
||||
withCredentials([usernamePassword(credentialsId: 'gitea_acazares', usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD')]) {
|
||||
sh '''
|
||||
set -euo pipefail
|
||||
git -c user.name='Jenkins' -c user.email='jenkins@gitea.local' \
|
||||
tag -a "v${APP_VERSION}" -m "Release version ${APP_VERSION}"
|
||||
git remote set-url origin "https://${GIT_USERNAME}:${GIT_PASSWORD}@git.aduanasoft.com/ADUANASOFT/anexo76.git"
|
||||
git push origin "v${APP_VERSION}"
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user