From bfb539ae174e4d4dfd159c887c76f71d3685f4e8 Mon Sep 17 00:00:00 2001 From: Robert Prehn <3952444+prehnRA@users.noreply.github.com> Date: Sat, 24 Apr 2021 12:28:45 -0500 Subject: [PATCH] fix: Copy scripts to docker image before running them --- .gitlab-ci.yml | 1 + Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97540d9b..a596e098 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,6 +42,7 @@ build_image_for_commit: - docker pull $CI_REGISTRY_IMAGE:latest || true # This enables fast parallel builds - export DOCKER_BUILDKIT=1 + - mkdir -p _build/prod - docker build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA . # Push the commit SHA tagged version to registry. We will later choose to tag that as stable # if everything passes. diff --git a/Dockerfile b/Dockerfile index b9b7066e..1d407f99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,8 +26,9 @@ ADD ./apps/admin/mix.exs /root/app/apps/admin/ ADD ./apps/app/mix.exs /root/app/apps/app/ ADD ./apps/content/mix.exs /root/app/apps/content/ ADD ./apps/core/mix.exs /root/app/apps/core/ -ADD ./_build/ /root/app/_build/ +ADD ./_build/${MIX_ENV}/ /root/app/_build/${MIX_ENV}/ ADD ./deps/ /root/app/deps/ +ADD ./script/ /root/app/script/ RUN script/restore-timestamps RUN mix deps.get RUN mix deps.compile @@ -49,7 +50,6 @@ FROM elixir1 ADD ./apps /root/app/apps # Resume compilation of the elixir app -ADD ./script /root/app/script RUN MAKE=cmake mix compile # Copy in the built assets & fingerprint them