From e8ab892e954b829ed4041c056c1a873718e90fb5 Mon Sep 17 00:00:00 2001 From: Igor Mandrigin Date: Thu, 16 Aug 2018 11:46:42 +0200 Subject: [PATCH] Fix Slack messages for builds. 1) Fill in apkUrl where needed so it is not empty; 2) Remove unused variables. Signed-off-by: Igor Mandrigin --- ci/Jenkinsfile.nightly_fastlane | 4 +--- ci/Jenkinsfile.parameters | 6 +++--- ci/Jenkinsfile.release | 4 +--- ci/Jenkinsfile.upload_release_android | 5 +---- ci/Jenkinsfile.upload_release_ios | 3 --- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/ci/Jenkinsfile.nightly_fastlane b/ci/Jenkinsfile.nightly_fastlane index 8d4839c730..0abe47725a 100644 --- a/ci/Jenkinsfile.nightly_fastlane +++ b/ci/Jenkinsfile.nightly_fastlane @@ -30,7 +30,6 @@ timeout(90) { def apkUrl = '' def testApkUrl = '' def ipaUrl = '' - def testPassed = true def version def build_no @@ -170,8 +169,7 @@ timeout(90) { } stage('Slack Notification') { - def c = (testPassed ? 'good' : 'warning' ) - slackSend color: c, message: 'Nightly build (develop) \nTests: ' + (testPassed ? ':+1:' : ':-1:') + ')\nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl + '\n Android for e2e: ' + testApkUrl + slackSend color: 'good', message: 'Nightly build (develop) \nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl + '\n Android for e2e: ' + testApkUrl } stage('Run extended e2e tests') { diff --git a/ci/Jenkinsfile.parameters b/ci/Jenkinsfile.parameters index d671a4aadf..71def7382b 100644 --- a/ci/Jenkinsfile.parameters +++ b/ci/Jenkinsfile.parameters @@ -21,7 +21,6 @@ timeout(90) { node ('fastlane') { def apkUrl = '' def ipaUrl = '' - def testPassed = true def branch; load "$HOME/env.groovy" @@ -80,6 +79,8 @@ timeout(90) { string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL') ]) { sh 'fastlane android upload_diawi' + + apkUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out" } } @@ -112,9 +113,8 @@ timeout(90) { } stage('Slack Notification') { - def c = (testPassed ? 'good' : 'warning' ) slackSend( - color: c, + color: 'good', message: "Branch: ${REPO}:${BRANCH_NAME}\nAndroid: ${apkUrl}\niOS: ${ipaUrl}" ) } diff --git a/ci/Jenkinsfile.release b/ci/Jenkinsfile.release index edde35faa4..e3b1f5797b 100644 --- a/ci/Jenkinsfile.release +++ b/ci/Jenkinsfile.release @@ -23,7 +23,6 @@ timeout(90) { node ('fastlane'){ def apkUrl = '' def ipaUrl = '' - def testPassed = true def version def build_no @@ -127,8 +126,7 @@ timeout(90) { } stage('Slack Notification') { - def c = (testPassed ? 'good' : 'warning' ) - slackSend color: c, message: 'Release build \nTests: ' + (testPassed ? ':+1:' : ':-1:') + ')\nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl + slackSend color: 'good', message: 'Release build \nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl } stage('Build (Android) for e2e tests') { diff --git a/ci/Jenkinsfile.upload_release_android b/ci/Jenkinsfile.upload_release_android index dac09159f9..a4049cfc24 100644 --- a/ci/Jenkinsfile.upload_release_android +++ b/ci/Jenkinsfile.upload_release_android @@ -20,10 +20,7 @@ def installJSDeps() { } timeout(90) { - node ('macos'){ - def apkUrl = '' - def ipaUrl = '' - def testPassed = true + node ('fastlane'){ def version def build_no diff --git a/ci/Jenkinsfile.upload_release_ios b/ci/Jenkinsfile.upload_release_ios index 2710f858bf..57060b1a7e 100644 --- a/ci/Jenkinsfile.upload_release_ios +++ b/ci/Jenkinsfile.upload_release_ios @@ -21,9 +21,6 @@ def installJSDeps() { timeout(90) { node ('fastlane'){ - def apkUrl = '' - def ipaUrl = '' - def testPassed = true def version def build_no