Skip to content
This repository was archived by the owner on Nov 23, 2021. It is now read-only.

Commit 69d52c7

Browse files
authored
Update Jenkinsfile
1 parent 346564c commit 69d52c7

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

Jenkinsfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,6 @@ pipeline {
8181
steps {
8282
container ('maven') {
8383
input(id: 'release-image-with-tag', message: 'release image with tag?')
84-
withCredentials([usernamePassword(credentialsId: "$GITHUB_CREDENTIAL_ID", passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
85-
sh 'git config --global user.email "49383207@qq.com" '
86-
sh 'git config --global user.name "caiwei" '
87-
sh 'git tag -a $TAG_NAME -m "$TAG_NAME" '
88-
sh 'git push http://$GIT_USERNAME:$GIT_PASSWORD@github.com/$GITHUB_ACCOUNT/devops-java-sample.git --tags --ipv4'
89-
}
9084
sh 'docker tag $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG_NAME '
9185
sh 'docker push $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG_NAME '
9286
}
@@ -100,7 +94,11 @@ pipeline {
10094
}
10195
steps {
10296
input(id: 'deploy-to-production', message: 'deploy to production?')
103-
kubernetesDeploy(configs: 'deploy/prod-ol/**', enableConfigSubstitution: true, kubeconfigId: "$KUBECONFIG_CREDENTIAL_ID")
97+
container('maven') {
98+
withCredentials([kubeconfigFile(credentialsId: env.KUBECONFIG_CREDENTIAL_ID, variable: 'KUBECONFIG')]) {
99+
sh 'kubectl apply -f deploy/prod-ol/**'
100+
}
101+
}
104102
}
105103
}
106104
}

0 commit comments

Comments
 (0)