2021-01-22 04:35:36 -05:00
|
|
|
image: docker:latest
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- release
|
|
|
|
|
|
|
|
variables:
|
|
|
|
BUILD_IMAGE: registry.gitlab.com/infektweb/glv5/hetzner-cloud-environment/deploymentagent:$CI_COMMIT_REF_NAME
|
|
|
|
RELEASE_IMAGE: registry.gitlab.com/infektweb/glv5/hetzner-cloud-environment/deploymentagent:latest
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
|
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
2021-01-22 07:40:54 -05:00
|
|
|
tags: [shell]
|
2021-01-22 04:35:36 -05:00
|
|
|
script:
|
|
|
|
- cd deploymentagent/src/deploymentagent && docker build --build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --pull -t $BUILD_IMAGE .
|
|
|
|
- docker push $BUILD_IMAGE
|
|
|
|
|
|
|
|
release:
|
|
|
|
stage: release
|
2021-01-22 07:40:54 -05:00
|
|
|
tags: [shell]
|
2021-01-22 04:35:36 -05:00
|
|
|
script:
|
|
|
|
- docker pull $BUILD_IMAGE
|
|
|
|
- docker tag $BUILD_IMAGE $RELEASE_IMAGE
|
|
|
|
- docker push $RELEASE_IMAGE
|
|
|
|
only:
|
|
|
|
- master
|