architect

package
v1.27.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2021 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Build = &cobra.Command{
	Use:   "build --file <file> --from <baseimage:version> --output <repository:tag> --type [java | nodejs | doozer] ",
	Short: "Build Docker image from binary 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(),
		})
	},
}

Functions

func RunArchitect

func RunArchitect(configuration RunConfiguration)

Types

type RunConfiguration added in v1.2.0

type RunConfiguration struct {
	NexusDownloader         nexus.Downloader
	Config                  *config.Config
	RegistryCredentialsFunc func(string) (*docker.RegistryCredentials, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL