【问题标题】:GitLab CI: iOS project issue (permission denied)GitLab CI:iOS 项目问题(权限被拒绝)
【发布时间】:2019-08-19 08:20:12
【问题描述】:

为我的 iOS 项目尝试 GitLab CI,我遵循 this、this 和 this 教程。

两个问题:

  1. 我的 gitlab-runner(使用“shell”注册)出了什么问题,因为 GitLab CI 抛出以下错误:
Running with gitlab-runner 11.9.0 (692ae235)
  on MyApp runner with shell DsaBC-oQ
Using Shell executor...
Running on MyComputer.network.provider...
mkdir: /Users/myusername/builds/DsaBC-oQ/0/username/myproj.tmp: Permission denied
mkdir: /Users/myusername/builds/DsaBC-oQ/0/username/myproj.tmp: Permission denied
ERROR: Job failed: exit status 1
  1. 有人说使用“sudo”来注册gitlab-runner。但后来我需要“码头工人”。但似乎“docker”不能用于 GitLab 中的 iOS 项目(但只能用于“shell”注册)。这是真的 ? (如果没有,gitlab-runner 注册 cmd 看起来如何与 docker 注册完全一样??)。 “docker”是否适用于使用 GitLab 的 iOS 项目?

这是我的.gitlab-ci.yml 文件:

stages:
  - unit_tests

variables:
  LC_ALL: "en_US.UTF-8"
  LANG: "en_US.UTF-8"

before_script:
  - gem install bundler
  - bundle install

unit_tests:
  dependencies: []
  stage: unit_tests
  artifacts:
    paths:
      - fastlane/screenshots
      - fastlane/logs
  script:
    - bundle exec fastlane tests
  tags:
    - ios

我尝试注册gitlab-runner如下:

gitlab-runner register \
  --non-interactive \
  --url "https://gitlab.com/" \
  --registration-token "TOKENABCDEF" \
  --description "MyApp runner with shell" \
  --tag-list ios \
  --executor "shell"

“shell”试验使 Gitlab-CI 显示上述错误(即permission denied)

我还尝试用 docker 注册 gitlab-runner:

gitlab-runner register \
  --non-interactive \
  --url "https://gitlab.com/" \
  --registration-token "TOKENABCEDF" \
  --description "MyApp runner with docker and ruby-2.6” \
  --tag-list ios \
  --executor "docker" \
  --docker-image ruby:2.6

但“docker”试验使 GitLab-CI 显示另一个错误(即[!] You cannot run CocoaPods as root),如更详细的解释here...

关于如何使 iOS 项目的 GitLab-CI 最终正常工作的任何想法?感谢您的任何提示。 (经过 3 天的试验,我非常希望它能够正常工作)......

【问题讨论】:

    标签: docker continuous-integration realm gitlab cocoapods


    【解决方案1】:

    事实证明,我的 GitLab 管道上的“权限被拒绝”错误与 GitLab 本身无关 - 而是由于我与 gitlab-runner 连接的 Mac 上的 Ruby 版本不匹配。

    我能够更新我的 Ruby 版本 with the help of this post(即使用 chruby)。关于如何在 Mac 上更新 Ruby,还有其他可能性。重要的是要了解 GitLab 要求您的 Mac 拥有稳定的 Ruby 环境。

    附带说明:Here is the best tutorial on how to set up GitLab CI for an iOS-project 我找到了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-28
      • 2015-05-24
      • 2021-08-30
      • 2019-03-08
      • 1970-01-01
      • 1970-01-01
      • 2011-07-11
      • 2011-03-09
      相关资源
      最近更新 更多