我的 GitLab CI 管道遇到问题,其中隐藏文件(以点开头的文件和目录,例如
.nvmrc
、.release-template.yml
等)在提取工件后不会显示在输出中。
这是我的
.gitlab-ci.yml
文件的概述:
stages:
- download
- validate
zip:
stage: download
script:
- curl -L -H "Content-Type: application/json" --request GET "https://gitlab.com/api/v4/projects/6585/repository/archive?sha=62eb5672cbe3c880e8a0d711a9dd276eabd3eae9" --header "PRIVATE-TOKEN: hstb1863823" > output.zip
artifacts:
paths:
- output.zip
validate:terraform:
stage: validate
script:
- unzip -o output.zip
- ls -a
- mv -v terraform-release-template-*/* . ## this does not move files start dot(.)
- ls
dependencies:
- zip
尽管使用
ls -a
命令列出所有文件(包括隐藏文件),但隐藏文件不会显示在输出中。我可以确认这些文件存在于提取的目录中。
具体问题:
mv
命令似乎排除隐藏文件移动到根目录。问题:
任何有关解决此问题的见解或建议将不胜感激。谢谢!
我想这与
artifacts:untracked
有关,因为它忽略了存储库的.gitignore文件中的配置。
如果
untracked: false
,工件将包含所有文件,即使被 .gitignore
忽略。或者换句话说,它将忽略 .gitignore
。