services:
- docker:20.10.16-dind
build:
image:
name: {url to ecr image}
script:
- source ./build.sh
- |
mkdir -p /tmp/airport/
docker cp airport:/artifacts /tmp/airport/
ls /tmp/airport/
artifacts:
when: always
reports:
junit: /tmp/airport/artifacts/nosetests.xml
tags:
- airportwait
我正在处理这个gitlab-ci.yml文件,它在我们自己的EC2 Gitlab运行程序上运行。它正在使用DinD。
./build.sh
做了很多工作,包括
dc run --name "airport" airport \
/bin/bash -xc "
mkdir -p /artifacts && \
py.test --junitxml=/artifacts/nosetests.xml \
--cov=$project \
--cov-report=html:/artifacts/coverage \
/code/airport/tests"
构建脚本步骤下的ls /tmp/airport/
输出显示了预期的结果文件和覆盖目录。
coverage
nosetests.xml
但是,工件步骤失败:
上传文物..。警告: /tmp/aviation/artifacts/nosetests.xml:没有匹配的文件。确保工件路径相对于工作目录错误:没有要上载
的文件
发布于 2022-07-25 12:52:40
您为工件指定的路径(/tmp/机场/构件/nosetests.xml)不在源签出目录中,因此无效。请注意错误消息:
确保工件路径相对于工作目录
生成工件文件后,可以将该文件复制到源签出目录中的某个位置,例如:
cp /tmp/airport/artifacts/nosetests.xml $CI_PROJECT_DIR/artifacts/nosetests.xml
然后将GitLab工件重新配置到新位置:
artifacts:
when: always
reports:
junit: artifacts/nosetests.xml
https://stackoverflow.com/questions/73108594
复制相似问题