cmd/pkg: Add 'extra-source' field to the pkg schema

And 'sources' to the Pkg structure

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2018-07-24 14:00:19 +01:00
parent ce6b15c0b6
commit 75149c56c2

View File

@ -17,6 +17,7 @@ type pkgInfo struct {
Image string `yaml:"image"` Image string `yaml:"image"`
Org string `yaml:"org"` Org string `yaml:"org"`
Arches []string `yaml:"arches"` Arches []string `yaml:"arches"`
ExtraSources []string `yaml:"extra-sources"`
GitRepo string `yaml:"gitrepo"` // ?? GitRepo string `yaml:"gitrepo"` // ??
Network bool `yaml:"network"` Network bool `yaml:"network"`
DisableContentTrust bool `yaml:"disable-content-trust"` DisableContentTrust bool `yaml:"disable-content-trust"`
@ -32,12 +33,19 @@ type pkgInfo struct {
} `yaml:"depends"` } `yaml:"depends"`
} }
// Specifies the source directory for a package and their destination in the build context.
type pkgSource struct {
src string
dst string
}
// Pkg encapsulates information about a package's source // Pkg encapsulates information about a package's source
type Pkg struct { type Pkg struct {
// These correspond to pkgInfo fields // These correspond to pkgInfo fields
image string image string
org string org string
arches []string arches []string
sources []pkgSource
gitRepo string gitRepo string
network bool network bool
trust bool trust bool
@ -199,6 +207,7 @@ func NewFromCLI(fs *flag.FlagSet, args ...string) (Pkg, error) {
hash: hash, hash: hash,
commitHash: hashCommit, commitHash: hashCommit,
arches: pi.Arches, arches: pi.Arches,
sources: pi.Sources,
gitRepo: pi.GitRepo, gitRepo: pi.GitRepo,
network: pi.Network, network: pi.Network,
trust: !pi.DisableContentTrust, trust: !pi.DisableContentTrust,