2018-08-21 15:17:25 +00:00
|
|
|
common = load 'ci/common.groovy'
|
|
|
|
|
|
|
|
def compile(type = 'nightly') {
|
|
|
|
common.tagBuild()
|
2018-08-23 12:56:19 +00:00
|
|
|
def gradleOpt = "-PbuildUrl='${currentBuild.absoluteUrl}' "
|
2018-08-21 15:17:25 +00:00
|
|
|
if (type == 'release') {
|
2018-08-23 12:56:19 +00:00
|
|
|
gradleOpt += "-PreleaseVersion='${common.version()}'"
|
2018-08-21 15:17:25 +00:00
|
|
|
}
|
|
|
|
dir('android') {
|
|
|
|
sh "./gradlew assembleRelease ${gradleOpt}"
|
|
|
|
}
|
2018-08-23 12:56:19 +00:00
|
|
|
def pkg = common.pkgFilename(type, 'apk')
|
2018-08-21 15:17:25 +00:00
|
|
|
sh "cp android/app/build/outputs/apk/release/app-release.apk ${pkg}"
|
|
|
|
return pkg
|
|
|
|
}
|
|
|
|
|
|
|
|
def uploadToPlayStore() {
|
|
|
|
withCredentials([
|
|
|
|
string(credentialsId: "SUPPLY_JSON_KEY_DATA", variable: 'GOOGLE_PLAY_JSON_KEY'),
|
|
|
|
string(credentialsId: "SLACK_URL", variable: 'SLACK_URL')
|
|
|
|
]) {
|
|
|
|
sh 'bundle exec fastlane android nightly'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def uploadToSauceLabs() {
|
2018-08-30 10:46:37 +00:00
|
|
|
def changeId = common.getParentRunEnv('CHANGE_ID')
|
|
|
|
if (changeId != null) {
|
|
|
|
env.SAUCE_LABS_APK = "${changeId}.apk"
|
|
|
|
} else {
|
|
|
|
env.SAUCE_LABS_APK = "im.status.ethereum-e2e-${GIT_COMMIT.take(6)}.apk"
|
|
|
|
}
|
2018-08-21 15:17:25 +00:00
|
|
|
withCredentials([
|
|
|
|
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),
|
|
|
|
string(credentialsId: 'SAUCE_USERNAME', variable: 'SAUCE_USERNAME'),
|
|
|
|
]) {
|
2018-08-27 15:32:54 +00:00
|
|
|
sh 'bundle exec fastlane android saucelabs'
|
2018-08-21 15:17:25 +00:00
|
|
|
}
|
|
|
|
return env.SAUCE_LABS_APK
|
|
|
|
}
|
|
|
|
|
|
|
|
def uploadToDiawi() {
|
|
|
|
env.SAUCE_LABS_APK = "im.status.ethereum-e2e-${GIT_COMMIT.take(6)}.apk"
|
|
|
|
withCredentials([
|
2018-08-27 15:32:54 +00:00
|
|
|
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
|
2018-08-21 15:17:25 +00:00
|
|
|
]) {
|
2018-08-27 15:32:54 +00:00
|
|
|
sh 'bundle exec fastlane android upload_diawi'
|
2018-08-21 15:17:25 +00:00
|
|
|
}
|
2018-08-27 15:32:54 +00:00
|
|
|
diawiUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
|
|
|
|
return diawiUrl
|
2018-08-21 15:17:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return this
|