diff options
author | Dan Duvall <dduvall@wikimedia.org> | 2017-08-30 09:47:41 -0700 |
---|---|---|
committer | Dan Duvall <dduvall@wikimedia.org> | 2017-09-07 10:01:34 -0700 |
commit | 410085e1f5be759b6a2bfbe08a51dca84aa18e3c (patch) | |
tree | 9c0b1e24953082cfe96e84b0924ba0ac90c67100 /blubber.example.yaml | |
parent | 2a19f04679b042567dd7ed9c0208eacbb63b8d26 (diff) | |
download | blubber-410085e1f5be759b6a2bfbe08a51dca84aa18e3c.tar.gz |
Support `copies` config entry for multi-stage builds
Summary:
Support a `copies` variant config entry that will result in a
multi-stage build, copying both shared library files and application
directory from a previously defined variant. This is essentially a
shorthand for two `artifacts` entries that are likely to be idiomatic to
multi-stage build/prod configurations.
Defined a new abstract `build.CopyFrom` instruction and corresponding
`docker.DockerCopyFrom` instruction and refactored the writing of these
Dockerfile lines to be accomplished using an `InstructionsForPhase`
method on `config.ArtifactsConfig`.
Implemented new support for `copies` configuration in
`config.VariantConfig` and an `InstructionsForPhase` method that returns
`build.CopyFrom` instructions for both the shared library and
application directories.
Fixes T174622
Depends on D759
Test Plan:
Run `go test ./...`. Run `blubber blubber.example.yaml production` and ensure
the right `COPY --from` lines are included for the final stage.
Reviewers: thcipriani, mobrovac, hashar, mmodell, #release-engineering-team
Reviewed By: thcipriani, #release-engineering-team
Tags: #release-engineering-team
Maniphest Tasks: T174622
Differential Revision: https://phabricator.wikimedia.org/D768
Diffstat (limited to 'blubber.example.yaml')
-rw-r--r-- | blubber.example.yaml | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/blubber.example.yaml b/blubber.example.yaml index 4cea7c3..87a4cf1 100644 --- a/blubber.example.yaml +++ b/blubber.example.yaml @@ -2,8 +2,6 @@ base: debian:jessie apt: packages: [libjpeg, libyaml] -node: - dependencies: true runs: in: /srv/service as: runuser @@ -14,13 +12,18 @@ runs: BAR: baz variants: - development: + build: apt: packages: [libjpeg-dev, libyaml-dev] + node: + dependencies: true + + development: + includes: [build] sharedvolume: true test: - includes: [development] + includes: [build] apt: packages: [chromium] entrypoint: [npm, test] @@ -29,8 +32,5 @@ variants: base: debian:jessie-slim node: env: production - artifacts: - - from: test - source: /srv/service - destination: . + copies: test entrypoint: [node, server.js] |