Browse Source

set job to paused on upgrades'

Alexander Belanger 4 years ago
parent
commit
ff75f7bb95
2 changed files with 6 additions and 1 deletions
  1. 1 1
      cli/cmd/deploy.go
  2. 5 0
      cli/cmd/deploy/deploy.go

+ 1 - 1
cli/cmd/deploy.go

@@ -417,7 +417,7 @@ func updatePushWithAgent(updateAgent *deploy.DeployAgent) error {
 
 
 func updateUpgradeWithAgent(updateAgent *deploy.DeployAgent) error {
 func updateUpgradeWithAgent(updateAgent *deploy.DeployAgent) error {
 	// push the deployment
 	// push the deployment
-	color.New(color.FgGreen).Println("Calling webhook for", app)
+	color.New(color.FgGreen).Println("Upgrading configuration for", app)
 
 
 	// read the values if necessary
 	// read the values if necessary
 	valuesObj, err := readValuesFile()
 	valuesObj, err := readValuesFile()

+ 5 - 0
cli/cmd/deploy/deploy.go

@@ -279,6 +279,11 @@ func (d *DeployAgent) UpdateImageAndValues(overrideValues map[string]interface{}
 	// overwrite the tag based on a new image
 	// overwrite the tag based on a new image
 	currImageSection := mergedValues["image"].(map[string]interface{})
 	currImageSection := mergedValues["image"].(map[string]interface{})
 
 
+	// if this is a job chart, set "paused" to false so that the job doesn't run
+	if d.release.Chart.Name() == "job" {
+		mergedValues["paused"] = true
+	}
+
 	// if the current image section is hello-porter, the image must be overriden
 	// if the current image section is hello-porter, the image must be overriden
 	if currImageSection["repository"] == "public.ecr.aws/o1j4x7p4/hello-porter" ||
 	if currImageSection["repository"] == "public.ecr.aws/o1j4x7p4/hello-porter" ||
 		currImageSection["repository"] == "public.ecr.aws/o1j4x7p4/hello-porter-job" {
 		currImageSection["repository"] == "public.ecr.aws/o1j4x7p4/hello-porter-job" {