【问题标题】:Gitlab Runner 403 forbidden error on Nuget PushNuget Push上的Gitlab Runner 403禁止错误
【发布时间】:2018-10-11 07:49:19
【问题描述】:

我正在尝试准备一个 CI 管道,它将在每次提交时打包并将 .dll 推送到我的自定义 nuget 服务器。

.gitlab-ci.yml:

image: microsoft/dotnet:latest

stages:
  - build
  - pack
  - push
variables:
  project: "GitlabCITest"

before_script:
  - "dotnet restore"
  - "ls -al /builds/test/gitlabcitest/GitlabCITest/nuget.exe"

build:
  stage: build
  variables:
    build_path: "./"
  script:
    - "dotnet build"

pack:
  stage: pack
  script:

    - "cd GitlabCITest"
    - "mkdir tesdosyası"
    - "dotnet pack GitlabCITest.csproj"
    - "ls -al /builds/test/gitlabcitest/GitlabCITest/bin/Debug"
    - "dotnet nuget push --force-english-output /builds/test/gitlabcitest/GitlabCITest/bin/Debug/*.nupkg -s MyCustomNugetServerAddress -k MyApiKey"

当它运行时,我在推送作业中收到 403 禁止错误。

错误日志:

$ ls -al /builds/test/gitlabcitest/GitlabCITest/bin/Debug
total 32
drwxr-xr-x. 3 root root 4096 Oct 11 06:57 .
drwxr-xr-x. 3 root root 4096 Oct 11 06:57 ..
-rw-r--r--. 1 root root 3929 Oct 11 06:57 GitlabCITest.1.0.0.nupkg
drwxr-xr-x. 2 root root 4096 Oct 11 06:57 netcoreapp2.1
$ dotnet nuget push --force-english-output /builds/test/gitlabcitest/GitlabCITest/bin/Debug/*.nupkg -s MyCustomNugetServerAddress -k MyApiKey
info : Pushing GitlabCITest.1.0.0.nupkg to 'MyCustomNugetServerAddress'...
info :   PUT MyCustomNugetServerAddress
info :   Forbidden MyCustomNugetServerAddress 651ms
error: Response status code does not indicate success: 403 (Forbidden).

【问题讨论】:

    标签: continuous-integration gitlab gitlab-ci gitlab-ci-runner


    【解决方案1】:

    都是关于密码字符的,我有一个';'在我的 apikey 中,所以它很复杂。如果您的 apikey 中有特殊字符,只需在 apikey 的开头和结尾添加 ' 字符。 'apikey'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-25
      • 1970-01-01
      • 2023-03-21
      • 1970-01-01
      • 2016-12-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多