iOS - Continuous Integration with Fastlane / Bamboo - ios

We have an On-Premise Bamboo Server hosted on RHEL & we want to Integrate FastLane to automate our Mobile App CI/CD process.
We have a Mac laptop which is used for iOS build but the plan is to automate the process.
Can someone give any pointers to integrate the FastLane with the on-prem Bamboo CI server.

Initial Setup
Setup a Bamboo Remote Agent on your Mac Laptop where you want to automate the process. In order to do so you'll need to be on a license tier that supports the remote agent. Atlassian has step-by-step instructions for setting up the agent on your Mac.
Ensure that the latest XCode is installed.
Follow the instructions to setup Fastlane on your Mac. Even though Bamboo has the task step built-in, you will still need to configure the capability on the Mac. Failure to do so will result in your RHEL server thinking it can do the iOS builds. You should see in the job configuration and requirements page that only the Mac can execute this build job.
Configuring Fastlane
Follow the Fastlane guide for integrating with Bamboo.
Look into setting up Match so that you do not run into as many provisioning profile signing issues with Fastlane. This will also allow anyone on the team to continue to build.
Pitfalls
iOS Provisioning Profile errors are fairly common when setting up this process.
Permission issues often cause errors. The Bamboo logs should tell you what the problem is.

Related

How do I integrate IBM Integration Bus v9.0.0.8 with Bamboo and BitBucket for CI

Our Enterprise Service Broker team is currently considering moving to the Atlasian Stack as this is a company wide standard and will assist with our Continuous Integration (CI) and continuous Development (CD).
We would like to automate our builds as well as deployments and use Bamboo (Bamboo Agent) to create our artifacts and execute our scrips that we have chosen to write in ANT.
We are currently using Rational Team Concert (RTC - Version control tool) and would like to port to BitBucket so that we can use Bamboo. Is there someone that can guide us in this process, what are the steps we need to take.
I have searched the IBM documentation and they only support bamboo on version 10.2.1410 of the IBM development toolkit which we are not yet making use of as we will not be able to upgrade yet.
Ref: https://docops.ca.com/ca-release-automation/integrations/en/optional-action-packs/ibm-integration-bus-advanced
Are there any best-practices for doing so? Tutorials maybe?
You can connect an RTC to a Git repository. The documentation currently states that it support GitLab and GitHub Enterprise, but nothing about BitBucket.Take a look at this part of the documentation. I think however, you could connect to BitBucket, but jsut treat it like a GitLab repo.
https://www.ibm.com/support/knowledgecenter/SSYMRC_6.0.4/com.ibm.team.connector.cq.doc/topics/c_integ_git.html

CICD with jenkins and sonarqube

from the last week i am working with jenkins, and its going good but at the end of R&D I have lost of confusion, these are questions which confusingto me.
How to do Continuous Integration with jenkins of Website?
hoe to view Testing analysis reports produced by sonarqube server to my local system?
what happens where all my developers will do commit and push at the same time on repository?
How to deploy my web application on targeted server using jenkins?
How to I use sonarqube to test my website ?
If you are building a .net website, install msbuild plugin in jenkins. Create a jenkins job, add a step checkout your website (git/svn - install required repo plugin). Schedule to run nightly or hourly depending on your needs.
Type in url for your sonarqube server and then you can view the reports.
This is not an issue if your developers are comitting simultaneously. Usually a CI tool such as Jenkins will take care of that.
This is called continuous deployment or continuous delivery. Something like Octopus Deploy can help you if you are deploying .net applications. You can use the tool octo.exe and pass the API key as parameter to deploy to a specific environment.
SonarQube is used as a quality gate for code analysis. It is not a test framework. Try to investigate on how to use selenium framework for automation testing.
I hope that I have answered your questions.

How to publish an iOS App to crashlytics via jenkins?

I have my Xcode pro on svn repository,
on archiving I can successfully upload and distribute my app through crashlytics,
But now I wish to invoke jenkins to do unit testing after I update on svn and want jenkins to upload it to Crashlytics via or some other way.
I have automated the same, that is running the tests after which the build is uploaded to Crashlytics using a tool called Fastlane. It is pretty simple setting up by following the docs provided. You just have to include the fastlane commands in the shell while configuring the build steps of the job and also the api token and build secret as environment variables in Jenkins.
https://docs.fastlane.tools/

Apple CI / Xcode Service and Jenkins

Is there a way/plugin to integrate the new Xcode service and/or the new Apple CI with Jenkins?
Why?
A main issue with having a Jenkins server + an OSX build slave connected via ssh is that Unit Tests do not work, as the iOS Simulator needs a graphical environment which is not present in this configuration.
I hope that it is possible to integrate the Xcode service (which supports Unit Testing) with Jenkins.
It could be that using the Apple CI will be enough for my needs, but this question aims at the integration of the Xcode service with Jenkins.
What I do already know
I have experience with the existing Xcode Jenkins plugin, but it seems not to support the brand new Xcode service or the new Apple CI. I'm especially keen on unit testing via CI (which did not work properly over a ssh session with the old way).
What I want to know
I'd like info on the following issues currently not working with Jenkins and an ssh connected build slave:
Unit Tests on a headless system
Acceptance tests with Frank or similar
Automatic Provisioning Profile updating (Apple CI does that)
And info on things that currently do work fine with Jenkins and an ssh connected build slave and still should work with an Xcode service integration:
Builds of different build configurations (Release, Debug, TestFlight) / schemes
Automatic Build number increment
(With Jenkins I can set the build number in my project to ${BUILD_NUMBER}, and Jenkins sets this environment variable according to its build number. When the Apple CI does the builds most probably it will set the build number instead.)
Handling/synchronization of Build number between Jenkins & Apple CI
Accessing build products of the Apple CI from different Jenkins Jobs
e.g. for a Job to upload to TestFlight
Backup of builds
Automatic builds on git push to a specific branch
E-Mail notifications
Some additional questions/hints
I'm not sure whether the Apple CI == Xcode service or if the Apple CI just uses the Xcode service. In the latter case the Xcode service just would be like an intelligent build slave, and Jenkins maybe could use that to do builds and tests, but manage build numbers and products by itself.
I'm aware that the Apple CI is an separate CI, and integrating several CIs with each other is not the most easy or useful way to go. I just fear that the Apple CI is not flexible enough for my needs (see above), and that the old way with Jenkins bears some problems (see above).
I believe you are going to have to choose either jenkins or xcode server, not both. I don't know much about xcode server, but I do know about jenkins and xcode 5.
Builds with different configurations:
In the xcode plugin, you can set the scheme to use.
Automatic Build Number Increment
I added a parameter to my jenkins job called XCODEBUILDNUMBER. And whenever I start a build, I simply copy the build number out of my xcode project (I increment it manually. Mine looks like 080813A) and paste it into the XCODEBUILD parameter. I use this to name my output files, etc. There are plugins for jenkins that can automatically increment your build number, but they don't integrate, or sync with xcode.
Handling/synchronization of Build number between Jenkins & Apple CI
As I said before, I don't know of a way to sync the build numbers, but I just thought of a possible solution. You could use the command line tool plistbuddy, to set the build number in your info.plist, as a build step in your jenkins job.
Unit Tests
I have not successfully made unit tests work with Xcode5, but I know that the xcode plugin for jenkins supports it. I believe that the absence of the "Test After Build" key in the project settings may have something to do with it. If you make it work, i'd love to know. (I am also keen on making this work)
Acceptance Tests
From what I can tell, Frank is a command line tool. You can easily integrate it into your Jenkins job, and I believe that it will fail the build if your tests don't pass.
Accessing build products of the Apple CI from different Jenkins Jobs
Not completely sure what you mean, but with jenkins you can archive your build product (a .ipa), for later download and upload to a service like testflight. Again, I don't know much about Xcode Server (CI).
Backup of builds
As I said before, jenkins can archive your build product. Also, I use the the ${BUILD_NUMBER} variable in my build products directory, so I have a different directory for each build. This directory is also backed up to my Time Machine, and important builds copied to my web directory.
Automatic builds on git push to a specific branch
With the jenkins git plugin, you can make jenkins poll your scm in a interval specified by you, and can trigger a build on a change.
E-Mail notifications
I am sure that there is a plugin for this. (that emails you when a build failed/succeeded. in fact, this may be built-in)
In Closing
The xcode CI is a full independent CI, that may be hard to integrate with jenkins. Personally, I would recommend jenkins simply due to its extendability. Sorry I don't know much about Xcode Server.
I've got unit tests running in Jenkins with Xcode 5 on my OS X build slave. Instead of using the Xcode plugin, I run as an execute shell build step:
xcodebuild test -scheme <scheme> -configuration Coverage -sdk iphonesimulator7.0 -destination OS=7.0,name="iPhone Retina (4-inch)"
My coverage configuration is the exact same as my Debug config, except Generate Test Coverage Reports is set to YES, and Instrument Program Flow is set to YES. This is done so test coverage files are created. Due to a bug in Xcode 5, I call __gcov_flush(); in the tearDown of all my tests. I pipe the output of this xcodebuild command into ocunit2junit to get test reports in Jenkins.

Need help on automating QA, Stage, Prod delpoy using Jenkins\Hudson

We are using Hudson as a CI tool. At present we are needed to use Jenkins, to deploy the build to Stage, Prod environment. What is the best aproach we should follow.
I know about promote buld plugin, but the issue is authentication. I want whevener we need to promote a build to deploy to Stage or Prod, it should ask for netqwork credential first. And then the promote job should execute the Batch command using the creadential supplied. At present, the promote plugin, runs using the credentials which the Tomcat server is configured to run.
Same issue with Build Pipeline plugin.
I want only dev or even hudson admin also should not be able to execute the promote build unless credential supplied. (We have windows 2008 r2 OS)
Can you please help me in resolving the issue. so that basically whenever a user click on Promote build to QA\Stage\Prod the plugin should ask for credential or should use the logged on users credential and execute the batch script using the logged users credential only and not by using the credentials of the account with which the tomcat server is configured.
Can you please help me?
Please suggests us the best aproach for making automated build on prod\stage.
For deployment I normally use SSH, Private/Public keys takes care of the authentication problems normally associated with running commands on other servers.
SSH is normally associated with unix based systems, but it does support windows.
Finally, I would recommend considering decoupling your build system (jenkins) from the system performing the deployment by using an intermediate repository. See the following answer for more details:
Jenkins : how to check out artifact from Nexus and Deploy on Tomcat-

Resources