Smarter copies/sharedvolume/default behavior
Defined new abstract build.Volume and corresponding
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:
- When copies is set, simply depend on artifacts for the application files and do not copy anything from the build host.
- When sharedvolume is true, inject a build.Volume instruction for the application working directory.
- When neither of the above are set, copy application files from the host.
Run go test ./.... Run blubber blubber.example.yaml production and ensure:
- The prep stage has a COPY . . instruction.
- 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
Maniphest Tasks: T174623
Differential Revision: https://phabricator.wikimedia.org/D769