Skip to content

Instantly share code, notes, and snippets.

//app identifier
def getBundleId() {
return "com.our_project.test.production"
}
//scheme name
def getConfiguration() {
return "TestProduction-Testflight"
}
//provisioning profile name
def getProvisioningProfile() {
//app identifier
def getBundleId() {
return "com.our_project.stg"
}
//scheme name
def getConfiguration() {
return "Stg-Testflight"
}
//provisioning profile name
def getProvisioningProfile() {
lane :test do |options|
configuration = options[:configuration]
scan(
clean: true,
devices: ["iPhone X"],
workspace: "our_project.xcworkspace",
scheme: configuration,
code_coverage: true,
output_directory: "./test_output",
output_types: "html,junit"
fastlane_version "2.75.0"
default_platform :ios
lane :test do |options|
configuration = options[:configuration]
scan(
clean: true,
devices: ["iPhone X"],
workspace: "our_project.xcworkspace",
def deployWith(bundle_id, configuration, provisioning_profile) {
stage('Checkout') {
checkout scm
}
stage('Install dependencies') {
sh 'gem install bundler'
sh 'bundle update'
sh 'bundle exec pod repo update'
lane :upload_to_testflight do
pilot(
ipa: "./build/our_project.ipa",
skip_submission: true,
skip_waiting_for_build_processing: true,
app_identifier: "production_app_identifier"
)
end
lane :upload_to_testflight do |options|
bundle_id = options[:bundle_id]
pilot(
ipa: "./build/WorkableApp.ipa",
skip_submission: true,
skip_waiting_for_build_processing: true,
app_identifier: bundle_id
)
end
stage('Upload to TestFlight') {
withEnv(["FASTLANE_USER=fastlane_user_email_address"]) {
withCredentials([
string([
credentialsId: 'fastlane_password_id',
variable: 'FASTLANE_PASSWORD']),
]) {
sh "bundle exec fastlane upload_to_testflight"
}
}
stage('Upload to TestFlight') {
withEnv(["FASTLANE_USER=fastlane_user_email_address"]) {
withCredentials([
string([credentialsId: 'fastlane_password_id', variable: 'FASTLANE_PASSWORD']),
]) {
sh "bundle exec fastlane upload_to_testflight bundle_id:$bundle_id"
}
}
}
lane :build do |options|
bundle_id = options[:bundle_id]
configuration = options[:configuration]
provisioning_profile = options[:provisioning_profile]
match(
git_branch: "the_branch_of_the_repo_with_the_prov_profile",
username: "github_username",
git_url: "github_repo_with_prov_profiles",