-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
26 lines (22 loc) · 1 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
node {
def app
stage('Clone repository') {
checkout scm
}
stage('Update GIT') {
script {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
withCredentials([usernamePassword(credentialsId: 'github-auth-token', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh "git config user.email afslatton@email.com"
sh "git config user.name afslatton"
sh "cat vote-ui-deployment.yaml"
sh "sed -i 's+afslatton/vote.*+afslatton/vote:${DOCKERTAG}+g' vote-ui-deployment.yaml"
sh "cat vote-ui-deployment.yaml"
sh "git add ."
sh "git commit -m 'Done by Jenkins Job deployment: ${env.BUILD_NUMBER}'"
sh "git push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/${GIT_USERNAME}/vote-deploy.git HEAD:master"
}
}
}
}
}