43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
###############################################################
|
|
# Setting I use for cleaning up image tags #
|
|
# - Running cleanup every week #
|
|
# - Keeping 1 tag per image name matching : (?:v.\d+|dev) #
|
|
# - Removing tags older than 7 days matching the default : .* #
|
|
###############################################################
|
|
|
|
image: docker:stable
|
|
|
|
stages:
|
|
- build
|
|
- push
|
|
|
|
services:
|
|
- docker:dind
|
|
|
|
before_script:
|
|
- echo -n $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
|
|
|
|
Build:
|
|
stage: build
|
|
script:
|
|
- docker pull $CI_REGISTRY_IMAGE:dev-wavelink || true
|
|
- >
|
|
docker build
|
|
--pull
|
|
--build-arg VCS_REF=$CI_COMMIT_SHA
|
|
--build-arg VCS_URL=$CI_PROJECT_URL
|
|
--cache-from $CI_REGISTRY_IMAGE:dev-wavelink
|
|
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
|
.
|
|
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
|
|
|
Push dev-wavelink:
|
|
variables:
|
|
GIT_STRATEGY: none
|
|
stage: push
|
|
only:
|
|
- dev-wavelink
|
|
script:
|
|
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
|
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:dev
|
|
- docker push $CI_REGISTRY_IMAGE:dev
|