-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pradyot Ranjan <[email protected]>
- Loading branch information
Showing
1 changed file
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ pipeline { | |
} | ||
} | ||
} | ||
|
||
stage("Push Image") { | ||
steps { | ||
// Authenticate with Docker Hub | ||
|
@@ -40,5 +39,25 @@ pipeline { | |
} | ||
} | ||
} | ||
|
||
stage('Update Deployment File') { | ||
environment { | ||
GIT_REPO_NAME = "CI-CD-pipeline-manifests" | ||
GIT_USER_NAME = "prady0t" | ||
} | ||
steps { | ||
withCredentials([string(credentialsId: 'Github', variable: 'GITHUB_TOKEN')]) { | ||
sh ''' | ||
git config user.email "[email protected]" | ||
git config user.name "prady0t" | ||
BUILD_NUMBER=${BUILD_NUMBER} | ||
sed -i "s/toBeReplaced/${BUILD_NUMBER}/g" mainfest/deployment.yaml | ||
git add . | ||
git commit -m "Update deployment image to version ${BUILD_NUMBER}" | ||
git push https://${GITHUB_TOKEN}@github.com/${GIT_USER_NAME}/${GIT_REPO_NAME} HEAD:master | ||
''' | ||
} | ||
} | ||
} | ||
} | ||
} |