diff --git a/cmd/ciReleaseDeploy.go b/cmd/ciReleaseDeploy.go index feb5181..1385a2c 100644 --- a/cmd/ciReleaseDeploy.go +++ b/cmd/ciReleaseDeploy.go @@ -100,9 +100,9 @@ var ciReleaseDeployCmd = &cobra.Command{ deploymentTimeoutSeconds := 900 deploymentTimeoutDuration, err := time.ParseDuration(deploymentTimeout) if err != nil { - log.Println("Invalid deployment timeout duration, using default 15m.") + log.Println("Invalid deployment timeout duration, using default 15m.") } else { - deploymentTimeoutSeconds = int(deploymentTimeoutDuration.Seconds()) + deploymentTimeoutSeconds = int(deploymentTimeoutDuration.Seconds()) } // Chart value overrides @@ -167,6 +167,10 @@ var ciReleaseDeployCmd = &cobra.Command{ command := fmt.Sprintf("helm repo add '%s' '%s'", "wunderio", chartRepository) exec.Command("bash", "-c", command).Run() + // Make sure repositories are up to date + command = "helm repo update" + exec.Command("bash", "-c", command).Run() + // Delete existing jobs to prevent getting wrong log output command = fmt.Sprintf("kubectl delete job '%s-post-release' --namespace '%s' --ignore-not-found", releaseName, namespace) exec.Command("bash", "-c", command).Run() diff --git a/cmd/ciReleaseValidate.go b/cmd/ciReleaseValidate.go index 8a734db..041efcd 100644 --- a/cmd/ciReleaseValidate.go +++ b/cmd/ciReleaseValidate.go @@ -109,6 +109,14 @@ var ciReleaseValidateCmd = &cobra.Command{ if chartName == "drupal" || strings.HasSuffix(chartName, "/drupal") { + // Add helm repositories + command := fmt.Sprintf("helm repo add '%s' '%s'", "wunderio", chartRepository) + exec.Command("bash", "-c", command).Run() + + // Make sure repositories are up to date + command = "helm repo update" + exec.Command("bash", "-c", command).Run() + _, errDir := os.Stat(common.ExtendedFolder + "/drupal") if os.IsNotExist(errDir) == false { chartName = common.ExtendedFolder + "/drupal" @@ -117,7 +125,7 @@ var ciReleaseValidateCmd = &cobra.Command{ fmt.Printf("Deploying %s helm release %s in %s namespace\n", chartName, releaseName, namespace) // TODO: rewrite the timeout handling and log printing after helm release - command := fmt.Sprintf(` + command = fmt.Sprintf(` set -Eeuo pipefail RELEASE_NAME='%s'