I used Jenkins with some Xcode plugins as our iOS CI half a year ago.
The main function I want is to build our project daily in the middle night, and +1 on the build number, then push this commit to Phabricator, if any of these steps is fail, it will post a notification to Slack.
But after we are try to using Carthage instead of CocoaPod, it need to Carthage update before building. The Jenkins can’t run commands before building. So I tried using shell directly.
update code
First it should cd into the project’s folder, then checkout new commits and update new frameworks
1 2 3 4 5
cd $(dirname $0) git checkout master git reset --hard origin/master
/usr/local/bin/carthage update
then check that whether the last author is a coworker or the bot itself