patternMinor
Multiple paths with different expiry time in gitlab-ci runners
Viewed 0 times
runnerswithgitlabexpirypathstimedifferentmultiple
Problem
I'm having issues with parsing a
Gitlab-CI wipes the created build artifacts between stages which seems weird. I'm trying to store the build artifacts between the build and the test stage, however the build stage also has the build artifact which I want to keep and also the build artifacts which are required to run the next stage.
Is it possible to have multiple expiry times with different paths using the
I have tried the following, which only keeps the second definition of
I have tried using the
build directory between stages using Gitlab-CI. Gitlab-CI wipes the created build artifacts between stages which seems weird. I'm trying to store the build artifacts between the build and the test stage, however the build stage also has the build artifact which I want to keep and also the build artifacts which are required to run the next stage.
Is it possible to have multiple expiry times with different paths using the
artifacts option? I have tried the following, which only keeps the second definition of
paths (the build/test* paths), and not the first paths (.dmg) declared.artifacts:
paths:
- build/*.dmg
expire_in: 1 week
paths:
- build/test1
- build/test2
- build/test3
expire_in: 15 minsI have tried using the
caches however can't seem to get that working... Any suggestions would be great appreciated!Solution
This has been answered over on SO using a work around seeing as it doesn't seem possible according to the documents.
Basically, this can be done in 3 stages.
Stage 1: Build and store all artifacts.
Stage 2.1: Do the next official stage of the job (ie run tests in my scenario) using the artifacts
Stage 2.2: Running concurrently with Stage 2.1 you can just have an empty job but sets a new artifact expiry date.
Basically, this can be done in 3 stages.
Stage 1: Build and store all artifacts.
build_stage:
script:
- build
artifacts:
paths:
- build/*.dmg
- build/test1
- build/test2
- build/test3
expire_in: 15 minsStage 2.1: Do the next official stage of the job (ie run tests in my scenario) using the artifacts
build/test1, build/test2 and build/test3.test_stage:
script:
- test
dependencies:
- buildStage 2.2: Running concurrently with Stage 2.1 you can just have an empty job but sets a new artifact expiry date.
overwrite_artifact_stage:
script:
- echo 'saving artifact'
artifacts:
paths:
- build/*.dmg
expire_in: 1 weekCode Snippets
build_stage:
script:
- build
artifacts:
paths:
- build/*.dmg
- build/test1
- build/test2
- build/test3
expire_in: 15 minstest_stage:
script:
- test
dependencies:
- buildoverwrite_artifact_stage:
script:
- echo 'saving artifact'
artifacts:
paths:
- build/*.dmg
expire_in: 1 weekContext
StackExchange DevOps Q#2019, answer score: 5
Revisions (0)
No revisions yet.