update pipeline networking

This commit is contained in:
Brad Rydzewski 2017-05-16 12:50:06 +02:00
parent f734bd0b60
commit 729d759985
3 changed files with 26 additions and 72 deletions

View file

@ -39,7 +39,6 @@ type Compiler struct {
metadata frontend.Metadata
registries []Registry
secrets map[string]Secret
aliases []string
}
// New creates a new Compiler with options.
@ -119,14 +118,6 @@ func (c *Compiler) Compile(conf *yaml.Config) *backend.Config {
stage.Name = fmt.Sprintf("%s_services", c.prefix)
stage.Alias = "services"
for _, container := range conf.Services.Containers {
if !container.Constraints.Match(c.metadata) {
continue
}
c.aliases = append(c.aliases, container.Name)
}
for i, container := range conf.Services.Containers {
if !container.Constraints.Match(c.metadata) {
continue
@ -169,32 +160,3 @@ func (c *Compiler) Compile(conf *yaml.Config) *backend.Config {
return config
}
// func setupNetwork(step *backend.Step, network *libcompose.Network) {
// step.Networks = append(step.Networks, backend.Conn{
// Name: network.Name,
// // Aliases:
// })
// }
//
// func setupVolume(step *backend.Step, volume *libcompose.Volume) {
// step.Volumes = append(step.Volumes, volume.String())
// }
//
// var (
// // Default plugin used to clone the repository.
// defaultCloneImage = "plugins/git:latest"
//
// // Default plugin settings used to clone the repository.
// defaultCloneVargs = map[string]interface{}{
// "depth": 0,
// }
// )
//
// // defaultClone returns the default step for cloning an image.
// func defaultClone() *yaml.Container {
// return &yaml.Container{
// Image: defaultCloneImage,
// Vargs: defaultCloneVargs,
// }
// }

View file

@ -25,7 +25,7 @@ func (c *Compiler) createProcess(name string, container *yaml.Container) *backen
networks := []backend.Conn{
backend.Conn{
Name: fmt.Sprintf("%s_default", c.prefix),
Aliases: c.aliases,
Aliases: []string{container.Name},
},
}
for _, network := range c.networks {
@ -42,14 +42,6 @@ func (c *Compiler) createProcess(name string, container *yaml.Container) *backen
for _, volume := range container.Volumes.Volumes {
volumes = append(volumes, volume.String())
}
// if network == "" {
// network = fmt.Sprintf("%s_default", c.prefix)
// for _, alias := range c.aliases {
// // if alias != container.Name {
// aliases = append(aliases, alias)
// // }
// }
// } // host, bridge, none, container:<name>, overlay
// append default environment variables
environment := map[string]string{}

50
vendor/vendor.json vendored
View file

@ -33,74 +33,74 @@
{
"checksumSHA1": "W3AuK8ocqHwlUajGmQLFvnRhTZE=",
"path": "github.com/cncd/pipeline/pipeline",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "Qu2FreqaMr8Yx2bW9O0cxAGgjr0=",
"path": "github.com/cncd/pipeline/pipeline/backend",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "0CGXRaYwZhJxGIrGhn8WGpkFqPo=",
"path": "github.com/cncd/pipeline/pipeline/backend/docker",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "8Hj/OZnYZyz5N2hqENCTTaGtkNQ=",
"path": "github.com/cncd/pipeline/pipeline/frontend",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "9opqXFEPe4aCzLgE7WWmcT0luyI=",
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "KbcY6d5x1qa77ug9pMnzbqU+GTo=",
"checksumSHA1": "aDY/KPZW3iFTlpAz3DoYUgNf46A=",
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml/compiler",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "Q0GkNUFamVYIA1Fd8r0A5M6Gx54=",
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml/linter",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "kx2sPUIMozPC/g6E4w48h3FfH3k=",
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml/matrix",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "L7Q5qJmPITNmvFEEaj5MPwCWFRk=",
"path": "github.com/cncd/pipeline/pipeline/frontend/yaml/types",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "2/3f3oNmxXy5kcrRLCFa24Oc9O4=",
"path": "github.com/cncd/pipeline/pipeline/interrupt",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "uOjTfke7Qxosrivgz/nVTHeIP5g=",
"path": "github.com/cncd/pipeline/pipeline/multipart",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "vWImaniGEUutEvLvNCzTpSRSArg=",
"path": "github.com/cncd/pipeline/pipeline/rpc",
"revision": "b0776dfae18d347cbccc8c76874bbbedb7494fdb",
"revisionTime": "2017-05-14T17:21:45Z"
"revision": "c3a088758cdb75599bab803b1c71c604963d3acf",
"revisionTime": "2017-05-16T10:40:40Z"
},
{
"checksumSHA1": "7Qj1DK0ceAXkYztW0l3+L6sn+V8=",