gitlab-ci - 禁止从协调器下载工件
问题描述
我正在使用 gitlabci 构建一个 jar 应用程序,构建完成后,该 jar 被发送到带有工件的下一个任务。
Mavenbuild:artifact:
stage: mavenbuild
image:
name: maven:3.6.0-jdk-8
tags:
- docker
script:
- mvn clean install -pl batch-o365 -am -q
artifacts:
paths:
- batch-o365/app
Dockerbuild:ok:
stage: dockerbuild
image:
name: ekino/docker-buildbox:latest-dind-aws
dependencies:
- Mavenbuild:artifact
tags:
- docker
script:
- docker build .
工件很好上传:
Uploading artifacts...
batch-o365/app: found 3 matching files
Uploading artifacts to coordinator... ok id=11969 responseStatus=201 Created token=xxx
但是当我在下一个任务中绑定它时,我遇到了这个错误:
Downloading artifacts for Mavenbuild:artifact (11969)...
ERROR: Downloading artifacts from coordinator... forbidden id=11969 responseStatus=403 Forbidden status=403 Forbidden token=xxx
FATAL: permission denied
ERROR: Job failed: exit code 1
我已经在这个 gitlab 服务器的另一个项目上使用了工件,并且运行良好。
这里有人已经对工件有这个问题了吗?
解决方案
我找到了解决方案。
我们正在使用内部代理,我忘记排除 gitlab URL。
通过此修改:
Dockerbuild:ok:
stage: dockerbuild
image:
name: ekino/docker-buildbox:latest-dind-aws
variables:
HTTP_PROXY: http://proxy:8000
HTTPS_PROXY: http://proxy:8000
NO_PROXY: 169.254.169.254,gitlab.xxx.com
工件很好地被工作回收。
Downloading artifacts for Mavenbuild:artifact (11989)...
Downloading artifacts from coordinator... ok id=11989 responseStatus=200 OK token=--xxx
推荐阅读
- android - 有没有办法在公开测试中展示真实的广告
- android - 动画 LazyColumn 项目组合
- oracle - 如何在 Oracle 假期前获得最后一个工作日
- blazor - Blazor 的 Telerik UI:在代码中将项目添加到网格
- liferay - 如何在 Liferay 中的站点之间共享母版页?
- stored-procedures - 我可以在雪花存储过程中运行外部文件吗?
- c++ - C++ 动态数组没有请求大小
- python - 类中两个属性之间的差异
- git - 将 react 依赖推送到 github 项目中共享
- javascript - 部署 next.js 应用程序时静态页面上的预渲染错误