-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-app
24 lines (23 loc) · 1.08 KB
/
Jenkinsfile-app
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
pipeline {
agent any
stages {
stage('Update GIT') {
steps {
script {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
withCredentials([usernamePassword(credentialsId: 'github', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh "git config user.name Jeremy Cook"
sh "git config user.email [email protected]"
sh "ls -la"
sh "echo DOCKERTAG: ${DOCKERTAG}"
sh "cd k8s && sed -i 's+\\(cloudacademydevops/stocks-app:\\).*+\\1${DOCKERTAG}+g' 3_stocks_app.yaml"
sh "git add ."
sh "git commit -m 'Done by Jenkins Job changemanifest: ${env.BUILD_NUMBER}'"
sh "git push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/cloudacademy/stocks-app-gitops.git HEAD:main"
}
}
}
}
}
}
}