2018-11-19 17:37:04 +00:00
|
|
|
cmn = load('ci/common.groovy')
|
2018-08-23 12:56:19 +00:00
|
|
|
|
|
|
|
def plutil(name, value) {
|
|
|
|
sh "plutil -replace ${name} -string ${value} ios/StatusIm/Info.plist"
|
|
|
|
}
|
|
|
|
|
2018-12-06 10:52:44 +00:00
|
|
|
def bundle(type) {
|
|
|
|
if (!type) {
|
|
|
|
type = cmn.getBuildType()
|
|
|
|
}
|
2018-11-19 17:37:04 +00:00
|
|
|
def target
|
|
|
|
switch (type) {
|
2018-12-21 12:19:52 +00:00
|
|
|
case 'release': target = 'release'; break;
|
|
|
|
case 'testflight': target = 'release'; break;
|
|
|
|
case 'e2e': target = 'e2e'; break;
|
|
|
|
default: target = 'nightly';
|
2018-09-21 11:57:06 +00:00
|
|
|
}
|
2018-08-23 12:56:19 +00:00
|
|
|
/* configure build metadata */
|
2018-12-06 10:52:44 +00:00
|
|
|
plutil('CFBundleShortVersionString', cmn.version())
|
|
|
|
plutil('CFBundleVersion', cmn.buildNumber())
|
2018-08-23 12:56:19 +00:00
|
|
|
plutil('CFBundleBuildUrl', currentBuild.absoluteUrl)
|
2018-11-19 17:37:04 +00:00
|
|
|
/* the dir might not exist */
|
|
|
|
sh 'mkdir -p status-e2e'
|
2018-08-23 12:56:19 +00:00
|
|
|
/* build the actual app */
|
2018-08-21 15:17:25 +00:00
|
|
|
withCredentials([
|
|
|
|
string(credentialsId: 'SLACK_URL', variable: 'SLACK_URL'),
|
|
|
|
string(credentialsId: "slave-pass-${env.NODE_NAME}", variable: 'KEYCHAIN_PASSWORD'),
|
|
|
|
string(credentialsId: 'FASTLANE_PASSWORD', variable: 'FASTLANE_PASSWORD'),
|
|
|
|
string(credentialsId: 'APPLE_ID', variable: 'APPLE_ID'),
|
|
|
|
string(credentialsId: 'fastlane-match-password', variable:'MATCH_PASSWORD')
|
|
|
|
]) {
|
2018-08-27 15:32:54 +00:00
|
|
|
sh "bundle exec fastlane ios ${target}"
|
2018-08-21 15:17:25 +00:00
|
|
|
}
|
2018-11-19 17:37:04 +00:00
|
|
|
/* rename built file for uploads and archivization */
|
|
|
|
def pkg = ''
|
|
|
|
if (type == 'e2e') {
|
|
|
|
pkg = cmn.pkgFilename('e2e', 'app.zip')
|
|
|
|
sh "cp status-e2e/StatusIm.app.zip ${pkg}"
|
|
|
|
} else if (type != 'testflight') {
|
|
|
|
pkg = cmn.pkgFilename(type, 'ipa')
|
|
|
|
sh "cp status-adhoc/StatusIm.ipa ${pkg}"
|
2018-09-21 11:57:06 +00:00
|
|
|
}
|
2018-11-19 17:37:04 +00:00
|
|
|
return pkg
|
2018-08-21 15:17:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
def uploadToDiawi() {
|
|
|
|
withCredentials([
|
|
|
|
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
|
|
|
|
]) {
|
2018-08-27 15:32:54 +00:00
|
|
|
sh 'bundle exec fastlane ios upload_diawi'
|
2018-08-21 15:17:25 +00:00
|
|
|
}
|
|
|
|
diawiUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
|
|
|
|
return diawiUrl
|
|
|
|
}
|
|
|
|
|
2018-11-19 17:37:04 +00:00
|
|
|
def uploadToSauceLabs() {
|
|
|
|
def changeId = cmn.getParentRunEnv('CHANGE_ID')
|
|
|
|
if (changeId != null) {
|
|
|
|
env.SAUCE_LABS_NAME = "${changeId}.app.zip"
|
|
|
|
} else {
|
|
|
|
env.SAUCE_LABS_NAME = "im.status.ethereum-e2e-${cmn.gitCommit()}.app.zip"
|
|
|
|
}
|
|
|
|
withCredentials([
|
|
|
|
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),
|
|
|
|
string(credentialsId: 'SAUCE_USERNAME', variable: 'SAUCE_USERNAME'),
|
|
|
|
]) {
|
|
|
|
sh 'bundle exec fastlane ios saucelabs'
|
|
|
|
}
|
|
|
|
return env.SAUCE_LABS_NAME
|
|
|
|
}
|
|
|
|
|
2018-08-21 15:17:25 +00:00
|
|
|
return this
|