fix: Make _build folder available to docker build
This commit is contained in:
parent
f2e27bbaa1
commit
39f508b297
1 changed files with 19 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
stages:
|
stages:
|
||||||
- application_dependencies
|
- application_dependencies
|
||||||
- asset_dependencies
|
- asset_dependencies
|
||||||
|
- prebuild
|
||||||
- test
|
- test
|
||||||
- deploy_tags
|
- deploy_tags
|
||||||
- deploy
|
- deploy
|
||||||
|
@ -63,12 +64,27 @@ fetch_asset_dependencies:
|
||||||
exclude:
|
exclude:
|
||||||
- apps/app/assets/node_modules
|
- apps/app/assets/node_modules
|
||||||
|
|
||||||
|
prebuild:
|
||||||
|
stage: prebuild
|
||||||
|
image: "elixir:1.10"
|
||||||
|
needs:
|
||||||
|
- fetch_application_dependencies
|
||||||
|
cache:
|
||||||
|
- key:
|
||||||
|
files:
|
||||||
|
- mix.lock
|
||||||
|
paths:
|
||||||
|
- _build/
|
||||||
|
- deps/
|
||||||
|
script:
|
||||||
|
- mix compile
|
||||||
|
|
||||||
# Test stage. Runs various tests and speculatively builds docker image in
|
# Test stage. Runs various tests and speculatively builds docker image in
|
||||||
# parallel, in case the build passes.
|
# parallel, in case the build passes.
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
needs:
|
needs:
|
||||||
- fetch_application_dependencies
|
- prebuild
|
||||||
image: "elixir:1.10"
|
image: "elixir:1.10"
|
||||||
services:
|
services:
|
||||||
- name: postgres:12
|
- name: postgres:12
|
||||||
|
@ -85,7 +101,7 @@ build_image_for_commit:
|
||||||
stage: test
|
stage: test
|
||||||
needs:
|
needs:
|
||||||
- fetch_asset_dependencies
|
- fetch_asset_dependencies
|
||||||
- fetch_application_dependencies
|
- prebuild
|
||||||
image: "docker:20.10"
|
image: "docker:20.10"
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
@ -109,6 +125,7 @@ build_image_for_commit:
|
||||||
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||||
# This copies the elixir build artifacts for deps and app so that we can cache them
|
# This copies the elixir build artifacts for deps and app so that we can cache them
|
||||||
- docker cp `docker create $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA`:/root/app/_build/prod _build
|
- docker cp `docker create $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA`:/root/app/_build/prod _build
|
||||||
|
- la -la _build/
|
||||||
|
|
||||||
# If tests pass, tag the commit and update package versions
|
# If tests pass, tag the commit and update package versions
|
||||||
deploy_to_tags:
|
deploy_to_tags:
|
||||||
|
|
Loading…
Reference in a new issue