Commit 87fce3c6 authored by Andy Cobaugh's avatar Andy Cobaugh

add BuildOnly per-deployable config option to allow skipping of deployment for a given deployable

parent 572e4796
......@@ -180,6 +180,7 @@ func buildDockerAndDeploy(config config.Config) error {
color.Blue("Building Docker Containers")
for _, deployable := range config.Deployables {
fmt.Printf("=> %s\n", deployable.Name)
var image string
var tag string
var err error
......@@ -196,12 +197,22 @@ func buildDockerAndDeploy(config config.Config) error {
if tag == "" {
tag = "latest"
}
color.New(color.FgGreen).Printf(".image is set, using existing image: %s\n", image+":"+tag)
} else {
color.New(color.FgYellow).Printf("Deployable: %s has no Dockerfile, continuing in chart-only mode\n", deployable.Name)
color.New(color.FgGreen).Print(".dockerfile is not set, continuing in chart-only mode\n")
chartOnlyMode = true
}
color.Blue("Installing Chart")
if deployable.BuildOnly {
if deployable.Dockerfile == "" {
color.New(color.FgYellow).Print("WARNING: .buildOnly is set but .dockerfile is empty. Nothing to do for this deployable.\n")
} else {
color.New(color.FgGreen).Print(".buildOnly is set, skipping deployment\n")
}
continue
}
color.Blue("Installing Chart\n")
releaseName := deployable.Name + "-local"
args := []string{"upgrade", releaseName, "--install", deployable.Chart, "--version", deployable.ChartVersion}
......@@ -247,6 +258,8 @@ func buildDockerAndDeploy(config config.Config) error {
}
return err
}
fmt.Println()
}
if viper.GetBool("build.openServices") {
......
......@@ -41,9 +41,11 @@ var listCmd = &cobra.Command{
for _, d := range conf.Deployables {
fmt.Printf("* %s\n", d.Name)
fmt.Printf(" Dockerfile: %s\n", d.Dockerfile)
fmt.Printf(" BuildOnly: %t\n", d.BuildOnly)
fmt.Printf(" Chart: %s\n", d.Chart)
fmt.Printf(" ChartVersion: %s\n", d.ChartVersion)
fmt.Printf(" LocalConfig: %s\n", d.LocalConfig)
fmt.Printf(" EnvVars: %s\n", d.EnvVars)
}
fmt.Println("Local Environment Variables:")
......
......@@ -26,6 +26,7 @@ type (
LocalConfig string `json:"localConfig"`
EnvVars map[string]string `json:"envVars"`
LocalOnly bool `json:"localOnly"`
BuildOnly bool `json:"buildOnly"`
}
HelmValues struct {
EnvironmentVariables map[string]string `yaml:"environmentVariables"`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment