Last active
February 16, 2025 17:33
-
-
Save eeganlf/85c9479772d90a165d08a32017a295c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
def app | |
stage('Clone repository') { | |
checkout scm | |
} | |
stage('Update GIT') { | |
script { | |
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { | |
withCredentials([usernamePassword(credentialsId: 'JenkinsGithubCreds', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { | |
sh "git config user.email [email protected]" | |
sh "git config user.name yourGitHubUsername" | |
sh "cat vote-ui-deployment.yaml" | |
sh "sed -i 's+dockerHubUserName/vote.*+dockerHubUsername/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" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment