image: docker:latest
services:
  - docker:dind

variables:
  DOCKER_DRIVER: overlay

before_script:
    - apt-get update -y

test:
  script:
    - apt-get install default-jre -y
    - wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
    - chmod a+x lein
    - export LEIN_ROOT=1
    - PATH=$PATH:.
    - lein deps
    - lein midje

build:
  script:
    - ./build.sh

deploy:
  script:
    - curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
    - ./deploy.sh

image: docker:latest
services:
  - docker:dind

variables:
  DOCKER_DRIVER: overlay

stages:
  - test
  - build
  - release

test:
  stage: test
  script:
    - apk update
    - apk install openjdk8-jre-base
    - wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
    - chmod a+x lein
    - export LEIN_ROOT=1
    - PATH=$PATH:.
    - lein deps
    - lein midje

build:
  stage: build
  script:
    - docker build --tag registry.heroku.com/yorck-ratings/web --rm .
    - echo $HEROKU_API_KEY | docker login --username _ --password-stdin registry.heroku.com
    - docker push registry.heroku.com/yorck-ratings/web

release:
  stage: release
  script:
    - docker run --rm -e HEROKU_API_KEY=$HEROKU_API_KEY dickeyxxx/heroku-cli:v7.0.98 heroku container:release web --app yorck-ratings

Work with Docker in Docker setup
Work with Docker in Docker setup
