Answer the question
In order to leave comments, you need to log in
Gitlab CI/CD artifacts. How to get the contents of a subdirectory by relative path?
There is a project in Gitlab. (Tab stops are not displayed here, I apologize for the crookedly written question)
Structure:
root
/folder1/
/folder2/
/desc.txt
In CI/CD I want to export.zip the contents of the root directory without including it in the archive.
A piece of .gitlab-ci.yml
package:
artifacts:
name: 'export'
paths: 'root/'
But the entire structure is put into the archive, starting with root. How to exclude it, help pliz.
Answer the question
In order to leave comments, you need to log in
Try to pack the contents yourself as you need a separate command in the pipeline, and then add it to the artifact.
In the script of the required step, add to the end:
zip -r archive.zip root/*
Specify the generated archive as an artifact:
artifacts: archive.zip
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question