You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
967 B

Unify `copies` and `artifacts` configuration Refactored `copies` configuration to allow for greater control over when and which both local build context files and variant artifacts are copied into the target image. The new configuration introduces a "local" keyword to signify when a `copies` entry should apply to the files from the local build context as opposed to files from another variant's image during a multi-stage build. variants: build: copies: - from: local source: ./src destination: . Note that with this change, the user must now explicitly define whether _any_ files should be copied in from the local build context. None will be copied in by default. To help keep configurations succinct, especially considering this new requirement, and to approximate the old `copies: variant`, a shorthand format and sane defaults for `source` and `destination` (depending whether `from` is "local" or a variant name) were implemented. variants: build: copies: [local] development: copies: - from: build - from: local source: ./config.dev.yaml destination: ./config.yaml The shorthand: copies: [ref, ...] # is equivalent to copies: [{ from: ref }, ...] And the following defaults are used when no `source` and `destination` are specified. copies: - from: local # defaults to - from: local source: . destination: . copies: - from: variant # defaults to two entries - from: variant source: /srv/app # the lives.in dir destination: /srv/app - from: variant source: /opt/local # the shared lib dir destination: /opt/local Bug: T211625 Change-Id: I4c4217905afc0762b6bd66ed594d43cc0486e3e2
5 years ago
Unify `copies` and `artifacts` configuration Refactored `copies` configuration to allow for greater control over when and which both local build context files and variant artifacts are copied into the target image. The new configuration introduces a "local" keyword to signify when a `copies` entry should apply to the files from the local build context as opposed to files from another variant's image during a multi-stage build. variants: build: copies: - from: local source: ./src destination: . Note that with this change, the user must now explicitly define whether _any_ files should be copied in from the local build context. None will be copied in by default. To help keep configurations succinct, especially considering this new requirement, and to approximate the old `copies: variant`, a shorthand format and sane defaults for `source` and `destination` (depending whether `from` is "local" or a variant name) were implemented. variants: build: copies: [local] development: copies: - from: build - from: local source: ./config.dev.yaml destination: ./config.yaml The shorthand: copies: [ref, ...] # is equivalent to copies: [{ from: ref }, ...] And the following defaults are used when no `source` and `destination` are specified. copies: - from: local # defaults to - from: local source: . destination: . copies: - from: variant # defaults to two entries - from: variant source: /srv/app # the lives.in dir destination: /srv/app - from: variant source: /opt/local # the shared lib dir destination: /opt/local Bug: T211625 Change-Id: I4c4217905afc0762b6bd66ed594d43cc0486e3e2
5 years ago
  1. ---
  2. version: v4
  3. base: docker-registry.wikimedia.org/wikimedia-stretch:latest
  4. apt:
  5. packages: [libjpeg, libyaml]
  6. python:
  7. version: python2.7
  8. runs:
  9. environment:
  10. FOO: bar
  11. BAR: baz
  12. variants:
  13. build:
  14. apt:
  15. packages: [libjpeg-dev, libyaml-dev]
  16. node:
  17. requirements: [package.json, package-lock.json]
  18. python:
  19. requirements: [requirements.txt]
  20. builder:
  21. command: [make, deps]
  22. requirements: [Makefile, vendor]
  23. copies: [local]
  24. development:
  25. includes: [build]
  26. test:
  27. includes: [build]
  28. apt:
  29. packages: [chromium]
  30. python:
  31. requirements: [requirements.txt, test-requirements.txt, docs/requirements.txt]
  32. runs:
  33. insecurely: true
  34. entrypoint: [npm, test]
  35. prep:
  36. includes: [build]
  37. node:
  38. env: production
  39. production:
  40. base: docker-registry.wikimedia.org/wikimedia-stretch:latest
  41. node:
  42. env: production
  43. copies: [prep]
  44. entrypoint: [node, server.js]