File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- v1.6 .0
2- Add new deploy-apps command
1+ v1.7 .0
2+ Support configurable deployment branches
33
44Previously:
5+ - Add new deploy-apps command
56- Temporarily disable Go version checks
67- Push Docker images to one ECR region
7- - add option to pass branch name and dryRun to catalog-sync
Original file line number Diff line number Diff line change @@ -307,10 +307,26 @@ func deployApps(appIds []string) error {
307307 }
308308 ctx := context .Background ()
309309
310- if environment . Branch () == "master" {
310+ if shouldDeploy () {
311311 if err := slingshot .New ().DeployApps (ctx , appIds ); err != nil {
312312 return err
313313 }
314314 }
315315 return validateRun ()
316316}
317+
318+ func shouldDeploy () bool {
319+ allowedBranches := os .Getenv ("DEPLOY_BRANCHES" )
320+ if allowedBranches == "" {
321+ allowedBranches = "master"
322+ }
323+
324+ currentBranch := environment .Branch ()
325+ branches := strings .Split (allowedBranches , "," )
326+ for _ , branch := range branches {
327+ if strings .TrimSpace (branch ) == currentBranch {
328+ return true
329+ }
330+ }
331+ return false
332+ }
You can’t perform that action at this time.
0 commit comments