Skip to content
Snippets Groups Projects
.gitlab-ci.yml 845 B
Newer Older
Georg Seibt's avatar
Georg Seibt committed
image: openjdk:11-slim

variables:
  GRADLE_OPTS: "-Dorg.gradle.daemon=false"

before_script:
  - export GRADLE_USER_HOME=`pwd`/.gradle

build:
  stage: build
  script: ./gradlew clean assemble
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    policy: pull-push
    paths:
      - build
      - .gradle

test:
  stage: test
  script:
    - ./gradlew --build-cache check
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    policy: pull
    paths:
      - build
      - .gradle

Georg Seibt's avatar
Georg Seibt committed
publish release:
  stage: deploy
  script: ./gradlew --build-cache publish
  only:
    - tags
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    policy: pull
    paths:
      - build
      - .gradle

publish snapshot:
  stage: deploy
Georg Seibt's avatar
Georg Seibt committed
  script: ./gradlew --build-cache publish
  when: manual
Georg Seibt's avatar
Georg Seibt committed
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    policy: pull
    paths:
      - build
      - .gradle