Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure helm repos are up to date #64

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
Rade333 marked this conversation as resolved.
Show resolved Hide resolved

// 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
Loading