CI: add versioned docker images

This commit is contained in:
Dzmitryi Rudkouski 2019-01-18 20:01:18 +00:00 committed by Grégoire Henry
parent 7bcd3892b7
commit 9c22170aef
No known key found for this signature in database
GPG Key ID: 50D984F20BD445D2

View File

@ -573,12 +573,16 @@ publish:docker:
- zeronet-staging - zeronet-staging
- mainnet-staging - mainnet-staging
before_script: before_script:
- apk add git
- mkdir ~/.docker || true - mkdir ~/.docker || true
- echo "${CI_DOCKER_AUTH}" > ~/.docker/config.json - echo "${CI_DOCKER_AUTH}" > ~/.docker/config.json
script: script:
- LAST_COMMIT_DATE_TIME=$(git log --pretty=format:"%cd" -1 --date="format:%Y%m%d%H%M%S" 2>&1)
- ./scripts/create_docker_image.sh - ./scripts/create_docker_image.sh
"${public_docker_image_name}" "${CI_COMMIT_REF_NAME}" "${public_docker_image_name}" "${CI_COMMIT_REF_NAME}"
- docker push "${public_docker_image_name}:${CI_COMMIT_REF_NAME}" - docker push "${public_docker_image_name}:${CI_COMMIT_REF_NAME}"
- docker tag "${public_docker_image_name}:${CI_COMMIT_REF_NAME}" "${public_docker_image_name}:${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHORT_SHA}_${LAST_COMMIT_DATE_TIME}"
- docker push "${public_docker_image_name}:${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHORT_SHA}_${LAST_COMMIT_DATE_TIME}"
tags: tags:
- safe_docker - safe_docker