image: docker:19.03.1

variables:
  REGISTRY: 144.91.121.112:8082
  DEV_TAG: qpay-web:0.0.1-SNAPSHOT
  TAG: qpay-web:0.0.1-RELEASE
  DOCKER_OPTS: "--insecure-registry=$REGISTRY"

stages:
  - lab
  - prod

before_script:
  - docker info
  - docker login -u admin -p 1aae6202-7d42-44e4-bdc7-d988a95fdfe2 $REGISTRY

lab:
  stage: lab
  script:
    - docker build -f Dockerfile-lab -t "$REGISTRY/$DEV_TAG" .
    - docker push "$REGISTRY/$DEV_TAG"
  only:
    - develop

prod:
  stage: prod
  script:
    - docker build -f Dockerfile -t "$REGISTRY/$TAG" .
    - docker push "$REGISTRY/$TAG"
  only:
    - master
    - release/0.0.1-RELEASE
