@@ -7,11 +7,24 @@ def buildDate = new Date().format("yyMMdd", TimeZone.getTimeZone('UTC'))
77cron_string = ""
88
99// Build nightly on a release branch
10+ if (BRANCH_NAME ==~ /^([0-9][0-9][0-9]\.x)$/) {
11+ cron_string = "H 10 * * *"
12+ }
13+
14+ isReleaseDay = new Date().format("E", TimeZone.getTimeZone('UTC')) == "Wed"
15+
16+ def started_by_timer = currentBuild.getBuildCauses()[0]["shortDescription"].matches("Started by timer")
17+ echo "Started by timer: ${started_by_timer}"
1018
11- if (BRANCH_NAME ==~ /^([0-9][0-9][0-9].x)$/) {
12- cron_string = "H 1 * * *"
19+
20+ if (isReleaseDay && started_by_timer) {
21+ releaseChannel = "default"
22+ } else {
23+ releaseChannel = "dev"
1324}
1425
26+ echo "Release channel $releaseChannel"
27+
1528def buildPodDefinition(workerPodImage, ciUtilsEnabled, kanikoEnabled) {
1629 // language=yaml
1730 yaml = """
@@ -318,16 +331,22 @@ pipeline {
318331 }
319332 }
320333 steps {
321- withCredentials([sshUserPrivateKey(credentialsId: 'ci-ssh-key', keyFileVariable: 'KEYFILE')]) {
322- unstash 'systemd-build-build'
323- unstash 'ubuntu-units'
334+ withCredentials(
335+ [
336+ sshUserPrivateKey(credentialsId: 'ci-ssh-key', keyFileVariable: 'KEYFILE'),
337+ string(credentialsId: 'systemd-publish-token', variable: 'PUBLISH_TOKEN')
338+ ]
339+ ) {
340+ withEnv(["RELEASE_CHANNEL=${releaseChannel}"]) {
341+ unstash 'systemd-build-build'
342+ unstash 'ubuntu-units'
324343 sh("""
325344 mkdir -p ./build
326345 ./generate-changelog > build/CHANGELOG
327346 ./gradlew --no-daemon -I ./build-cache-init.gradle.kts --build-cache build buildPlugin --scan
328347 """)
329348 script {
330- if (env.BRANCH_NAME ==~ /^([0-9][0-9][0-9].x)$/) {
349+ if (env.BRANCH_NAME ==~ /^([0-9][0-9][0-9]\ .x)$/) {
331350 sh("""
332351 echo "Tagging"
333352 mkdir -p ~/.ssh/
@@ -346,14 +365,21 @@ pipeline {
346365 git push origin-ssh --tags
347366"""
348367 )
349- } else {
350368 sh("""
351- echo "No tagging"
352- """) }
369+ ./gradlew --no-daemon -I ./build-cache-init.gradle.kts --build-cache publishPluginStandalone --scan
370+ """)
371+ }
372+ else {
373+ sh("""
374+ echo "No tagging"
375+ """)
353376 }
354377
355- archiveArtifacts artifacts: 'build/distributions/*.zip'
356- archiveArtifacts artifacts: 'build/reports/**'
378+ }
379+
380+ archiveArtifacts artifacts: 'build/distributions/*.zip'
381+ archiveArtifacts artifacts: 'build/reports/**'
382+ }
357383 }
358384 }
359385 }
0 commit comments