Skip to content

Commit

Permalink
gitlab-ci: use maven artefacts cache only for build stages
Browse files Browse the repository at this point in the history
  • Loading branch information
kofemann committed May 19, 2022
1 parent a180684 commit c7e1f82
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ variables:
MAVEN_CLI_OPTS: "--batch-mode --errors --no-transfer-progress --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true -Dmaven.repo.local=.m2/repository"
REPO_NAME: dcache-cta

# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
key:
files:
- pom.xml
prefix: "$CI_JOB_NAME"
paths:
- ./.m2/repository

build:
stage: build
image: maven:3.6.3-openjdk-11
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
key:
files:
- pom.xml
prefix: "$CI_JOB_NAME"
paths:
- ./.m2/repository
script:
- mvn $MAVEN_CLI_OPTS clean package
artifacts:
Expand All @@ -36,6 +36,15 @@ build:
build_java_next:
stage: build
image: maven:3.8.4-openjdk-17
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
key:
files:
- pom.xml
prefix: "$CI_JOB_NAME"
paths:
- ./.m2/repository
script:
- mvn $MAVEN_CLI_OPTS clean package
artifacts:
Expand Down

0 comments on commit c7e1f82

Please sign in to comment.