为我的iOS项目尝试GitLab CI,我遵循this,this和this教程。
两个问题:
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
这是我的.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...
关于如何使此GitLab-CI用于iOS项目的任何想法最终都可以正常使用??感谢您的任何提示。 (经过3天的试用,我非常渴望这样做)...
答案 0 :(得分:0)
事实证明,我的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。