Skip to content

Instantly share code, notes, and snippets.

@escapedcat
Last active April 28, 2016 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save escapedcat/07e37eeed1d50c4336bd to your computer and use it in GitHub Desktop.
Save escapedcat/07e37eeed1d50c4336bd to your computer and use it in GitHub Desktop.
Cordova iOS App deployment to HockeyApp using Fastlane / Match / Gym; including code signing identity
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/docs/Actions.md
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# By default, fastlane will send which actions are used
# No personal data is shared, more information on https://github.com/fastlane/enhancer
# Uncomment the following line to opt out
# opt_out_usage
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "1.64.0"
default_platform :ios
platform :ios do
before_all do
# ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
ENV["MATCH_FORCE_ENTERPRISE"] = "1"
end
desc "Runs all the tests"
lane :test do
scan
end
desc "Deploy a new version to HockeyApp"
lane :dist do
match(
git_url: ENV["GIT_CERTS"],
type: "enterprise",
username: ENV["APPLE_ID"],
app_identifier: ENV["APP_ID"],
keychain_name: ENV["JOB_NAME"] + '-' + ENV["BUILD_NUMBER"] + '.keychain',
readonly: "true"
)
gym(
project: './build-cordova/platforms/ios/' + ENV["APP_NAME"] + '.xcodeproj',
scheme: ENV["APP_NAME"],
use_legacy_build_api: "true",
export_method: "enterprise",
codesigning_identity: ENV["CODESIGNING_IDENTITY"]
)
hockey(
api_token: ENV["HA_API_TOKEN"],
ipa: ENV["APP_NAME"] + '.ipa',
notify: "0"
)
end
# You can define as many lanes as you want
after_all do |lane|
# This block is called, only if the executed lane was successful
# slack(
# message: "Successfully deployed new App Update."
# )
end
error do |lane, exception|
# slack(
# message: exception.message,
# success: false
# )
end
end
# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/docs/Platforms.md
# All available actions: https://github.com/fastlane/fastlane/blob/master/docs/Actions.md
var APP_ID = process.env.APP_ID || 'com.company.app';
var APP_NAME = process.env.APP_NAME || 'appname.default';
var JOB_NAME = process.env.JOB_NAME || 'jenkins-ci-job';
var BUILD_NUMBER = process.env.BUILD_NUMBER || 000;
var KEYCHAIN = JOB_NAME + '-' + BUILD_NUMBER + '.keychain';
gulp.task('xcode:ipa', shell.task([
'security -v create-keychain -p cici1234 ' + KEYCHAIN,
// NOT NEEDED! only one default in general is needed (hudson.keychain exists already) - just still here because
// 'security -v default-keychain -s ' + keychain,
'security list-keychains -s ' + KEYCHAIN,
'security -v unlock-keychain -p cici1234 ' + KEYCHAIN,
'fastlane dist',
'security -v delete-keychain ' + KEYCHAIN,
'rm -v ~/Library/MobileDevice/Provisioning\\ Profiles/*'
]));
// to create a new (dist) cert for a newly created appid
MATCH_FORCE_ENTERPRISE="1" match enterprise -a "com.company.app" -r "ssh://git@your.sweet.url.com/project/certs.git" -u "your.apple.user@domain.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment