@@ -388,6 +388,8 @@ config = {
388388 "production" : {
389389 # NOTE: need to be updated if new production releases are determined
390390 "tags" : ["2.0" , "4.0" ],
391+ # NOTE: need to be set to true if patch releases are made from stable-X-branches
392+ "skip_rolling" : "false" ,
391393 "repo" : docker_repo_slug ,
392394 "build_type" : "production" ,
393395 },
@@ -1608,31 +1610,39 @@ def uploadTracingResult(ctx):
16081610
16091611def dockerReleases (ctx ):
16101612 pipelines = []
1611- docker_repos = []
1613+ docker_releases = []
16121614 build_type = ""
16131615
1616+ # only make realeases on tag events
16141617 if ctx .build .event == "tag" :
16151618 tag = ctx .build .ref .replace ("refs/tags/v" , "" ).lower ()
16161619
1620+ # iterate over production tags to see if this is a production release
16171621 is_production = False
1622+ skip_rolling = False
16181623 for prod_tag in config ["dockerReleases" ]["production" ]["tags" ]:
16191624 if tag .startswith (prod_tag ):
16201625 is_production = True
1626+ skip_rolling = config ["dockerReleases" ]["production" ]["skip_rolling" ]
16211627 break
16221628
16231629 if is_production :
1624- docker_repos .append (config ["dockerReleases" ]["production" ]["repo" ])
1625- build_type = config ["dockerReleases" ]["production" ]["build_type" ]
1630+ docker_releases .append ("production" )
1631+ # a new production realease is also a rolling release
1632+ # unless skip_rolling is set in the config, i.e. for patch-releases on stable-branch
1633+ if not skip_rolling :
1634+ docker_releases .append ("rolling" )
16261635
16271636 else :
1628- docker_repos .append (config ["dockerReleases" ]["rolling" ]["repo" ])
1629- build_type = config ["dockerReleases" ]["rolling" ]["build_type" ]
1637+ docker_releases .append ("rolling" )
16301638
1639+ # on non tag events, do daily build
16311640 else :
1632- docker_repos .append (config ["dockerReleases" ]["daily" ]["repo" ])
1633- build_type = config ["dockerReleases" ]["daily" ]["build_type" ]
1641+ docker_releases .append ("daily" )
16341642
1635- for repo in docker_repos :
1643+ for releaseConfigName in docker_releases :
1644+ repo = config ["dockerReleases" ][releaseConfigName ]["repo" ]
1645+ build_type = config ["dockerReleases" ][releaseConfigName ]["build_type" ]
16361646 repo_pipelines = []
16371647 repo_pipelines .append (dockerRelease (ctx , repo , build_type ))
16381648
0 commit comments