Skip to content

Commit

Permalink
userservice-demo CICD 파이프라인 완성
Browse files Browse the repository at this point in the history
Jenkins CI + Argo CD
  • Loading branch information
SeonBo committed Feb 16, 2022
1 parent a325b15 commit 3e6137e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion cicd/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pipeline {
GIT_REPO_BRANCH_NAME='main'
DOCKER_REGISTRY_PRIVATE='vcixoe45.private-ncr.gov-ntruss.com'
DOCKER_REGISTRY='alertnow-image-repo.ncr.gov-ntruss.com'
IMAGE_NAME='userservice-backend-demo'
IMAGE_NAME='userservice-demo'
}
options {
timestamps()
Expand Down Expand Up @@ -58,6 +58,26 @@ pipeline {
}
}

stage('argo-deploy') {
agent {
docker {
image 'quay.io/argoproj/kubectl-argo-rollouts:master'
args "--entrypoint=''"
}
}
steps {
sh 'ls -Al'
withCredentials([file(credentialsId: 'kubeconfig', variable: 'kubeconfig')]) {
sh 'kubectl-argo-rollouts version'
sh 'kubectl-argo-rollouts get rollout ${IMAGE_NAME} --kubeconfig ${kubeconfig}'
sh 'kubectl-argo-rollouts set image ${IMAGE_NAME} ${IMAGE_NAME}=${DOCKER_REGISTRY_PRIVATE}/${IMAGE_NAME}:${BUILD_NUMBER} --kubeconfig ${kubeconfig}'
sh 'sleep 10; echo "Changed BUILD_NUMBER ......... [${BUILD_NUMBER}]"'
sh 'kubectl-argo-rollouts promote ${IMAGE_NAME} --kubeconfig ${kubeconfig}'
sh 'sleep 10; echo "Promote service routing"'
sh 'kubectl-argo-rollouts get rollout ${IMAGE_NAME} --kubeconfig ${kubeconfig}'
}
}
}
}

post {
Expand Down

0 comments on commit 3e6137e

Please sign in to comment.