Commit ecc62267 authored by Aleksey Shirokih's avatar Aleksey Shirokih
Browse files

better building

parent 17e5f297
......@@ -25,7 +25,7 @@ build_tgz:
- docker
upload:
stage: upload
stage: upload
image: registry.getnoc.com/infrastructure/s3helper:master
script:
- export VERSION=$(cat VERSION)
......@@ -36,7 +36,7 @@ upload:
dependencies:
- build_tgz
tags:
- docker
- docker
build_image:
stage: build_image
......@@ -45,8 +45,9 @@ build_image:
- export CONTAINER_NAME=$CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker build --build-arg="http_proxy=$PROXY" --build-arg="https_proxy=$PROXY" --build-arg=VERSION=${VERSION} -t $CONTAINER_NAME .
- docker push $CONTAINER_NAME
- docker pull $CONTAINER_NAME
- docker build --pull --build-arg="http_proxy=$PROXY" --build-arg="https_proxy=$PROXY" --build-arg=VERSION=${VERSION} -t $CONTAINER_NAME .
- docker push $CONTAINER_NAME
- if [ -n "${CI_BUILD_TAG}" ]; then docker tag $CONTAINER_NAME $CI_REGISTRY_IMAGE:${CI_BUILD_TAG}; docker push $CI_REGISTRY_IMAGE:${CI_BUILD_TAG}; fi
- if [ -n "${CI_BUILD_TAG}" ]; then docker tag $CONTAINER_NAME $CI_REGISTRY_IMAGE:latest; docker push $CI_REGISTRY_IMAGE:latest; fi
dependencies:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment