Earthly Build Caching in GitLab Container Registry

This commit is contained in:
Δ ǀ Ξ ȼ
2023-08-27 17:17:29 +00:00
committed by TC
parent 6f71c6a00a
commit ab51f68c4d
2 changed files with 64 additions and 15 deletions

View File

@@ -12,18 +12,27 @@ stages:
test_amd64:
stage: test
image: earthly/earthly:v0.7.15
image: docker
services:
- docker:dind
only:
- main
- merge_requests
script:
- main
- merge_requests
before_script:
- apk update && apk add git
- wget https://github.com/earthly/earthly/releases/download/v0.6.2/earthly-linux-amd64 -O /usr/local/bin/earthly
- chmod +x /usr/local/bin/earthly
- earthly bootstrap
- earthly --ci +unit-tests-linux-amd64
when: manual
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
script:
- if [ "$CI_COMMIT_BRANCH" == "main" ]; then cache_args="--save-inline-cache --push"; fi
- if [ "$CI_PROJECT_PATH" != "veilid/veilid" ]; then project_args="--CI_PROJECT_PATH=$CI_PROJECT_PATH"; fi
- earthly --use-inline-cache $cache_args --ci +unit-tests-linux $project_args
resource_group: test
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo "running release_job"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
@@ -55,7 +64,7 @@ package_amd64_deb:
- /home/gitlab-runner/scp-to-orchestrator.sh
rules:
- if: '$CI_COMMIT_TAG =~ /v\d.+/'
package_arm64_deb:
stage: build_packages
needs:
@@ -113,4 +122,4 @@ delete_build_machines:
- /home/gitlab-runner/build-machine-ctl.sh delete arm64-deb
- /home/gitlab-runner/build-machine-ctl.sh delete amd64-rpm
rules:
- if: '$CI_COMMIT_TAG =~ /v\d.+/'
- if: '$CI_COMMIT_TAG =~ /v\d.+/'