Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Bc = &cobra.Command{ Use: "bc", Short: "build bc --file <bc>.json", Long: "Build images from openshift build configurations", Run: func(cmd *cobra.Command, args []string) { var nexusDownloader nexus.Downloader if verbose { logrus.SetLevel(logrus.DebugLevel) } else { logrus.SetLevel(logrus.InfoLevel) } configPath := cmd.Flag("file").Value.String() logrus.Debugf("Building from %s", configPath) // Read build config var configReader = config.NewFileConfigReader(configPath) c, err := configReader.ReadConfig() if err != nil { logrus.Fatalf("Could not read configuration: %s", err) } nexusAccess, err := config.ReadNexusAccessFromEnvVars() if err != nil { logrus.Fatalf("Unable to get Nexus credentials: %s", err) } nexusDownloader = nexus.NewMavenDownloader(nexusAccess.NexusURL, nexusAccess.Username, nexusAccess.Password) RunArchitect(RunConfiguration{ NexusDownloader: nexusDownloader, Config: c, RegistryCredentialsFunc: docker.LocalRegistryCredentials(), }) }, }
Bc build command using buildConfig as input
View Source
var Build = &cobra.Command{ Use: "build", Short: "build file --file <file> --from <baseimage:version> --output <repository:tag> --type [java | nodejs | doozer]", Long: "build images from source", Run: func(cmd *cobra.Command, args []string) { var nexusDownloader nexus.Downloader if verbose { logrus.SetLevel(logrus.DebugLevel) } else { logrus.SetLevel(logrus.InfoLevel) } notValid := len(cmd.Flag("file").Value.String()) == 0 || len(cmd.Flag("output").Value.String()) == 0 || len(cmd.Flag("from").Value.String()) == 0 || len(cmd.Flag("type").Value.String()) == 0 if notValid { err := cmd.Help() if err != nil { panic(err) } return } leveransepakke := cmd.Flag("file").Value.String() logrus.Debugf("Building %s", leveransepakke) // Read build config var configReader = config.NewCmdConfigReader(cmd, args, noPush) c, err := configReader.ReadConfig() if err != nil { logrus.Fatalf("Could not read configuration: %s", err) } var binaryInput string binaryInput, err = util.ExtractBinaryFromFile(leveransepakke) if err != nil { logrus.Fatalf("Could not read binary input: %s", err) } nexusDownloader = nexus.NewBinaryDownloader(binaryInput) RunArchitect(RunConfiguration{ NexusDownloader: nexusDownloader, Config: c, RegistryCredentialsFunc: docker.LocalRegistryCredentials(), }) }, }
Build command
Functions ¶
Types ¶
type RunConfiguration ¶
type RunConfiguration struct { NexusDownloader nexus.Downloader Config *config.Config RegistryCredentialsFunc func(string) (*docker.RegistryCredentials, error) PushUsername string PushToken string }
RunConfiguration runtime configuration
Click to show internal directories.
Click to hide internal directories.