Commit 15ba3ae1 authored by Christopher Harm's avatar Christopher Harm

Adding support for localOnly deployments

parent a943b465
Pipeline #63771 failed with stages
in 1 minute and 17 seconds
......@@ -175,10 +175,11 @@ func buildDockerAndDeploy(config config.Config) error {
var image string
var tag string
var err error
chartOnlyMode := false
if deployable.Dockerfile != "" {
image, tag, err = buildDockerImage(deployable)
if err != nil {
color.New(color.FgRed).Printf("Failed to build docker image: %s", err.Error())
color.New(color.FgRed).Printf("Failed to build docker image: %s\n", err.Error())
return err
}
} else if deployable.Image != "" {
......@@ -188,8 +189,8 @@ func buildDockerAndDeploy(config config.Config) error {
tag = "latest"
}
} else {
color.New(color.FgYellow).Printf("Deployable: %s does not have a valid Docker configuration", deployable.Name)
continue
color.New(color.FgYellow).Printf("Deployable: %s has no Dockerfile, continuing in chart-only mode\n", deployable.Name)
chartOnlyMode = true
}
color.Blue("Installing Chart")
......@@ -216,8 +217,12 @@ func buildDockerAndDeploy(config config.Config) error {
args = append(args, "--set", "environmentVariables.MOCK_WEBACCESS_USER"+"="+mockWebAccessUser)
}
args = append(args, "--set", "image.repository="+image)
args = append(args, "--set", "image.tag="+tag)
if !chartOnlyMode {
args = append(args, "--set", "image.repository="+image)
args = append(args, "--set", "image.tag="+tag)
args = append(args, "--set", "image.pullPolicy=IfNotPresent")
}
args = append(args, "-f", deployable.LocalConfig)
err = environment.Run(true, "helm", args...)
......
......@@ -91,6 +91,11 @@ func buildCiDocker(config config.Config) error {
dockerfile := deployable.Dockerfile
image := deployable.Name
if deployable.LocalOnly {
color.New(color.FgYellow).Printf("Deployable %s is set to LocalOnly, nothing to deploy.", deployable.Name)
continue
}
if dockerfile == "" {
color.New(color.FgYellow).Printf("Deployable %s has no Dockerfile, nothing to build.", deployable.Name)
continue
......
......@@ -59,6 +59,11 @@ func fluxDeployCi(config config.Config) error {
for _, deployable := range config.Deployables {
image := deployable.Name
if deployable.LocalOnly {
color.New(color.FgYellow).Printf("Deployable %s is set to LocalOnly, nothing to deploy.", deployable.Name)
continue
}
if deployable.Dockerfile == "" {
color.New(color.FgYellow).Printf("Deployable %s has no Dockerfile, nothing to deploy.", deployable.Name)
continue
......
......@@ -23,6 +23,7 @@ type (
Chart string `json:"chart"`
ChartVersion string `json:"chartVersion"`
LocalConfig string `json:"localConfig"`
LocalOnly bool `json:"localOnly"`
}
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