Coder Social home page Coder Social logo

jubbasmail / mac-osx-service-bamboo-6.1-agent Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 394 KB

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

Shell 5.88% C 94.12%
bamboo-agent mac-osx bash continuous-integration

mac-osx-service-bamboo-6.1-agent's Introduction

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

mac-osx-service-bamboo-6.1-agent's People

Contributors

jubbasmail avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cacahuates11111

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.