From 410085e1f5be759b6a2bfbe08a51dca84aa18e3c Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Wed, 30 Aug 2017 09:47:41 -0700 Subject: 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 --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 38cdcae..b8018a7 100644 --- a/README.md +++ b/README.md @@ -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] ``` -- cgit v1.2.1