2021-03-06 19:38:37 +01:00
|
|
|
# Based on https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Gradle.gitlab-ci.yml
|
|
|
|
image: gradle:jdk11
|
|
|
|
|
|
|
|
variables:
|
|
|
|
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- export GRADLE_USER_HOME=`pwd`/.gradle
|
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
script: gradle --build-cache assemble
|
|
|
|
cache:
|
|
|
|
key: "$CI_COMMIT_REF_NAME"
|
|
|
|
policy: push
|
|
|
|
paths:
|
|
|
|
- build
|
|
|
|
- .gradle
|
|
|
|
|
2021-03-06 21:30:15 +01:00
|
|
|
test:
|
|
|
|
stage: test
|
2021-07-18 12:30:58 +02:00
|
|
|
script: gradle --build-cache check
|
2021-03-06 21:30:15 +01:00
|
|
|
cache:
|
|
|
|
key: "$CI_COMMIT_REF_NAME"
|
|
|
|
policy: push
|
|
|
|
paths:
|
|
|
|
- build
|
|
|
|
- .gradle
|
|
|
|
|
2021-03-06 19:38:37 +01:00
|
|
|
artifact:
|
|
|
|
stage: deploy
|
|
|
|
script: gradle publish
|
|
|
|
rules:
|
|
|
|
- if: '$CI_COMMIT_BRANCH == "master"'
|
|
|
|
cache:
|
|
|
|
key: "$CI_COMMIT_REF_NAME"
|
|
|
|
policy: pull-push
|
|
|
|
paths:
|
|
|
|
- build
|
|
|
|
- .gradle
|