I've been trying to make a GitLab CI/CD pipeline for deploying my MEAN application. I have three stages: 1. test 2. build 3. deploy
The build stage has a build_angular job which generates an artifact. Now I want to use this artifacts in the next stage i.e deploy. The deploy job tells me that it has downloaded the artifact(image has been attached), but now I want to extract this artifact, but I don't know where the artifact is being downloaded.
The path where the artifact is being downloaded is not mentioned anywhere in the docs.
GitLab is cleaning the working directory between two subsequent jobs. That's why you have to use artifacts
and dependencies
to pass files between jobs.
When the "deploy" job says that the build artifact have been downloaded, it simply means that they have been recreated as they were before. The location of the downloaded artifacts matches the location of the artifact paths (as declared in the .yml file).
build_job:
stage: build
script:
- echo "create bin/ directory"
- make
artifacts:
paths:
- bin/
deploy_job:
stage: deploy
script:
- ls bin/
dependencies:
- build_job
Directory bin/
is passed to deploy_job
from build_job
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With