Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Service: Select Git Branch

I started to set up the new Xcode service in Mavericks. I created a new bot - but I wasn't asked for the branch it should build?

How can I select the branch for each bot? I do not only want to build master, but different branches too.

like image 248
fabb Avatar asked Oct 25 '13 08:10

fabb


People also ask

How do I select a branch in Xcode?

By default, Xcode creates a branch named main when you create a new project with a Git repository. Control-click the branch you want to use as your starting point, choose “Branch from [branch name]”, and then enter a name for your branch that identifies the work you're doing.

How do I change branches in Xcode 11?

Branching with Xcode 🙀 You can always navigate here by pressing “command + 2”. First, control + click the branch you want to branch from. Now you will be presented with a window that will allow you to name that branch. The new branch will show up in the folder called Branches.


3 Answers

In the current version, when you create the bot in Xcode, it will be linked to the currently active branch. You can easily verify (but not change) it from the web interface, when you navigate to the bot -> Bot settings (when you click the cog wheel in the upper right).

Alternatively you can create the bot via the web interface where you can specify the branch name plain-text.

like image 194
fabb Avatar answered Oct 18 '22 13:10

fabb


Assuming you want to change it whenever you want and not recreate bots each time, you can use the script: (pre-trigger)

cd "$XCS_SOURCE_DIR/<repo name here>"
git checkout development

Just change it to whatever branch you want and whatever repo you want. (you can look in the pre trigger logs to see if you mess up the change directory, ie if you misspel the repo name or whatever else. Good luck!

like image 30
Jeremie D Avatar answered Oct 18 '22 14:10

Jeremie D


Create a bot for each branch you are interested in testing. You can create as many bots as you want. Each one will check out whatever branch you specify, and run per the schedule you set individually.

like image 30
Eric Avatar answered Oct 18 '22 14:10

Eric