Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.5k views
in Technique[技术] by (71.8m points)

docker - GitLab CI: iOS project issue (permission denied)

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

Two questions:

  1. What is wrong with my gitlab-runner (with "shell" registration) since GitLab CI throws the following error:
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. Some people say to use "sudo" for the gitlab-runner registration. But then I would need "docker". But it seems that "docker" can't be used for an iOS project in GitLab (but only "shell" registration). Is this true ? (if no, how does the gitlab-runner registration cmd look like exactly for a docker registration ??). Does "docker" work for an iOS-project at all using GitLab ??

Here is my .gitlab-ci.yml file:

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

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"

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

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

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...

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)...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...