image: clojure:alpine

cache:
  paths:
    - ~/.m2
  key: "$CI_COMMIT_REF_NAME"
  untracked: true

variables:
  LC_ALL: "C"

test:
  image: cmeter/clojure-phantomjs
  stage: test
  script:
    - lein phantomtest

deps-check:
  stage: test
  script:
    - lein ancient
  allow_failure: true

idiomatic?:
  stage: test
  script:
    - lein kibit
  allow_failure: true

build-image:
  image: docker:git
  stage: deploy
  services:
    - docker:dind
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
    - docker build -t $CI_REGISTRY_IMAGE .
    - docker push $CI_REGISTRY_IMAGE
  only:
    - master

build-dev-image:
  image: docker:git
  stage: deploy
  services:
    - docker:dind
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
    - docker build -t $CI_REGISTRY_IMAGE .
    - docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_IMAGE:develop
    - docker push $CI_REGISTRY_IMAGE:develop
    # Build docs
    - docker build -t $CI_REGISTRY_IMAGE -f Dockerfile.docs .
    - docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_IMAGE:docs
    - docker push $CI_REGISTRY_IMAGE:docs
  only:
    - develop

image: clojure:alpine

cache:
  paths:
    - ~/.m2
    - /root/.m2
  untracked: true

variables:
  LC_ALL: "C"

test:
  image: cmeter/clojure-phantomjs
  stage: test
  script:
    - lein phantomtest

deps-check:
  stage: test
  script:
    - lein ancient
  allow_failure: true

idiomatic?:
  stage: test
  script:
    - lein kibit
  allow_failure: true

build-image:
  image: docker:git
  stage: deploy
  services:
    - docker:dind
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
    - docker build -t $CI_REGISTRY_IMAGE .
    - docker push $CI_REGISTRY_IMAGE
  only:
    - master

build-dev-image:
  image: docker:git
  stage: deploy
  services:
    - docker:dind
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
    - docker build -t $CI_REGISTRY_IMAGE .
    - docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_IMAGE:develop
    - docker push $CI_REGISTRY_IMAGE:develop
    # Build docs
    - docker build -t $CI_REGISTRY_IMAGE -f Dockerfile.docs .
    - docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_IMAGE:docs
    - docker push $CI_REGISTRY_IMAGE:docs
  only:
    - develop

Add root cache directory for maven deps
Add root cache directory for maven deps
