rawfile-localpv/.gitlab-ci.yml
Mehran Kholdi 46bd3565a0 Use immutable tags for running tasks
This way we can run tasks with `IfNotPresent` and be sure it works as intended.
2020-05-29 21:04:40 +04:30

21 lines
587 B
YAML

build:
stage: build
image: docker:stable
variables:
IMAGE_REPO: hamravesh/rawfile-csi
script:
- export REGISTRY=docker.io
- mkdir -p ~/.docker/; echo $DOCKER_AUTH_CONFIG >~/.docker/config.json
- export IMAGE="$REGISTRY/$IMAGE_REPO"
- |
docker build \
-t $IMAGE:$CI_COMMIT_SHORT_SHA \
-t $IMAGE:$CI_COMMIT_REF_SLUG \
--build-arg IMAGE_TAG=$CI_COMMIT_SHORT_SHA \
--build-arg IMAGE_REPOSITORY=$IMAGE \
.
- docker push $IMAGE:$CI_COMMIT_SHORT_SHA
- docker push $IMAGE:$CI_COMMIT_REF_SLUG
tags:
- docker