diff options
author | Dan Duvall <dduvall@wikimedia.org> | 2017-05-01 10:45:00 -0700 |
---|---|---|
committer | Dan Duvall <dduvall@wikimedia.org> | 2017-05-01 10:45:00 -0700 |
commit | d0ada7682fa323c52940c99113a8809aecfae06b (patch) | |
tree | 1941e58214e705a08df8fee88d1537aab26507ef | |
parent | 72a866a74aade72fd9b22a6f364a68193087e8f3 (diff) | |
download | blubber-d0ada7682fa323c52940c99113a8809aecfae06b.tar.gz |
Rename `run` config to `runs`
It sounds more declarative.
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | blubber.example.yaml | 2 | ||||
-rw-r--r-- | config/common.go | 4 | ||||
-rw-r--r-- | config/runs.go (renamed from config/run.go) | 8 | ||||
-rw-r--r-- | docker/compiler.go | 14 |
5 files changed, 16 insertions, 16 deletions
@@ -16,7 +16,7 @@ apt: packages: [libjpeg, libyaml] npm: install: true -run: +runs: in: /srv/service as: runuser uid: 666 @@ -67,7 +67,7 @@ apt: packages: [libjpeg, libyaml, libjpeg-dev, libyaml-dev, chromium] npm: install: true -run: +runs: in: /srv/service as: runuser uid: 666 diff --git a/blubber.example.yaml b/blubber.example.yaml index 0134062..3559592 100644 --- a/blubber.example.yaml +++ b/blubber.example.yaml @@ -4,7 +4,7 @@ apt: packages: [libjpeg, libyaml] npm: install: true -run: +runs: in: /srv/service as: runuser uid: 666 diff --git a/config/common.go b/config/common.go index 36ebc01..c4dc2db 100644 --- a/config/common.go +++ b/config/common.go @@ -4,7 +4,7 @@ type CommonConfig struct { Base string `yaml:"base"` Apt AptConfig `yaml:"apt"` Npm NpmConfig `yaml:"npm"` - Run RunConfig `yaml:"run"` + Runs RunsConfig `yaml:"runs"` SharedVolume bool `yaml:"sharedvolume"` EntryPoint []string `yaml:"entrypoint"` } @@ -16,7 +16,7 @@ func (cc1 *CommonConfig) Merge(cc2 CommonConfig) { cc1.Apt.Merge(cc2.Apt) cc1.Npm.Merge(cc2.Npm) - cc1.Run.Merge(cc2.Run) + cc1.Runs.Merge(cc2.Runs) cc1.SharedVolume = cc1.SharedVolume || cc2.SharedVolume diff --git a/config/run.go b/config/runs.go index 410eca6..70f03a9 100644 --- a/config/run.go +++ b/config/runs.go @@ -5,21 +5,21 @@ import ( "strings" ) -type RunConfig struct { +type RunsConfig struct { In string `yaml:"in"` As string `yaml:"as"` Uid int `yaml:"uid"` - Gid int `yaml:"uid"` + Gid int `yaml:"gid"` } -func (run *RunConfig) Merge(run2 RunConfig) { +func (run *RunsConfig) Merge(run2 RunsConfig) { if run2.In != "" { run.In = run2.In } if run2.As != "" { run.As = run2.As } if run2.Uid != 0 { run.Uid = run2.Uid } if run2.Gid != 0 { run.Gid = run2.Gid } } -func (run RunConfig) Commands() []string { +func (run RunsConfig) Commands() []string { cmds := []string{} if run.In != "" { diff --git a/docker/compiler.go b/docker/compiler.go index ed3cd48..f5114c4 100644 --- a/docker/compiler.go +++ b/docker/compiler.go @@ -35,20 +35,20 @@ func CompileStage(buffer *bytes.Buffer, stage string, vcfg *config.VariantConfig Writeln(buffer, "USER root") Writeln(buffer, "WORKDIR /srv") CompileToCommands(buffer, vcfg.Apt) - CompileToCommands(buffer, vcfg.Run) + CompileToCommands(buffer, vcfg.Runs) - if vcfg.Run.As != "" { - Writeln(buffer, "USER ", vcfg.Run.As) + if vcfg.Runs.As != "" { + Writeln(buffer, "USER ", vcfg.Runs.As) } - if vcfg.Run.In != "" { - Writeln(buffer, "WORKDIR ", vcfg.Run.In) + if vcfg.Runs.In != "" { + Writeln(buffer, "WORKDIR ", vcfg.Runs.In) } if vcfg.SharedVolume { - Writeln(buffer, "VOLUME [\"", vcfg.Run.In, "\"]") + Writeln(buffer, "VOLUME [\"", vcfg.Runs.In, "\"]") } else { - Writeln(buffer, "COPY . \"", vcfg.Run.In, "\"") + Writeln(buffer, "COPY . \"", vcfg.Runs.In, "\"") } CompileToCommands(buffer, vcfg.Npm) |