From 62066296380d19dc77ab216cb27100e7e72ff69f Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Tue, 5 Sep 2017 17:33:27 -0700 Subject: Smarter copies/sharedvolume/default behavior Summary: Defined new abstract `build.Volume` and corresponding `docker.DockerVolume` instructions. Refactored compilation of main `COPY` or `VOLUME` instruction for application files to use the new instructions and moved injection of these instructions out of the compiler and into `VariantConfig`. The latter can be smarter about the following cases: 1. When `copies` is set, simply depend on artifacts for the application files and do not copy anything from the build host. 2. When `sharedvolume` is `true`, inject a `build.Volume` instruction for the application working directory. 3. When neither of the above are set, copy application files from the host. Fixes T174623 Depends on D768 Test Plan: Run `go test ./...`. Run `blubber blubber.example.yaml production` and ensure: 1. The `prep` stage has a `COPY . .` instruction. 2. The final stage has no `COPY . .` instruction, only `COPY --from=prep` instructions. Reviewers: thcipriani, mobrovac, hashar, mmodell, #release-engineering-team Reviewed By: thcipriani, mobrovac, #release-engineering-team Tags: #release-engineering-team Maniphest Tasks: T174623 Differential Revision: https://phabricator.wikimedia.org/D769 --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index b8018a7..c7e3e1f 100644 --- a/README.md +++ b/README.md @@ -40,11 +40,16 @@ variants: packages: [chromium] entrypoint: [npm, test] + prep: + includes: [build] + node: + env: production + production: base: debian:jessie-slim node: env: production - copies: test + copies: prep entrypoint: [node, server.js] ``` -- cgit v1.2.1