github.com/spinnaker/spin@v1.30.0/cmd/assembler/assembler.go (about)

     1  // Copyright (c) 2018, Google, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //   http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  //   Unless required by applicable law or agreed to in writing, software
    10  //   distributed under the License is distributed on an "AS IS" BASIS,
    11  //   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  //   See the License for the specific language governing permissions and
    13  //   limitations under the License.
    14  
    15  package assembler
    16  
    17  import (
    18  	"github.com/spf13/cobra"
    19  
    20  	"github.com/spinnaker/spin/cmd"
    21  	"github.com/spinnaker/spin/cmd/account"
    22  	"github.com/spinnaker/spin/cmd/application"
    23  	"github.com/spinnaker/spin/cmd/canary"
    24  	canary_config "github.com/spinnaker/spin/cmd/canary/canary-config"
    25  	"github.com/spinnaker/spin/cmd/pipeline"
    26  	pipeline_template "github.com/spinnaker/spin/cmd/pipeline-template"
    27  	"github.com/spinnaker/spin/cmd/pipeline/execution"
    28  	"github.com/spinnaker/spin/cmd/project"
    29  )
    30  
    31  // AddSubCommands adds all the subcommands to the rootCmd.
    32  // rootOpts are passed through to the subcommands.
    33  func AddSubCommands(rootCmd *cobra.Command, rootOpts *cmd.RootOptions) {
    34  	rootCmd.AddCommand(account.NewAccountCmd(rootOpts))
    35  
    36  	rootCmd.AddCommand(application.NewApplicationCmd(rootOpts))
    37  
    38  	canaryCmd, canaryOpts := canary.NewCanaryCmd(rootOpts)
    39  	canaryCmd.AddCommand(canary_config.NewCanaryConfigCmd(canaryOpts))
    40  	rootCmd.AddCommand(canaryCmd)
    41  
    42  	pipelineCmd, pipelineOpts := pipeline.NewPipelineCmd(rootOpts)
    43  	pipelineCmd.AddCommand(execution.NewExecutionCmd(pipelineOpts))
    44  	rootCmd.AddCommand(pipelineCmd)
    45  
    46  	rootCmd.AddCommand(pipeline_template.NewPipelineTemplateCmd(rootOpts))
    47  
    48  	rootCmd.AddCommand(project.NewProjectCmd(rootOpts))
    49  }