【问题标题】:Gitlab CI Artifacts Permanently Moved Error 301?Gitlab CI工件永久移动错误301?
【发布时间】:2017-09-01 22:16:43
【问题描述】:

我刚刚完成了 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

【问题讨论】:

    标签: java maven docker gitlab gitlab-ci


    【解决方案1】:

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-10-27
    • 2019-11-04
    • 2012-07-10
    • 1970-01-01
    • 2013-09-26
    • 2019-10-14
    • 2018-06-18
    • 2018-06-23
    相关资源
    最近更新 更多