variables: XDG_CACHE_HOME: "${CI_PROJECT_DIR}/.cache" M2_REPO: "${XDG_CACHE_HOME}/m2/repository" MAVEN_OPTS: "-Dmaven.repo.local=${M2_REPO}" PRE_COMMIT_HOME: "${XDG_CACHE_HOME}/pre-commit" default: image: registry.gitlab.com/lv.enes/containers/build-env:latest cache: paths: - .cache/ - target/ - buildstuffs/target/ stages: - cache - lint - build - test - deploy # Can't do this, it tries to fetch buildstuffs which is outdated... # cache-maven: # stage: cache # script: # - ./mvnw dependency:go-offline lint-pre-commit: stage: lint script: - pre-commit run -a rules: - if: $CI_PIPELINE_SOURCE != "schedule" build: stage: build script: - ./mvnw install rules: - if: $CI_PIPELINE_SOURCE != "schedule" # Currently this one is just dependency-check, it didn't like my requests to populate the cache before, so leaving it # off for now... # test-all: # stage: test # script: # - ./mvnw verify -Denv=test test-libyear: stage: test script: - ./mvnw verify -DmaxLibYears=1 # NOTE: This one always fails when there's an update available test-pre-commit-update: stage: test artifacts: paths: - update.diff when: on_failure script: - pre-commit autoupdate - git diff --exit-code | tee update.diff test-repro: stage: test cache: # This job deletes stuff from the maven repository to make sure the parent is reproducible, don't update the cache policy: pull script: - ./build.sh rules: - if: $CI_PIPELINE_SOURCE != "schedule" # NOTE: This one never fails on updates, that's left for test-libyear test-versions-update: stage: test artifacts: paths: - update.diff script: - ./mvnw versions:update-child-modules versions:update-parent versions:update-properties - git diff | tee update.diff deploy: stage: deploy environment: production script: - ./mvnw -s ci/mvn-settings.xml deploy rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule"