tcpproxy/.gitlab-ci.yml

34 lines
1.0 KiB
YAML
Raw Normal View History

2023-06-14 19:38:48 +01:00
variables:
GIT_SUBMODULE_STRATEGY: recursive
2023-08-07 11:57:38 +01:00
BUILDAH_LAYERS: "true"
STORAGE_DRIVER: "vfs"
2023-06-14 19:38:48 +01:00
2023-06-14 12:52:42 +01:00
build:
stage: build
2023-08-07 11:42:41 +01:00
image: quay.io/buildah/stable
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
# tagged releases do not use cache but can generate it
- if: '"$CI_COMMIT_TAG" != ""'
variables:
CACHE_POLICY: push
- if: '"$CI_COMMIT_TAG" == ""'
variables:
CACHE_POLICY: pull-push
2023-06-19 10:53:04 +01:00
cache:
2023-08-07 11:42:41 +01:00
- key: cache-$CI_COMMIT_REF_SLUG
fallback_keys:
- cache-$CI_DEFAULT_BRANCH
- cache-default
paths:
- .cache/
policy: $CACHE_POLICY
before_script:
- buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
2023-06-14 12:52:42 +01:00
script:
2023-08-07 11:42:41 +01:00
- mkdir -p .cache/build
- buildah build -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}" -v "$(pwd)/.cache/build":/app/build:z .
- buildah push "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}"
- buildah push "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}" "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"