Skip to content

Commit 531f6f5

Browse files
authored
Merge pull request #64 from wunderio/feature/chart-name
Make sure helm repos are up to date
2 parents 4fe3dad + f2da5b1 commit 531f6f5

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

cmd/ciReleaseDeploy.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ var ciReleaseDeployCmd = &cobra.Command{
100100
deploymentTimeoutSeconds := 900
101101
deploymentTimeoutDuration, err := time.ParseDuration(deploymentTimeout)
102102
if err != nil {
103-
log.Println("Invalid deployment timeout duration, using default 15m.")
103+
log.Println("Invalid deployment timeout duration, using default 15m.")
104104
} else {
105-
deploymentTimeoutSeconds = int(deploymentTimeoutDuration.Seconds())
105+
deploymentTimeoutSeconds = int(deploymentTimeoutDuration.Seconds())
106106
}
107107

108108
// Chart value overrides
@@ -167,6 +167,10 @@ var ciReleaseDeployCmd = &cobra.Command{
167167
command := fmt.Sprintf("helm repo add '%s' '%s'", "wunderio", chartRepository)
168168
exec.Command("bash", "-c", command).Run()
169169

170+
// Make sure repositories are up to date
171+
command = "helm repo update"
172+
exec.Command("bash", "-c", command).Run()
173+
170174
// Delete existing jobs to prevent getting wrong log output
171175
command = fmt.Sprintf("kubectl delete job '%s-post-release' --namespace '%s' --ignore-not-found", releaseName, namespace)
172176
exec.Command("bash", "-c", command).Run()

cmd/ciReleaseValidate.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ var ciReleaseValidateCmd = &cobra.Command{
109109

110110
if chartName == "drupal" || strings.HasSuffix(chartName, "/drupal") {
111111

112+
// Add helm repositories
113+
command := fmt.Sprintf("helm repo add '%s' '%s'", "wunderio", chartRepository)
114+
exec.Command("bash", "-c", command).Run()
115+
116+
// Make sure repositories are up to date
117+
command = "helm repo update"
118+
exec.Command("bash", "-c", command).Run()
119+
112120
_, errDir := os.Stat(common.ExtendedFolder + "/drupal")
113121
if os.IsNotExist(errDir) == false {
114122
chartName = common.ExtendedFolder + "/drupal"
@@ -117,7 +125,7 @@ var ciReleaseValidateCmd = &cobra.Command{
117125
fmt.Printf("Deploying %s helm release %s in %s namespace\n", chartName, releaseName, namespace)
118126

119127
// TODO: rewrite the timeout handling and log printing after helm release
120-
command := fmt.Sprintf(`
128+
command = fmt.Sprintf(`
121129
set -Eeuo pipefail
122130
123131
RELEASE_NAME='%s'

0 commit comments

Comments
 (0)