2020-09-28 03:26:34 +05:00
|
|
|
image: docker:19.03.13
|
|
|
|
|
|
|
|
services:
|
|
|
|
- docker:19.03.13-dind
|
|
|
|
|
|
|
|
variables:
|
|
|
|
DOCKER_HOST: tcp://docker:2375
|
|
|
|
DOCKER_TCP_PORT: 2375
|
|
|
|
DOCKER_TLS_CERTDIR: ""
|
|
|
|
LOCAL_REGISTRY_IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest
|
|
|
|
LOCAL_REGISTRY_IMAGE_TAGGED: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
|
|
|
|
DOCKERHUB_IMAGE_LATEST: pztrn/taskd:latest
|
|
|
|
DOCKERHUB_IMAGE_TAGGED: pztrn/taskd:$CI_COMMIT_TAG
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
|
|
- docker login -u "$DOCKERHUB_USER" -p "$DOCKERHUB_PASSWORD"
|
|
|
|
- docker info
|
|
|
|
|
|
|
|
build-local-registry-latest:
|
|
|
|
stage: build
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- docker build --pull -t $LOCAL_REGISTRY_IMAGE_LATEST .
|
|
|
|
- docker push $LOCAL_REGISTRY_IMAGE_LATEST
|
2020-11-20 19:00:39 +05:00
|
|
|
only:
|
|
|
|
- master
|
2020-09-28 03:26:34 +05:00
|
|
|
|
|
|
|
build-local-registry-version:
|
|
|
|
stage: build
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- docker build --pull -t $LOCAL_REGISTRY_IMAGE_TAGGED .
|
|
|
|
- docker push $LOCAL_REGISTRY_IMAGE_TAGGED
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
|
|
|
|
build-dockerhub-latest:
|
|
|
|
stage: build
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- docker build --pull -t $DOCKERHUB_IMAGE_LATEST .
|
|
|
|
- docker push $DOCKERHUB_IMAGE_LATEST
|
2020-11-20 19:00:39 +05:00
|
|
|
only:
|
|
|
|
- master
|
2020-09-28 03:26:34 +05:00
|
|
|
|
|
|
|
build-dockerhub-version:
|
|
|
|
stage: build
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
script:
|
|
|
|
- docker build --pull -t $DOCKERHUB_IMAGE_TAGGED .
|
|
|
|
- docker push $DOCKERHUB_IMAGE_TAGGED
|
|
|
|
only:
|
|
|
|
- tags
|