Gitlab CI Artifacts永久移动错误301?

时间:2017-04-06 18:07:11

标签: java maven docker gitlab gitlab-ci

我刚刚设置了Gitlab Ci,使用带有Maven 3和Java 8的Docker容器来构建我的项目。然而,当我尝试将生成的jar文件保存为工件时,构建成功完成,Docker在找到jar文件后直接告诉我工件已被永久移动....

这个让我挠头。

这是我的Giitlab CI yml文件:

image: kaiwinter/docker-java8-maven

before_script:
    - apt-get update --fix-missing
    - apt-get install -y git
    - git clone -v https://github.com/stefaneidelloth/javafx-d3.git    /builds/external/javafxd3
    - cd /builds/external/javafxd3/javafx-d3
    - mvn install
    - cd /builds/external/myDemo


build:
 script: "mvn -B install"
 tags:
  - java8
  - maven3
 artifacts:
   paths:
    - target/*.jar

这是来自Job的控制台的最后几行。

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.547 s
[INFO] Finished at: 2017-04-06T17:58:06+00:00
[INFO] Final Memory: 34M/462M
[INFO] ------------------------------------------------------------------------
Uploading artifacts...
target/*.jar: found 1 matching files               
WARNING: Uploading artifacts to coordinator... failed  id=105 responseStatus=301 Moved Permanently status=301 Moved Permanently token=4pf6n8aT
WARNING: Retrying...                               
WARNING: Uploading artifacts to coordinator... failed  id=105 responseStatus=301 Moved Permanently status=301 Moved Permanently token=4pf6n8aT
WARNING: Retrying...                               
WARNING: Uploading artifacts to coordinator... failed  id=105 responseStatus=301 Moved Permanently status=301 Moved Permanently token=4pf6n8aT
FATAL: invalid argument                            
Job succeeded

1 个答案:

答案 0 :(得分:0)

我能够解决这个问题。显然,docker容器虽然可以ping gitlab主机,但无法解析运行器中指定的工件上传器域名。我将/etc/gitlab-runner/config.toml中的runner配置更改为主机的IP,并且复制的工件很好。