image: docker:stable

stages:         
  - build
  - deploy

build-job:    
  stage: build
  tags:
    - docker
  only:
    - master
  script:
    - docker info
    - docker build -t docker-registry.dopcore.com/andrusyakka/urban-couscous .

deploy-job:     
  stage: deploy
  tags:
    - docker  
  only:
    - master
  script:
    - echo "$DOCKER_PASSWORD" | docker login docker-registry.dopcore.com -u "$DOCKER_USER" --password-stdin
    - docker push docker-registry.dopcore.com/andrusyakka/urban-couscous
