@@ -57,39 +57,26 @@ pipeline {
57
57
}
58
58
}
59
59
}
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
- }
68
60
stage(' deploy to dev' ) {
69
61
when{
70
62
branch ' master'
71
63
}
72
64
steps {
65
+ input(id : ' deploy-to-dev' , message : ' deploy to dev?' )
73
66
kubernetesDeploy(configs : ' deploy/dev/**' , enableConfigSubstitution : true , kubeconfigId : ' kubeconfig' )
74
67
}
75
68
}
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
- }
84
69
stage(' push image with tag' ){
85
70
when{
86
71
tag ' v*'
87
72
}
88
73
steps {
89
74
container(' nodejs' ){
75
+ input(id : ' release-image-with-tag' , message : ' release image with tag?' )
90
76
withCredentials([usernamePassword(credentialsId : ' git' , passwordVariable : ' GIT_PASSWORD' , usernameVariable : ' GIT_USERNAME' )]) {
91
77
sh(
' git config --global user.email "[email protected] " ' )
92
78
sh(' git config --global user.name "runzexia" ' )
79
+ sh(
' git remote add origin https://$GIT_USERNAME:[email protected] /$ORG/$APP_NAME.git' )
93
80
sh(' git tag -a $TAG_NAME -m "$TAG_NAME" ' )
94
81
sh(' git push origin --tags' )
95
82
}
@@ -98,19 +85,12 @@ pipeline {
98
85
}
99
86
}
100
87
}
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
- }
109
88
stage(' deploy to production' ) {
110
89
when{
111
90
tag ' v*'
112
91
}
113
92
steps {
93
+ input(id : ' deploy-to-production' , message : ' deploy to production?' )
114
94
kubernetesDeploy(configs : ' deploy/production/**' , enableConfigSubstitution : true , kubeconfigId : ' kubeconfig' )
115
95
}
116
96
}
0 commit comments