stages:
 - build
 - push

docker_build:
  stage: build
  script: BUILD_EXTRA="--no-cache --pull" ./build.sh $CI_REGISTRY_IMAGE

docker_push:
  stage: push
  before_script:
  - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
  script:
  - docker push "${CI_REGISTRY_IMAGE}:oldstable"
  - docker push "${CI_REGISTRY_IMAGE}:stable"
  - docker push "${CI_REGISTRY_IMAGE}:rc"
  - docker push "${CI_REGISTRY_IMAGE}:dev"
  - docker push "${CI_REGISTRY_IMAGE}:latest"
  only:
    refs:
    - master
