Does Jenkins support Xcode integration - ios

Has anyone used Jenkins in Xcode for code management and automated deployment ? If yes, how can it be integrated ? How does automated deployment work with Jenkins ? Went through the documentation but didn't get much idea.
I went through the Jenkins plugins for iOS but not clear if we can publish the build to AppStore using any plugin.

We are using a Jenkins Server for Continuos Integration, by fetching the source from an SVN Server when the Jenkins is triggered by Commits to this repositories.
But, to be serious, i wouldn't recommend the jenkins... i'd rather use xcode server/bots to get rid of all the hassle with the jenkins...

fastlane is a tool for iOS and Android developers to automate tedious tasks like generating screenshots, dealing with provisioning profiles and releasing your application.
https://github.com/fastlane/fastlane
xctool is a replacement for Apple's xcodebuild that makes it easier to test iOS and Mac products. It's especially helpful for continuous integration.
https://github.com/facebook/xctool

The term "Jenkins in Xcode for code management" seems not fully correct. Because Jenkins server is for CI, in which we config it (create a job) that will fetch the source code from your repository (SVN, GIT), then compile it and run, probably execute your unit tests, UI automation tests or code coverage tool.
Based on your schedule, Jenkins server will automatically start its job or is triggered whenever there is a change in your repo (anybody commits the code for example).
The tool you mentioned which in Xcode is probably XCode Bots, the built-in CI tool.
In order to set up, firstly, you have to install and config XCode server. After that, connecting your server with your repositories. Secondly, creates a bot with your customize configuration and run it.
In my opinion in term of Jenkins and Xcode comparison, I would say that it depends on what tools or add-in functions that you want to set up for your CI server. Jenkins has many plugins might helpful like check style, measure code coverage while Xcode bot still having some limitation.
This document https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/ for your further reference.
I hope this would be helpful to you.

There is a gem called xcpretty, you can use it to output JUnit format test result, then use Jenkins JUnit Plugin to show the result.
Install xcpretty
gem install xcpretty
Use xcpretty to create junit format xml file
xcodebuild test ... | xcpretty --report junit --output [path_to_save]/unit_test_result.xml
Then this unit_test_result.xml can be used to report by Jenkins JUnit Plugin

Related

Could not create iOS build summary report (Errors and warnings) in Jenkins with or without Fastlane

I am using Jenkins and Fastlane for CICD pipeline for my iOS Project. Before we were using Xcode server that provides a direct API using which i exported the build summary(Compilation Errors, Warnings from Xcode).
But now with Jenkins or fastlane i am not able to do it since i couldn't find any API that generates this report.
For Code Analysis i am using swiftlint. It is generating code analysis report only and it is not showing the default warnings like deprecations etc. in Jenkins. So i understood i cannot use the code analysis tool for this purpose.
Is there any way with which i could generate the Warnings and Errors report in Jenkins? For all the actions like incrementing build number, executing test cases, code signing, generating binary etc. i have written separate lanes in my fastfile.
There is an option to generate warnings report in Jenkins. We need to
Install Warnings plugin in jenkins,
Add a post build step to scan compiler warnings,
Select Clang LLVM as parser.
A trend graph for warnings will be shown and a remote API is available to use the report elsewhere.
But couldn't find anything on the errors though.

Continuous Integration with hybrid mobile app

I have a problem. I need to build a job in my Jenkins server hosted by macmini (localhost) to automatic build a deploy for my mobile hybrid apps. That's apps was building with ionic2, and need a deploy for Android (apk) and for iOS (ipa).
But when i run a build from Jenkins, with this shell command
I get this error
that's not all... because i try to execute, from the jenkins folder, the npm i and the result was this:
When i try to build my application from other "folder" and not from jenkins, they works correctly. How i can solve?
Without more information hard to say; you can either just script the things you do when you deploy "manually", or you might want to try a CLI tool like https://www.bitrise.io/cli or https://fastlane.tools which can auto-scan your project and configure a suitable configuration which is then easier to tweak.
In case of Bitrise CLI the base config can be generated with bitrise init in the repo root, and you can also use a visual editor to modify your configuration: https://discuss.bitrise.io/t/how-to-experiment-with-bitrise-configs-locally-on-your-mac-linux/1751
After a lot of time, just find the solution. Jenkins have a own "tools management". So i need to install, into jenkins, a property version of nodeJS, Npm and all other tools i need to deploy the application.
So, first of all you need to install property plugin (in my case nodejs).
After this, going into Jenkins Management System and configure a NodeJS version. That's all

Alternatives for QC

In my project we are using QC to execute our test cases(QTP), moving forward we would be eliminating QC (for cost reasons).
As far as I explored MSBuild & Jenkins, they would be suitable.
But MSBuild will trigger the execution when a new build pushed to the repository. Also it will automatically test on the latest build.
Is there any other CI tool available to execute test cases through QTP?
I will be executing automation once in a release. Also we install our application by manual since it requires lots of configuration.
Take a look at HP Application Automation Tools.
This plugin basically replaces the need for QC, and is developed by HP.
Create a Jenkins job using this plugin on the same Jenkins installation used to build your code, then you can configure your job to run your tests as soon the code is available (e.g. on a nightly basis).
See here for a helpful guide on how to implement a simple Jenkins job using this plugin.
They also host the code on Github, which is very useful if you need to change the behavior of the plugin to suit your needs.

Salesforce app + Git + TeamCity = how to set up "save to server" step?

I am setting up continuous integration for SalesForce application.
I am new in SalesForce, and don't know how to automate some steps in my workflow. Please help me understand.
My build steps in TeamCity:
Get the branch with application code from git repository.
Save the updated code to my development org - this should automate the
"Save to Server" command that the developer clicks in Eclipse.
Run unit tests using Ant tool.
Get the branch with Selenium tests code from git repository.
Run the selenium tests.
If the tests are green, merge the develop branch to QA branch and deploy the code changes from development org to QA org for manual testing.
Problem: I don't know how to set up Step 2
As far as I understand everything should be automated. I have been told by my manager that it's the developer's job to manually click 'save to server' command in Eclipse and then push the code changes to git repository. Also SalesForce does the so called build on its own in the cloud.
I would appreciate any explanations, references and examples. Thank you.
You can use Salesforce Migration Tool which relies on Apache's Ant for this as well. My approach was designing a Perl program that lists all modified, or added files within a branch and then saves them to the server using Ant.
For more information: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_deploying_ant.htm
(Deployment in this case is saving to the server)
EDIT: spelling mistake

BVT's after Jenkins build on Perforce VC

I have set up a Jenkins project using the Perforce Plugin and am now working on configuring the "Publish JUnit test result report" post-build action so that it will run build verification tests upon successful builds.
It's telling me that I need to "first set up your build to run tests" - but I am unsure if I should be doing this via Visual Studio since I don't have TFS. Is there another way to do this apart from TFS?
I ended up solving this issue by using MSTest and its Jenkins plugin. For those of you here with the same question I had, you can find some pretty good directions on how to get this working here (although I used the version you can find in VS 2012).

Resources