Xcode Service: Select Git Branch
Asked Answered
M

4

10

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.

Mcelrath answered 25/10, 2013 at 8:59 Comment(1)
This is really frustrating. It's not clear at all which branch it uses by default. I assume master, but how can we find out? Anyhow, I hope the answer isn't, "you can't select a branch--you have to build master". I looked at the scheme XML and there's nothing in there either. I'm going to keep digging, but I'm starting to wonder if it's not part of the first release to allow different branches.Kehoe
M
6

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.

Mcelrath answered 26/10, 2013 at 7:51 Comment(1)
Do you have a link to a reference for this info? Thanks!Kehoe
F
2

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!

Fenske answered 16/2, 2015 at 14:24 Comment(1)
You can do this but it will not actually work as expected: changed in the development branch (as in the example above) will not trigger builds. Instead what you should do it chnge your Xcode project to the branch you want to build in the Bot and then create a new Bot. It is not uncommon to have a master, stable and development bot for the same project.Celebration
S
1

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.

Suburbia answered 25/2, 2016 at 1:30 Comment(0)
T
0

It seems like this is now possible (in Xcode 7.1). However, you only get the option your project actually has more than one branch (makes sense).

Xcode select branch

Topsyturvy answered 12/1, 2016 at 11:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.