Updated Jenkinsfile for Docker + Kubernetes
This commit is contained in:
parent
d08eeea7ae
commit
a06fc69fce
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
@ -4,7 +4,7 @@ pipeline {
|
||||
environment {
|
||||
DOCKERHUB_USER = 'vipin2025devops'
|
||||
IMAGE_NAME = 'myapp'
|
||||
IMAGE_TAG = "latest"
|
||||
IMAGE_TAG = 'latest'
|
||||
K8S_DEPLOYMENT = 'k8s/deployment.yaml'
|
||||
K8S_SERVICE = 'k8s/service.yaml'
|
||||
}
|
||||
@ -26,7 +26,10 @@ pipeline {
|
||||
|
||||
stage('Push Image to Docker Hub') {
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'docker-hub-credentials', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) {
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: 'dockerhub-creds',
|
||||
usernameVariable: 'DOCKER_USER',
|
||||
passwordVariable: 'DOCKER_PASS')]) {
|
||||
powershell """
|
||||
echo $env:DOCKER_PASS | docker login -u $env:DOCKER_USER --password-stdin
|
||||
docker push ${DOCKERHUB_USER}/${IMAGE_NAME}:${IMAGE_TAG}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user