3

I am new to Bluemix.

I have a pre-existing React Native project in a git repo also containing transpiled code for ios and android. I would like to pull that git repo into Bluemix and when changes are detected, simply build both the android .apk and ios .ipa file.

Does Bluemix provide a native way to do this? I've seen some documentation on MobileFoundation and MobileFirst Platform which seems promising and it also seems possible with a lot of surgery to do this in a ToolChain/Delivery Pipeline/Build Script(going down this route in the code below).

Are we going in the right direction? Appreciate any insight. Especially step-by-step guidance. I was unable to find any posts or articles in Bluemix that talk about this.

#!/bin/bash

# binplace android sdk
wget http://dl.google.com/android/android-sdk_r23-linux.tgz
tar -xzf android-sdk_r23-linux.tgz -C /home/pipeline

# set ANDROID_HOME
# ANDROID_HOME doesn't get recognized downstream......
echo 'export ANDROID_HOME=/home/pipeline/android-sdk-linux' >>~/.profile
echo 'export PATH=$PATH:$ANDROID_HOME/tools' >>~/.profile
echo 'export PATH=$PATH:$ANDROID_HOME/platform-tools' >>~/.profile

# install android sdk
# filtering to be added to reduce lengthy install time
/home/pipeline/android-sdk-linux/tools/android update sdk --no-ui

UPDATE We are still wading through a lot of misaligned Bluemix documentation referencing old or non-existent Bluemix UI, broken article links, etc. Posting a bounty for anyone with exact steps how to get this done(preferably using the newer Bluemix UI, not hub.jazz.net). The best article we've found so far which seems to go down somewhat a correct path is posted below.

https://mobilefirstplatform.ibmcloud.com/blog/2016/08/25/mobilefirst-devops-in-bluemix/

joe
  • 2,468
  • 2
  • 12
  • 19
Captain Kirk
  • 350
  • 6
  • 24
  • can you give me a pointer to the Bluemix page that told you to add the DevOps tag? That is down-level guidance. Somebody on the Bluemix Mobile Services team has responded to your question. – ralphearle Jan 17 '17 at 18:04
  • Hi Ralph. Let me try to find all of them. This was one of them. https://developer.ibm.com/devops-services/support/ – Captain Kirk Jan 17 '17 at 18:57

1 Answers1

0

Above it looks like you are going in the right direction.

Jobs run in discrete working directories within Docker containers that are created for each pipeline run. Before a job is run, its working directory is populated with input that is defined at the stage level. For example, you might have a stage that contains a test job and a deploy job. If you install dependencies on one job, they are not available to the other job. However, if you make the dependencies available in the stage's input, they are available to both jobs.

https://hub.jazz.net/docs/deploy/#jobs


Using a script, you can build the Android apk file (looks like you're on the right path above). For building iOS apps, you need to use a Mac, so you would probably need to ssh into a Mac (and scp the code over) to trigger that build.

From there, you could send the ipa/apk files to the Bluemix service Testdroid Cloud which could automate testing for you.

So here's a flowchart for each platform:

Android:

  1. Trigger on git commit
  2. Clone the source code
  3. Download Android and build apk
  4. (Optional) Deploy apk for testing

iOS:

  1. Trigger on git commit
  2. Clone the source code
  3. scp code to Mac
  4. Build ipa on Mac
  5. scp ipa back
  6. (Optional) Deploy ipa for testing

^ You have many different options here (you could just clone and deploy from the Mac without the scp), but I hope this gives you an idea on your options.

Let me know if this helps, or if you have any follow up questions.

joe
  • 2,468
  • 2
  • 12
  • 19
  • Hi Joe. Greatly appreciate the assistance. Can you clarify a few things for me. Android sounds pretty easy if we can do all of this in a build script especially. iOS is my bigger concern. Can you tell me how to execute the steps you outlined within Bluemix. Provisioning a Mac, using tools like scp in Bluemix, remote building the ipa, etc. If Bluemix has documentation on this I would really appreciate that too. – Captain Kirk Jan 17 '17 at 18:44
  • Looking at the docs, I could not find a way in Bluemix to spin up a Mac image, so you would probably have to set up your own device. So you would set up your device to allow ssh/scp for remote connections by following a guide online. You should just be able to perform an ssh from the DevOps VM to the Mac you set up. Subsequently you can follow a blog like this (http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/) to package the ipa file. Then you could scp which is just copying over an ssh connection (e.g. Downloading a file: `scp 10.0.0.1:/path/file.txt /local/folder`). – joe Jan 17 '17 at 19:37
  • Thanks Joe. Everything makes perfect sense. One of our requirements is to build the iOS code to an .ipa in the cloud using only cloud assets. If there is any way to achieve that please let us know. If not possible, will it be possible in the future? – Captain Kirk Jan 17 '17 at 20:06
  • There are Cloud services that allow you to spin up a Mac image (just search "Mac OS hosting") which you could do. As far as Bluemix is concerned, I don't believe that it's possible to make a Mac image at this time, but it would be an excellent feature request. You can enter that in here and someone will review it: https://ibmcloud.ideas.aha.io/ideas – joe Jan 17 '17 at 20:22
  • 2
    Done. Appreciate all of your help and assisting us in evaluating our position. https://ibmcloud.ideas.aha.io/ideas/IDEA-I-2265 – Captain Kirk Jan 17 '17 at 20:53