image: docker:18.09.7

stages:
  - build


build_image:
  stage: build
  services:
    - docker:18.09.7-dind
  script:
    - if [ "$CI_COMMIT_REF_NAME" == "master" ]; then TAG="latest"; else TAG="develop"; fi
    - docker build -t $CI_REGISTRY_IMAGE:$TAG .
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker push $CI_REGISTRY_IMAGE:$TAG


