Skip to content

Run Bamboo 6.1 Agent on Mac OS X as a background service to build iOS IPA and Android APK

Notifications You must be signed in to change notification settings

JubbaSmail/mac-osx-service-bamboo-6.1-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

mac-osx-service-bamboo-6.1-agent

Run Bamboo 6.1 Agent on Mac OS X as a background service to build iOS IPA and Android APK

Before you start, prepare your Mac:

Bamboo Agent require Java 8 or later, follow the steps:

  1. Install Brew

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install Java 8:

     brew update
     brew tap caskroom/versions
     brew cask install java8
  3. Bamboo Agent will use the hostname as it's name to be displayed in Bamboo Server Agent Mangment insterface, to edit the hostname on you machine do the following:

    • Apple -> System Prefrence -> Sharing -> Computer Name
    • Set a uniqe name in your network, to make it easier to trak the agents later.
    • Then execute the folllowing commands to edit the hostname:
    scutil --set HostName new_hostname
  4. If you need the agent to be always ready to build then you need to set you machine to never to sleep:

    • Apple -> System Prefrence -> Energy Server -> Computer Sleep : Never

Are your Bamboo Server ready to recive connections ?

  1. Go to your Bamboo server settings -> System -> General Configureation: Make sure Broker client URL is not pointing to localhost, it shoud point to your server ip or hostname
  2. Make sure the ports 54663m, 443 and 80 in your Bamboo server are open, try to telnet it from the agent host:
    telnet BAMBOO-SERVER-IP 54663
    telnet BAMBOO-SERVER-IP 443
    telnet BAMBOO-SERVER-IP 80
  3. If you would like to forse agent to use authentication token: Go to your Bamboo server settings -> Agents, click on Enable Authentication Token, then click on Install Remote Agent, copy the token after -t from the command

Download the Mac App

The app size on Github is larger than 100 MB, you need to use git lfs to clone it to your machine:

brew install git-lfs
git lfs install
git lfs clone https://github.com/Ismail-AlJubbah/mac-osx-service-bamboo-6.1-agent.git

Configure the Agent to connect to Bamboo Server

The App contains a configuration file to save Bamboo Server URL and tocken

cd mac-osx-service-bamboo-6.1-agent
vi BambooAgent.app/Contents/Resources/BambooAgent.conf

now edit the value of the variables bamboo_url and bamboo_token to work with your Bamboo Server

To Build iOS App

On the Mac OSX which will host the agent, do the following:

  1. Install or Update Xcode from App Store or from Apple Developer Page here
  2. For each new build plan, install Apple development and release private keys on the Keychain manaully.
  3. For each new build plan, copy *.mobileprovision to "~/Library/MobileDevice/Provisioning\ Profiles/", if you keep the provisioning profiles in your GIT repo then you can do this step automatically by adding Command Task in the build plan in Bamboo Server.

To Build Android App

On the Mac OSX which will host the agent, do the following:

  1. Install Android SDK:
    brew tap caskroom/cask
    brew cask install android-sdk
    echo "export ANDROID_HOME=/usr/local/share/android-sdk" >> ~/.bash_profile
    echo "export PATH=$ANDROID_HOME/platform-tools:$PATH" >> ~/.bash_profile
    echo "export PATH=$ANDROID_HOME/tools:$PATH" >> ~/.bash_profile 

Install BambooAgent.app

Using Finder, go the repo folder, double click on BambooAgent, this will copy the App to your Application folder and set it to run automatically on login

Running

  1. Go to LaunchPad and run BambooAgent
  2. After running the agent go to your Bamboo server settings -> Agents -> Agent authentication: and aprrove the agent request.
  3. Go to your Bamboo server settings -> Agents -> Online Remote Agent: and wait unit the agent register it self to the server, it may take 2 mins (you may need to refresh the page manually).

Configure Build Plan for Android APK:

  1. Go to Configure Plan in your plan settings, in Task, click Add task, select Command, and enter the following values:
    • Task description: Build APK
    • Executable: gradelw
    • Argument to build a relase APK: clean assembleRelease
    • Environment variables: ANDROID_HOME="/usr/local/share/android-sdk"

Configure Build Plan for iOS IPA:

  1. Go to Configure Plan in your plan settings, in Task, click Add task, select XCode, and enter the following values:
    • Task description: Build IPA
    • Apple SDK: iOS 10.3, run the command xcodebuild -showsdks to get the SDK name in your machine.
    • Make sure to enter the values of: Workspace and Scheme.
    • Check Build an .ipa for iOS Application Distribution, and fill the values: iOS application path, Development Team and Distribution Method: Application Store.

Debuging

Run the following commmand to check the agent logs:

tail -f ~/bamboo-agent-home/BambooAgent.log

Links

More information can be found on the following links:

  1. Run Bamboo Agent as docker to build Android APK

About

Run Bamboo 6.1 Agent on Mac OS X as a background service to build iOS IPA and Android APK

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published