Skip to content

Commit

Permalink
Add monthly rebuild cron for docker re-release (#4354)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Jan 19, 2024
1 parent 5f47981 commit dce7d97
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions jenkins/docker/docker-re-release.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ pipeline {
timeout(time: 2, unit: 'HOURS')
}
agent none
triggers {
parameterizedCron '''
H 19 15 * * %PRODUCT=opensearch;TAG=1
H 19 15 * * %PRODUCT=opensearch-dashboards;TAG=1
H 19 15 * * %PRODUCT=opensearch;TAG=2
H 19 15 * * %PRODUCT=opensearch-dashboards;TAG=2
'''
}
parameters {
choice(
name: 'PRODUCT',
Expand Down
2 changes: 2 additions & 0 deletions tests/jenkins/TestDockerReRelease.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class TestDockerReRelease extends BuildPipelineTest {
.retriever(gitSource('https://github.com/opensearch-project/opensearch-build-libraries.git'))
.build()
)
helper.registerAllowedMethod('parameterizedCron', [String], null)
super.setUp()

// Variables
Expand Down Expand Up @@ -69,6 +70,7 @@ class TestDockerReRelease extends BuildPipelineTest {
assertThat(getCommandExecutions('build', ''), hasItem('{job=docker-build, propagate=true, wait=true, parameters=[null, null, null]}'))
assertThat(getCommandExecutions('build', ''), hasItem('{job=docker-scan, propagate=true, wait=true, parameters=[null]}'))
assertThat(getCommandExecutions('build', ''), hasItem('{job=docker-promotion, propagate=true, wait=true, parameters=[null, null, null]}'))
assertThat(getCommandExecutions('parameterizedCron', ''), hasItem('\n H 19 15 * * %PRODUCT=opensearch;TAG=1\n H 19 15 * * %PRODUCT=opensearch-dashboards;TAG=1\n H 19 15 * * %PRODUCT=opensearch;TAG=2\n H 19 15 * * %PRODUCT=opensearch-dashboards;TAG=2\n '))

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
docker-re-release.pipeline(groovy.lang.Closure)
docker-re-release.timeout({time=2, unit=HOURS})
docker-re-release.echo(Executing on agent [label:none])
docker-re-release.parameterizedCron(
H 19 15 * * %PRODUCT=opensearch;TAG=1
H 19 15 * * %PRODUCT=opensearch-dashboards;TAG=1
H 19 15 * * %PRODUCT=opensearch;TAG=2
H 19 15 * * %PRODUCT=opensearch-dashboards;TAG=2
)
docker-re-release.stage(Patch Docker Image, groovy.lang.Closure)
docker-re-release.script(groovy.lang.Closure)
docker-re-release.patchDockerImage({product=opensearch, tag=1})
Expand Down

0 comments on commit dce7d97

Please sign in to comment.