2018-08-23 12:56:19 +00:00
|
|
|
common = load('ci/common.groovy')
|
|
|
|
|
|
|
|
def plutil(name, value) {
|
|
|
|
sh "plutil -replace ${name} -string ${value} ios/StatusIm/Info.plist"
|
|
|
|
}
|
|
|
|
|
2018-08-21 15:17:25 +00:00
|
|
|
def compile(type = 'nightly') {
|
|
|
|
def target = (type == 'release' ? 'adhoc' : 'nightly')
|
2018-08-23 12:56:19 +00:00
|
|
|
/* configure build metadata */
|
|
|
|
plutil('CFBundleShortVersionString', common.version())
|
|
|
|
plutil('CFBundleVersion', common.tagBuild())
|
|
|
|
plutil('CFBundleBuildUrl', currentBuild.absoluteUrl)
|
|
|
|
/* 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')
|
|
|
|
]) {
|
|
|
|
sh "fastlane ios ${target}"
|
|
|
|
}
|
2018-08-23 12:56:19 +00:00
|
|
|
def pkg = common.pkgFilename(type, 'ipa')
|
2018-08-21 15:17:25 +00:00
|
|
|
sh "cp status-adhoc/StatusIm.ipa ${pkg}"
|
|
|
|
return pkg
|
|
|
|
}
|
|
|
|
|
|
|
|
def uploadToDiawi() {
|
|
|
|
withCredentials([
|
|
|
|
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
|
|
|
|
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
|
|
|
|
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
|
|
|
|
]) {
|
|
|
|
sh 'fastlane ios upload_diawi'
|
|
|
|
}
|
|
|
|
diawiUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
|
|
|
|
return diawiUrl
|
|
|
|
}
|
|
|
|
|
|
|
|
return this
|