Jenkins - Creating a Parameterised Build
Overview
My iOS project has been using Jenkins & Fastlane to build, test & upload to HockeyApp.
Steps for creating a parameterised build
Copy the Jenkins build job
B&C uses the Jenkins job iOS-CheckoutNightly. This job should be copied (Via Jenkins -> New Item -> Copy from) and named appropriatly.
This new job should then be configured to change the following Jenkins parameters:
BRANCH
e.g.feature/checkout
SCHEME
e.g.Nightly
APPID
e.g.DEADBEEF771248cba6aff5f4c972c779
HOCKEYTOKEN
e.g.DEADBEEF2dea4460bee6889fbfe019bd
If necessary a feeder Jenkins job can be created which just calls iOS-CheckoutNightly
, but passing different parameters. For example:
ExampleParameterisedBuild
TODO: Investigate Build Flows
// See https://wiki.jenkins-ci.org/display/JENKINS/Build+Flow+Plugin
// For examples on how to use this
//
build ("android_parameterized_build", , param1: "develop")
retry ( 3 ) {
build( "android_upload_to_hockey" )
}
&
build("ANDROID_SOME_RELEASE", APP_ID: "DEADBEEFdca69c8d6f9d7326e3b4c50b", ANDROID_AVD_DEVICE: "666_490597a0")
Or
Just add the follwing as a build step in Jenkins.
#!/bin/bash -l
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
cd src
export WORKSPACE="MYPROJECT.xcworkspace"
export EXPORT_METHOD="enterprise"
export TEAM_ID="JGATYRGQY6"
# export IPA_NAME="MYPROJECT.ipa"
# export IPA_NAME="MYPROJECTUITests.ipa"
# Also --scheme MYPROJECTUITestsWebViewStatus or MYPROJECTUITests
gym --workspace "$WORKSPACE" \
--scheme "Debug" \
--silent \
--clean \
--export_method "$EXPORT_METHOD" \
--export_team_id "$TEAM_ID" \
--include_bitcode false \
--include_symbols false \
--output_name "MYPROJECT.ipa" \
--use_legacy_build_api