This is my script when this script is triggered in bitbucket-pipeline.yml i received error that you cannot run pod as root user
basically -pod install command does not work
this is my gem file in xcode project for iOS
GemFile
source "https://rubygems.org"
gem 'fastlane'
gem 'fastlane-plugin-versioning'
gem "cocoapods", "1.12.1"
gem "xcode-install"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
Bitbucket pipline error screen shot
bitbucket-pipeline.yml
image: ruby:2.6
pipelines:
custom:
Staging_Build:
- step:
name: Build and Test
script:
- bundle install
- pod install
Hi Sami and welcome to the community!
The error in the output of the command says that you cannot run CocoaPods as root.
Just to give you some context, Bitbucket Pipelines builds run in Docker containers. For every step of the pipeline, a Docker container starts (the build container) using the image you have specified in your bitbucket-pipelines.yml file. The repo is cloned in that container and then the commands of that step's script are executed. When the step is finished, the container gets destroyed.
The default user in many containers is root. I see in the screenshot you posted that the option --allow-root is available for the pod install command. One option would be to try running the command with --allow-root.
Alternatively, you can run a Pipelines step as a different user by specifying the run-as-user option:
As mentioned in the documentation, the specified user UID needs to be a user already defined in the Docker image (in your case the DockerHub image ruby:2.6) and should have a valid home directory.
If you have Docker installed on your computer, you can start locally a Docker container based on ruby:2.6 with the command
docker run -it --entrypoint=/bin/bash ruby:2.6
Inside the container, you can run the command cat /etc/passwd to see the image's users and their UID.
You can then run this specific Pipelines step as a different user.
Please feel free to reach out if you have any questions!
Kind regards,
Theodora
i also got an email that we cannot generate iOS build in Bitbucket cloud we can use self hosted agent for releasing build only
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sami,
Pipelines builds run on a Kubernetes cluster of Linux Docker hosts. If your build needs to run on MacOS hardware, then, yes, you can use a MacOS self-hosted runner.
This is the documentation for runners:
And the page for MacOS Runners:
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.