- The first thing I did was to install Jenkins.
- Once installed I created a folder to do all of the builds in. Note that Jenkins creates a user. I created the folder here: /Users/Shared/Build/.
- Make sure that you give read and write permissions to the jenkins user that was created.
- Now download Team Explorer Everywhere (TEE)
- Copy TEE it to the newly created folder (/Users/Shared/Build/)
- Run the following commands in the command line to accept the eula of tf and allow the build to work:
- sudo su jenkins
- [Enter Current User Password]
- ./tf eula
- On the Jenkins build server, via the web browser, go to Manage Jenkins > Manage Plugins
- Install the Team Foundation Server Plugin (I also upgraded the other plugins while I was there).
- Next go to Manage Jenkins > Configure System
- Go to Team Foundation Server > TF command line executable and put the path in to tf.
- Back on the machine, Install Xcode and Command Line Tools (Xcode > Preferences)
- Install Xamarin Studio
- Activate Xamarin Studio on the Jenkins account
- To do this you will need to:
- Go to System Preferences > Users & Groups > Select the standard user without a name
- (Optional) Give this user a name, I used Jenkins
- Change the password of this user
- Switch to the Jenkins user
- Open any solution in xamarin studio
- Select Project > Profile - Mono (this will cause Xamarin Studio to activate)
Setup a build
- In the Jenkins web interface select New Job.
- Give the job a name
- Select the Build multi-configuration project and click OK
- Scroll down to the Source Code Management section and select Team Foundation Server.
- Setup a Build Trigger for Poll SCM which will only build on check-in. You can use to help to see the format but an example that checks every 10 minutes is: H/10 * * * *
- In the Build section, Add a build step to Execute shell.
- Give in the following command: bash -ex /Users/Shared/Build/Scripts/BuildScript.sh where this is the path to the script and the name of it. There are some scripts in source.
- Save the build
Test the build
- Go to the main page and click the clock with the arrow in the right hand side of the grid out from where the build is.
- You should shortly see the build appear in the left hand side of the page under the menu. Once it appears click on it.
- Click on the Console Output menu item to watch what the build is doing.
- It should make it to the "Triggering" step. In this instance our trigger will be "default". Click on that link.
- Under Build History, in the left hand side click the currently running build, which is also the top build.
- Click on Console output again to see what this step is doing.
- The last line that is output should show SUCCESS.
What to Do if the Build is Failing
- Check the Console Output for the error messages. There were various issues and fixes I ran across trying to get this setup.
- If you're having a source control mapping issue, you might need to remove the workspace mentioned in the error via command line.
- To do this you will need to use tf.
- Navigate to the location of it or simply type in the path. Here's a sample of the command to run: ./tf workspaces -remove:WORKSPACE_NAME
- If you're having other, maybe seemingly random issues, verify that the Jenkins user has access to the folders it's trying to use.
Notes
This is a very simple and straightforward approach to building an application. There is a lot more you can do that I have not mentioned here. This is a basic tutorial to get you started using the build server. I strongly recommend setting up CI as it will help in many ways.Instructions are loosely based off on an MSDN article.