2018-12-06 10:52:44 +00:00
|
|
|
cmn = load 'ci/common.groovy'
|
2018-08-21 15:17:25 +00:00
|
|
|
|
2018-12-06 10:52:44 +00:00
|
|
|
def bundle(type = 'nightly') {
|
2018-11-27 10:15:33 +00:00
|
|
|
/* Disable Gradle Daemon https://stackoverflow.com/questions/38710327/jenkins-builds-fail-using-the-gradle-daemon */
|
2018-11-21 07:02:53 +00:00
|
|
|
def gradleOpt = "-PbuildUrl='${currentBuild.absoluteUrl}' -Dorg.gradle.daemon=false "
|
2018-08-21 15:17:25 +00:00
|
|
|
if (type == 'release') {
|
2018-12-06 10:52:44 +00:00
|
|
|
gradleOpt += "-PreleaseVersion='${cmn.version()}'"
|
2018-08-21 15:17:25 +00:00
|
|
|
}
|
|
|
|
dir('android') {
|
2018-12-09 14:58:03 +00:00
|
|
|
withCredentials([
|
|
|
|
string(
|
|
|
|
credentialsId: 'android-keystore-pass',
|
|
|
|
variable: 'STATUS_RELEASE_STORE_PASSWORD'
|
|
|
|
),
|
|
|
|
usernamePassword(
|
|
|
|
credentialsId: 'android-keystore-key-pass',
|
|
|
|
usernameVariable: 'STATUS_RELEASE_KEY_ALIAS',
|
|
|
|
passwordVariable: 'STATUS_RELEASE_KEY_PASSWORD'
|
|
|
|
)
|
|
|
|
]) {
|
|
|
|
sh "./gradlew assembleRelease ${gradleOpt}"
|
|
|
|
}
|
2018-08-21 15:17:25 +00:00
|
|
|
}
|
2018-12-06 10:52:44 +00:00
|
|
|
def pkg = cmn.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
|
|
|
|
}
|
|
|
|
|
2018-09-21 11:57:06 +00:00
|
|
|
def uploadToPlayStore(type = 'nightly') {
|
2018-08-21 15:17:25 +00:00
|
|
|
withCredentials([
|
|
|
|
string(credentialsId: "SUPPLY_JSON_KEY_DATA", variable: 'GOOGLE_PLAY_JSON_KEY'),
|
|
|
|
string(credentialsId: "SLACK_URL", variable: 'SLACK_URL')
|
|
|
|
]) {
|
2018-09-21 11:57:06 +00:00
|
|
|
sh "bundle exec fastlane android ${type}"
|
2018-08-21 15:17:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def uploadToSauceLabs() {
|
2019-01-10 09:56:08 +00:00
|
|
|
def changeId = cmn.changeId()
|
2018-08-30 10:46:37 +00:00
|
|
|
if (changeId != null) {
|
2018-11-19 17:37:04 +00:00
|
|
|
env.SAUCE_LABS_NAME = "${changeId}.apk"
|
2018-08-30 10:46:37 +00:00
|
|
|
} else {
|
2018-11-19 17:37:04 +00:00
|
|
|
env.SAUCE_LABS_NAME = "im.status.ethereum-e2e-${GIT_COMMIT.take(6)}.apk"
|
2018-08-30 10:46:37 +00:00
|
|
|
}
|
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
|
|
|
}
|
2018-11-19 17:37:04 +00:00
|
|
|
return env.SAUCE_LABS_NAME
|
2018-08-21 15:17:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
def uploadToDiawi() {
|
2018-11-19 17:37:04 +00:00
|
|
|
env.SAUCE_LABS_NAME = "im.status.ethereum-e2e-${GIT_COMMIT.take(6)}.apk"
|
2018-08-21 15:17:25 +00:00
|
|
|
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
|