46bd3565a0
This way we can run tasks with `IfNotPresent` and be sure it works as intended.
21 lines
587 B
YAML
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
|