Skip to content

Commit e99dc55

Browse files
committed
update jenkinsfile
1 parent 500aa62 commit e99dc55

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

Jenkinsfile

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -57,39 +57,26 @@ pipeline {
5757
}
5858
}
5959
}
60-
stage('deploy to dev?') {
61-
when{
62-
branch 'master'
63-
}
64-
steps {
65-
input(id: 'deploy-to-dev', message: 'deploy to dev?')
66-
}
67-
}
6860
stage('deploy to dev') {
6961
when{
7062
branch 'master'
7163
}
7264
steps {
65+
input(id: 'deploy-to-dev', message: 'deploy to dev?')
7366
kubernetesDeploy(configs: 'deploy/dev/**', enableConfigSubstitution: true, kubeconfigId: 'kubeconfig')
7467
}
7568
}
76-
stage('release image with tag?'){
77-
when{
78-
tag 'v*'
79-
}
80-
steps {
81-
input(id: 'release-image-with-tag', message: 'release image with tag?')
82-
}
83-
}
8469
stage('push image with tag'){
8570
when{
8671
tag 'v*'
8772
}
8873
steps {
8974
container('nodejs'){
75+
input(id: 'release-image-with-tag', message: 'release image with tag?')
9076
withCredentials([usernamePassword(credentialsId: 'git', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
9177
sh('git config --global user.email "[email protected]" ')
9278
sh('git config --global user.name "runzexia" ' )
79+
sh('git remote add origin https://$GIT_USERNAME:[email protected]/$ORG/$APP_NAME.git')
9380
sh('git tag -a $TAG_NAME -m "$TAG_NAME" ')
9481
sh('git push origin --tags')
9582
}
@@ -98,19 +85,12 @@ pipeline {
9885
}
9986
}
10087
}
101-
stage('deploy to production?') {
102-
when{
103-
tag 'v*'
104-
}
105-
steps {
106-
input(id: 'deploy-to-production', message: 'deploy to production?')
107-
}
108-
}
10988
stage('deploy to production') {
11089
when{
11190
tag 'v*'
11291
}
11392
steps {
93+
input(id: 'deploy-to-production', message: 'deploy to production?')
11494
kubernetesDeploy(configs: 'deploy/production/**', enableConfigSubstitution: true, kubeconfigId: 'kubeconfig')
11595
}
11696
}

0 commit comments

Comments
 (0)