我正在尝试调试GitLab CI管道中的一些问题。我有一个步骤B,它正在使用步骤A中的一些工件。
步骤A很长(并且正在CI中运行),所以我不想在本地运行它:我只是从GitLab下载生成的工件。因此,我有一个artifacts.zip
,我将其提取以获得一个output
和一个logs
目录。到目前为止一切顺利。
我想使用gitlab-runner
在本地运行步骤B。请注意,我使用的是9.5版(https://docs.gitlab.com/runner/install/old.html)。
我正在使用以下命令:
gitlab-runner exec docker step-b
正如我所解释的,step-b
需要来自step-a
的工件。这是我尝试过的:
gitlab-runner exec docker --docker-volumes ~/Downloads/output step-b
在步骤B中执行的脚本之一正在执行类似mv ../output /some/where/else
的操作。但是,此脚本失败并显示以下错误:
mv: cannot stat '../output': No such file or directory
出现此错误后,我有两个问题:
此脚本在哪里执行?在.gitlab-ci.yml
中这样称呼:
./scripts/my_script.sh.
在这种情况下,.
是什么?
--docker-volumes ~/Downloads/output
将目录安装在正确的位置,以便我的脚本可以找到它?编辑
根据要求,以下是步骤A的说明。
script:
- mkdir -p /usr/local/compil_result
- ./scripts/compil.sh
- mv /usr/local/compil_result ./output
artifacts:
paths:
- output
- logs