Feat cronjob #23
@@ -61,9 +61,9 @@ func main() {
|
||||
"- if it's not defined, so the 0.0.1 version is used",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
force := c.Flag("force").Changed
|
||||
composeFile := c.Flags().StringArrayP("compose-file", "c", []string{}, "compose file to convert, can be use several times to override previous file (default: docker-compose.yml)")
|
||||
// TODO: is there a way to get typed values from cobra?
|
||||
appversion := c.Flag("app-version").Value.String()
|
||||
composeFile := c.Flag("compose-file").Value.String()
|
||||
appName := c.Flag("app-name").Value.String()
|
||||
chartVersion := c.Flag("chart-version").Value.String()
|
||||
chartDir := c.Flag("output-dir").Value.String()
|
||||
@@ -71,7 +71,7 @@ func main() {
|
||||
if err != nil {
|
||||
writers.IndentSize = indentation
|
||||
}
|
||||
Convert(composeFile, appversion, appName, chartDir, chartVersion, force)
|
||||
Convert(*composeFile, appversion, appName, chartDir, chartVersion, force)
|
||||
},
|
||||
}
|
||||
convertCmd.Flags().BoolP(
|
||||
|
@@ -93,15 +93,14 @@ func detectGitVersion() (string, error) {
|
||||
return defaulVersion, errors.New("git log failed")
|
||||
}
|
||||
|
||||
func Convert(composeFile, appVersion, appName, chartDir, chartVersion string, force bool) {
|
||||
func Convert(composeFile []string, appVersion, appName, chartDir, chartVersion string, force bool) {
|
||||
if len(composeFile) == 0 {
|
||||
fmt.Println("No compose file given")
|
||||
return
|
||||
}
|
||||
|
||||
composeFiles := strings.Split(composeFile, ",")
|
||||
for i, c := range composeFiles {
|
||||
composeFiles[i] = strings.TrimSpace(c)
|
||||
for i, c := range composeFile {
|
||||
composeFile[i] = strings.TrimSpace(c)
|
||||
}
|
||||
|
||||
for _, composeFile := range composeFiles {
|
||||
|
@@ -127,7 +127,7 @@ func setUp(t *testing.T) (string, *compose.Parser) {
|
||||
}
|
||||
|
||||
composefile := filepath.Join(tmpwork, "docker-compose.yaml")
|
||||
p := compose.NewParser(composefile, DOCKER_COMPOSE_YML)
|
||||
p := compose.NewParser([]string{composefile}, DOCKER_COMPOSE_YML)
|
||||
|
||||
// create envfile for "useenvfile" service
|
||||
err = os.Mkdir(filepath.Join(tmpwork, "config"), 0777)
|
||||
|
Reference in New Issue
Block a user