Commit f5287ade authored by SWE CI's avatar SWE CI

Merge branch 'release/v0.2.2'

parents 02b17e00 e44ad296
Pipeline #30340 passed with stage
in 20 seconds
......@@ -53,4 +53,6 @@ build:
skipCompile: false
runTests: true
openServices: true
webaccess:
user: crh5255
```
......@@ -22,6 +22,7 @@ import (
"git.psu.edu/k8s/devtool/environment"
"github.com/fatih/color"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var dockerRegistry string
......@@ -56,16 +57,23 @@ func init() {
// is called directly, e.g.:
// buildCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
ciBuildCmd.Flags().StringVarP(&dockerRegistry, "registry", "r", "", "url of the docker registry")
ciBuildCmd.Flags().StringVarP(&dockerRegistryNamespace, "registry-namespace", "n", "", "namespace in the docker registry")
err := ciBuildCmd.MarkFlagRequired("registry")
if err != nil {
panic("invalid arg")
}
ciBuildCmd.Flags().StringVarP(&dockerRegistryNamespace, "registry-namespace", "n", "", "namespace in the docker registry")
err = ciBuildCmd.MarkFlagRequired("registry-namespace")
if err != nil {
panic("invalid arg")
}
ciBuildCmd.Flags().Bool("tag-latest", false, "tag the docker image with :latest")
viper.SetDefault("tag.latest", false)
err = viper.BindPFlag("tag.latest", ciBuildCmd.Flags().Lookup("tag-latest"))
if err != nil {
panic("invalid arg")
}
}
func buildCiDocker(config config.Config) error {
......@@ -90,6 +98,14 @@ func buildCiDocker(config config.Config) error {
return err
}
if viper.GetBool("tag.latest") {
color.New(color.FgGreen).Printf("Tagging %s:latest\n", dockerImage)
err := environment.Run(true, "docker", "tag", dockerTag, dockerImage+":latest")
if err != nil {
return err
}
}
color.New(color.FgGreen).Printf("Pushing Docker image: %s\n", dockerTag)
err = environment.Run(true, "docker", "push", dockerImage)
if err != nil {
......
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