Skip to content

Commit

Permalink
Make sure helm repos are up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
Rade333 committed Aug 6, 2024
1 parent 4fe3dad commit f2da5b1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cmd/ciReleaseDeploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
10 changes: 9 additions & 1 deletion cmd/ciReleaseValidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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'
Expand Down

0 comments on commit f2da5b1

Please # to comment.