GitLab CI:iOS 项目问题(权限被拒绝) [英] GitLab CI: iOS project issue (permission denied)

查看:20
本文介绍了GitLab CI:iOS 项目问题(权限被拒绝)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为我的 iOS 项目尝试 GitLab CI,我遵循 this, thisthis 教程.

Trying GitLab CI for my iOS project, I follow this, this and this tutorial.

两个问题:

  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. 有人说 gitlab-runner 注册要用sudo".但后来我需要码头工人".但似乎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如下:

I tried to register the gitlab-runner as follows:

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)

The "shell" trial make Gitlab-CI show the above mentioned error (i.e. permission denied)

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

And I also tried to register the gitlab-runner with docker:

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)如更详细的解释 这里...

But the "docker" trial made the GitLab-CI show another error (i.e. [!] You cannot run CocoaPods as root) as explained in more detail here...

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

Any idea on how to make this GitLab-CI for an iOS-project finally work properly at all ?? Thanks for any hint. (after 3 days of trials I am more than desperate for this to work)...

推荐答案

事实证明,我的 GitLab Pipeline 上的权限被拒绝"错误与 GitLab 本身无关 - 而是由于我的 Mac 上的 Ruby 版本不匹配我与 gitlab-runner 建立了联系.

It turned out that the "permission denied" error on my GitLab Pipeline had nothing to do with GitLab itself - but was due to a Ruby version mismatch on my Mac that I connected with the gitlab-runner.

我能够更新我的 Ruby 版本在这篇文章的帮助下(即使用 chruby).关于如何在 Mac 上更新 Ruby,还有其他可能性.重要的是要了解 GitLab 要求您的 Mac 拥有稳定的 Ruby 环境.

I was able to update my Ruby version with the help of this post (i.e. using chruby). There are other possibilities out there on how to update Ruby on your Mac. It is important to understand that GitLab requires your Mac to have a stable Ruby environment.

附带说明:这是我找到的关于如何为 iOS 项目设置 GitLab CI 的最佳教程.

这篇关于GitLab CI:iOS 项目问题(权限被拒绝)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆