Reputation: 414
My .gitlab-ci.yml file has the following cache and stages defined
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .m2/repository/
- target/
policy: pull-push
stages:
- build
- nexus
- deploy-test
- deploy-prod
The 'build' includes....
script:
- 'mvn $MAVEN_CLI_OPTS clean -U compile -T 6 process-classes -DjspcGoal=compile'
artifacts:
expire_in: 3 days
paths:
and nexus as...
script:
- 'mvn $MAVEN_CLI_OPTS -DskipTests deploy'
artifacts:
expire_in: 3 days
paths:
- target/*
dependencies:
- build
needs:
- job: build
artifacts: true
and deploy-test stage as...
script:
- 'mvn $MAVEN_CLI_OPTS -DskipTests cargo:redeploy -Dcontext=${contextAndVersion} -Dtarget=staging.www
artifacts:
expire_in: 3 days
paths:
- target/*
dependencies:
- nexus
needs:
- job: nexus
artifacts: true
...and a similar stage for deploy-prod (for cargo-deploy to production servers)
I'm seeing three issues which seem to be very inefficient and unnecessary:
I'd like the deploy-test and deploy-prod stages to just retrieve the WAR file, either from the minio cache or Nexus rather than needing to download and unzip the whole target folder. I'm hoping I'm missing something simple in the Gitlab yml file (?)
Upvotes: 2
Views: 472