diff --git a/.gitlab/ci/container-build.gitlab-ci.yml b/.gitlab/ci/container-build.gitlab-ci.yml index 3b0d9ab..07df035 100644 --- a/.gitlab/ci/container-build.gitlab-ci.yml +++ b/.gitlab/ci/container-build.gitlab-ci.yml @@ -25,11 +25,21 @@ - amd64 - arm64 script: + - CACHE_TO="" + - | + if [ "$C0_GH_REF_NAME" = "main" ]; then + CACHE_TO="--cache-to type=registry,ref=ghcr.io/code0-tech/reticulum/ci-cache:${image}-${PLATFORM}" + fi - > build_image $image $CI_PIPELINE_ID - "--output type=registry,push-by-digest=true --metadata-file manifest-${CI_JOB_ID}.json" + " + --output type=registry,push-by-digest=true + --metadata-file manifest-${CI_JOB_ID}.json + --cache-from type=registry,ref=ghcr.io/code0-tech/reticulum/ci-cache:${image}-${PLATFORM} + $CACHE_TO + " "" artifacts: paths: @@ -40,11 +50,22 @@ extends: - .image-build-base script: + - CACHE_TO="" + - | + if [ "$C0_GH_REF_NAME" = "main" ]; then + CACHE_TO="--cache-to type=registry,ref=ghcr.io/code0-tech/reticulum/ci-cache:${image}-${VARIANT}-${PLATFORM}" + fi - > build_image $image $CI_PIPELINE_ID - "--build-arg VARIANT=$VARIANT --output type=registry,push-by-digest=true --metadata-file manifest-${CI_JOB_ID}.json" + " + --build-arg VARIANT=$VARIANT + --output type=registry,push-by-digest=true + --metadata-file manifest-${CI_JOB_ID}.json + --cache-from type=registry,ref=ghcr.io/code0-tech/reticulum/ci-cache:${image}-${VARIANT}-${PLATFORM} + $CACHE_TO + " "" artifacts: paths: diff --git a/container/sagittarius/Dockerfile.erb b/container/sagittarius/Dockerfile.erb index 8f2b580..1d1325f 100644 --- a/container/sagittarius/Dockerfile.erb +++ b/container/sagittarius/Dockerfile.erb @@ -46,6 +46,7 @@ COPY projects/sagittarius/extensions/ee/app/ extensions/ee/app/ # Precompile bootsnap code for faster boot times RUN bundle exec bootsnap precompile app/ lib/ <% if ee? %>extensions/ee/app/<% end %> +ARG RETICULUM_IMAGE_TAG=local RUN echo "$RETICULUM_IMAGE_TAG" > VERSION # Entrypoint prepares the database.