Search code examples
iosreact-nativejenkinscarthage

How to set up Jenkins to build React Native iOS app, that uses Carthage?


I am setting Jenkins (on Mac) to build React Native mobile app. For iOS it uses Carthage (I have few experience with it). Carthage is installed on my machine, and I can build app from terminal with "yarn build:ios:e2e" command. But while running job on Jenkins I see that Carthage in not visible to Jenkins. I checked it by running "carthage version" command in "execute shell" section: it returns "carthage: command not found". So question is how to make Jenkins use installed Carthage?

PS. Jenkins already can get code from my GitLab server and build Android with "yarn build:android:e2e"

Jenkins is installed to my MacOS machine, with Android studio, XCode. yarn is included to Jenkins as NodeJS installation with package "yarn", there is env. varianble to Android SDK. Jenkins can start building app (so, XCODE can be used by Jenkins), but there is some error while compiling (this not happens when I run build from terminal on my machine).

Log from Jenkins job: + carthage version /Users/Shared/Jenkins/tmp/jenkins8157594811837633611.sh: line 2: carthage: command not found


Solution

  • To make carthage available to Jenkins, go to Manage Jenkins - Configure System Then add environment variable: name = PATH value = $PATH:/usr/local/bin/ "/usr/local/bin/" - here carthage alias placed