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 /README.md | |
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 'README.md')
-rw-r--r-- | README.md | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -14,8 +14,6 @@ running ad-hoc commands. base: debian:jessie apt: packages: [libjpeg, libyaml] -node: - dependencies: true runs: in: /srv/service as: runuser @@ -26,13 +24,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] @@ -41,10 +44,7 @@ variants: base: debian:jessie-slim node: env: production - artifacts: - - from: test - source: /srv/service - destination: . + copies: test entrypoint: [node, server.js] ``` |