【发布时间】:2019-08-19 08:20:12
【问题描述】:
为我的 iOS 项目尝试 GitLab CI,我遵循 this、this 和 this 教程。
两个问题:
- 我的 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
- 有人说使用“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