added support for multiple-compose files

This commit is contained in:
Abhishek
2017-01-03 17:18:34 +05:30
parent 9c3fdaa48d
commit a5a3805760
18 changed files with 739 additions and 34 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ var convertCmd = &cobra.Command{
CreateChart: ConvertChart,
GenerateYaml: ConvertYaml,
Replicas: ConvertReplicas,
InputFile: GlobalFile,
InputFiles: GlobalFiles,
OutFile: ConvertOut,
Provider: strings.ToLower(GlobalProvider),
CreateD: ConvertDeployment,
+4 -4
View File
@@ -38,10 +38,10 @@ var downCmd = &cobra.Command{
// Create the Convert options.
DownOpt = kobject.ConvertOptions{
Replicas: DownReplicas,
InputFile: GlobalFile,
Provider: strings.ToLower(GlobalProvider),
EmptyVols: DownEmptyVols,
Replicas: DownReplicas,
InputFiles: GlobalFiles,
Provider: strings.ToLower(GlobalProvider),
EmptyVols: DownEmptyVols,
}
},
Run: func(cmd *cobra.Command, args []string) {
+3 -2
View File
@@ -40,8 +40,9 @@ func (errorOnWarningHook) Fire(entry *logrus.Entry) error {
}
var (
GlobalBundle, GlobalFile, GlobalProvider string
GlobalBundle, GlobalProvider string
GlobalVerbose, GlobalSuppressWarnings, GlobalErrorOnWarning bool
GlobalFiles []string
)
var RootCmd = &cobra.Command{
@@ -86,7 +87,7 @@ func init() {
RootCmd.PersistentFlags().BoolVarP(&GlobalVerbose, "verbose", "v", false, "verbose output")
RootCmd.PersistentFlags().BoolVar(&GlobalSuppressWarnings, "suppress-warnings", false, "Suppress all warnings")
RootCmd.PersistentFlags().BoolVar(&GlobalErrorOnWarning, "error-on-warning", false, "Treat any warning as an error")
RootCmd.PersistentFlags().StringVarP(&GlobalFile, "file", "f", "docker-compose.yml", "Specify an alternative compose file")
RootCmd.PersistentFlags().StringArrayVarP(&GlobalFiles, "file", "f", []string{}, "Specify an alternative compose file")
RootCmd.PersistentFlags().StringVarP(&GlobalBundle, "bundle", "b", "", "Specify a Distributed Application GlobalBundle (DAB) file")
RootCmd.PersistentFlags().StringVar(&GlobalProvider, "provider", "kubernetes", "Specify a provider. Kubernetes or OpenShift.")
}
+4 -4
View File
@@ -38,10 +38,10 @@ var upCmd = &cobra.Command{
// Create the Convert options.
UpOpt = kobject.ConvertOptions{
Replicas: UpReplicas,
InputFile: GlobalFile,
Provider: strings.ToLower(GlobalProvider),
EmptyVols: UpEmptyVols,
Replicas: UpReplicas,
InputFiles: GlobalFiles,
Provider: strings.ToLower(GlobalProvider),
EmptyVols: UpEmptyVols,
}
},
Run: func(cmd *cobra.Command, args []string) {