before_script:
  - docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" zoo.smok.co

stages:
  - test
  - build
  - deploy

unittest:
  before_script:
    - echo "Not logging in"
  script:
    - docker-compose up --build unittest
  after_script:
    - docker-compose down


build_nginx:
  script:
    - docker-it nginx zoo.smok.co/henrietta/netguru/nginx deployment/nginx
  only:
    - master

build:
  stage: build
  script:
    - docker-it netguru zoo.smok.co/henrietta/netguru/backend . --target runtime

deploy:
  stage: deploy
  only:
    - master
  script:
    - docker stack deploy --with-registry-auth -c deployment/docker-compose.yml netguru
