@@ -41,8 +41,8 @@ pipeline {
41
41
script {
42
42
if (isReleaseBuild()) {
43
43
// checkout, reset and merge
44
- sh ' git checkout master '
45
- sh ' git reset --hard origin/master '
44
+ sh ' git checkout main '
45
+ sh ' git reset --hard origin/main '
46
46
sh " git merge --ff-only ${ env.BRANCH_NAME} "
47
47
}
48
48
}
@@ -81,7 +81,7 @@ pipeline {
81
81
}
82
82
}
83
83
84
- stage(' SonarQube' ) {
84
+ stage(' SonarQube' ) {
85
85
steps {
86
86
sh ' git config --replace-all "remote.origin.fetch" "+refs/heads/*:refs/remotes/origin/*"'
87
87
sh ' git fetch origin develop'
@@ -146,7 +146,7 @@ pipeline {
146
146
script {
147
147
def imageVersion = readFile ' scm-packaging/docker/build/docker.tag'
148
148
149
- build job : ' scm-manager/next-scm.cloudogu.com' , propagate : false , wait : false , parameters : [
149
+ build job : ' scm-manager/scm-manager/ next-scm.cloudogu.com/master ' , propagate : false , wait : false , parameters : [
150
150
string(name : ' imageTag' , value : imageVersion)
151
151
]
152
152
}
@@ -165,11 +165,11 @@ pipeline {
165
165
script {
166
166
// push changes back to remote repository
167
167
if (isReleaseBuild()) {
168
- authGit ' cesmarvin-github ' , ' push origin master --tags'
168
+ authGit ' cesmarvin' , ' push origin main --tags'
169
169
} else {
170
- authGit ' cesmarvin-github ' , " push origin ${ env.BRANCH_NAME} --tags"
170
+ authGit ' cesmarvin' , " push origin ${ env.BRANCH_NAME} --tags"
171
171
}
172
- authGit ' cesmarvin-github ' , ' push origin --tags'
172
+ authGit ' cesmarvin' , ' push origin --tags'
173
173
}
174
174
}
175
175
}
@@ -182,13 +182,13 @@ pipeline {
182
182
steps {
183
183
sh returnStatus : true , script : " git branch -D develop"
184
184
sh " git checkout develop"
185
- sh " git -c user.name='CES Marvin' -c user.email='cesmarvin@cloudogu.com' merge master "
185
+ sh " git -c user.name='CES Marvin' -c user.email='cesmarvin@cloudogu.com' merge main "
186
186
187
187
gradle " setVersionToNextSnapshot"
188
188
189
189
sh " git add gradle.properties '**.json'"
190
190
commit ' Prepare for next development iteration'
191
- authGit ' cesmarvin-github ' , ' push origin develop'
191
+ authGit ' cesmarvin' , ' push origin develop'
192
192
}
193
193
}
194
194
@@ -198,7 +198,22 @@ pipeline {
198
198
expression { return isBuildSuccess() }
199
199
}
200
200
steps {
201
- authGit ' cesmarvin-github' , " push origin :${ env.BRANCH_NAME} "
201
+ authGit ' cesmarvin' , " push origin :${ env.BRANCH_NAME} "
202
+ }
203
+ }
204
+
205
+ stage(' Push to GitHub' ) {
206
+ when {
207
+ anyOf {
208
+ branch pattern : ' develop' , comparator : ' GLOB'
209
+ branch pattern : ' main' , comparator : ' GLOB'
210
+ branch pattern : ' support/*' , comparator : ' GLOB'
211
+ }
212
+ expression { return isBuildSuccess() }
213
+ }
214
+ steps {
215
+ authGit ' cesmarvin' , " push https://github.com/scm-manager/scm-manager HEAD:${ env.BRANCH_NAME} "
216
+ authGit ' cesmarvin' , " push --tags https://github.com/scm-manager/scm-manager"
202
217
}
203
218
}
204
219
@@ -211,8 +226,8 @@ pipeline {
211
226
mail to : " scm-team@cloudogu.com" ,
212
227
subject : " Jenkins Job ${ JOB_NAME} - Merge Hotfix Release #${ env.BRANCH_NAME} !" ,
213
228
body : """ Please,
214
- - merge the hotfix release branch ${ env.BRANCH_NAME} into master (keep versions of master , merge changelog to keep both versions),
215
- - merge master into develop (the changelog should have no conflicts),
229
+ - merge the hotfix release branch ${ env.BRANCH_NAME} into main (keep versions of main , merge changelog to keep both versions),
230
+ - merge main into develop (the changelog should have no conflicts),
216
231
- if needed, increase version."""
217
232
}
218
233
}
@@ -268,33 +283,19 @@ boolean isBuildSuccess() {
268
283
}
269
284
270
285
void withCheckEnvironment (Closure<Void > closure ) {
271
- // surround call withChromaticEnvironment to enable chromatic analyzation
272
286
closure. call()
273
287
}
274
288
275
- void withChromaticEnvironment (Closure<Void > closure ) {
276
- // apply chromatic environment only if we are on a pr build or on the develop branch
277
- if (env. CHANGE_ID || env. BRANCH_NAME == ' develop' ) {
278
- withCredentials([
279
- usernamePassword(credentialsId : ' chromatic-scm-manager' , usernameVariable : ' CHROMATIC_USERANAME' , passwordVariable : ' CHROMATIC_PROJECT_TOKEN' ),
280
- ]) {
281
- closure. call()
282
- }
283
- } else {
284
- closure. call()
285
- }
286
- }
287
-
288
289
void withPublishEnivronment (Closure<Void > closure ) {
289
290
withCredentials([
290
- usernamePassword(credentialsId : ' maven. scm-manager. org' , usernameVariable : ' ORG_GRADLE_PROJECT_packagesScmManagerUsername' , passwordVariable : ' ORG_GRADLE_PROJECT_packagesScmManagerPassword' ),
291
- usernamePassword(credentialsId : ' cesmarvin-github ' , usernameVariable : ' ORG_GRADLE_PROJECT_gitHubUsername' , passwordVariable : ' ORG_GRADLE_PROJECT_gitHubApiToken' ),
292
- string(credentialsId : ' cesmarvin_npm_token ' , variable : ' ORG_GRADLE_PROJECT_npmToken' ),
293
- file(credentialsId : ' oss-gpg-secring ' , variable : ' GPG_KEY_RING' ),
294
- usernamePassword(credentialsId : ' oss-keyid-and-passphrase ' , usernameVariable : ' GPG_KEY_ID' , passwordVariable : ' GPG_KEY_PASSWORD' )
291
+ usernamePassword(credentialsId : ' packages- scm-manager- org' , usernameVariable : ' ORG_GRADLE_PROJECT_packagesScmManagerUsername' , passwordVariable : ' ORG_GRADLE_PROJECT_packagesScmManagerPassword' ),
292
+ usernamePassword(credentialsId : ' cesmarvin' , usernameVariable : ' ORG_GRADLE_PROJECT_gitHubUsername' , passwordVariable : ' ORG_GRADLE_PROJECT_gitHubApiToken' ),
293
+ string(credentialsId : ' npm-token-scm-manager ' , variable : ' ORG_GRADLE_PROJECT_npmToken' ),
294
+ file(credentialsId : ' gpg_packages-scm-manager-org ' , variable : ' GPG_KEY_RING' ),
295
+ usernamePassword(credentialsId : ' gpg_packages-scm-manager-org-credentials ' , usernameVariable : ' GPG_KEY_ID' , passwordVariable : ' GPG_KEY_PASSWORD' )
295
296
]) {
296
297
withEnv([" ORG_GRADLE_PROJECT_npmEmail=cesmarvin@cloudogu.com" ]) {
297
- docker. withRegistry(' ' , ' hub.docker.com- cesmarvin' ) {
298
+ docker. withRegistry(' ' , ' cesmarvin-dockerhub-access-token ' ) {
298
299
closure. call()
299
300
}
300
301
}
0 commit comments