use a table to post links to build artifacts

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2018-11-13 19:35:17 +01:00
parent 510961e333
commit c825ff285a
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
4 changed files with 49 additions and 46 deletions

View File

@ -51,11 +51,11 @@ _prepare-mobile: ##@prepare Install mobile platform dependencies and prepare wor
npm install npm install
$(STATUS_GO_IOS_ARCH): $(STATUS_GO_IOS_ARCH):
cd $(RCTSTATUS_DIR) && curl -OL "$(GITHUB_URL)/$(STATUS_GO_VER)/status-go-ios.zip" cd $(RCTSTATUS_DIR) && curl -s -OL "$(GITHUB_URL)/$(STATUS_GO_VER)/status-go-ios.zip"
$(STATUS_GO_DRO_ARCH): $(STATUS_GO_DRO_ARCH):
mkdir -p $(ANDROID_LIBS_DIR) mkdir -p $(ANDROID_LIBS_DIR)
cd $(ANDROID_LIBS_DIR) && curl -o status-go-$(STATUS_GO_VER).aar -OL "$(GITHUB_URL)/$(STATUS_GO_VER)/status-go-android.aar" cd $(ANDROID_LIBS_DIR) && curl -s -o status-go-$(STATUS_GO_VER).aar -OL "$(GITHUB_URL)/$(STATUS_GO_VER)/status-go-android.aar"
prepare-ios: $(STATUS_GO_IOS_ARCH) _prepare-mobile ##@prepare Install and prepare iOS-specific dependencies prepare-ios: $(STATUS_GO_IOS_ARCH) _prepare-mobile ##@prepare Install and prepare iOS-specific dependencies
cd $(RCTSTATUS_DIR) && unzip -q -o status-go-ios.zip cd $(RCTSTATUS_DIR) && unzip -q -o status-go-ios.zip

View File

@ -74,7 +74,6 @@ pipeline {
steps { script { steps { script {
e2eUrl = cmn.uploadArtifact(cmn.pkgFind('e2e.apk')) e2eUrl = cmn.uploadArtifact(cmn.pkgFind('e2e.apk'))
apkUrl = cmn.uploadArtifact(cmn.pkgFind("${btype}.apk")) apkUrl = cmn.uploadArtifact(cmn.pkgFind("${btype}.apk"))
if (btype != 'release') { if (btype != 'release') {
dmgUrl = cmn.uploadArtifact(cmn.pkgFind('dmg')) dmgUrl = cmn.uploadArtifact(cmn.pkgFind('dmg'))
appUrl = cmn.uploadArtifact(cmn.pkgFind('AppImage')) appUrl = cmn.uploadArtifact(cmn.pkgFind('AppImage'))
@ -102,8 +101,7 @@ pipeline {
steps { script { steps { script {
if (env.CHANGE_ID != null) { if (env.CHANGE_ID != null) {
cmn.githubNotify( cmn.githubNotify(
apkUrl, e2eUrl, ipaUrl, dmgUrl, appUrl, zipUrl, apk: apkUrl, e2e: e2eUrl, ipa: ipaUrl, app: appUrl, dmg: dmgUrl, win: zipUrl,
env.CHANGE_ID
) )
} }
} } } }
@ -129,10 +127,10 @@ pipeline {
when { expression { btype == 'nightly' } } when { expression { btype == 'nightly' } }
steps { script { steps { script {
e2eApk = e2e.getBuildVariables().get('SAUCE_URL') e2eApk = e2e.getBuildVariables().get('SAUCE_URL')
build( build(
job: 'end-to-end-tests/status-app-nightly', wait: false, job: 'end-to-end-tests/status-app-nightly', wait: false,
parameters: [string(name: 'apk', value: "--apk=${e2eApk}")] parameters: [string(name: 'apk', value: "--apk=${e2eApk}")]
) )
} } } }
} }
} }

View File

@ -4,23 +4,31 @@ env.LC_ALL="en_US.UTF-8"
env.FASTLANE_DISABLE_COLORS=1 env.FASTLANE_DISABLE_COLORS=1
env.REALM_DISABLE_ANALYTICS=1 env.REALM_DISABLE_ANALYTICS=1
timeout(90) { timeout(120) {
node ('fastlane'){ node ('macos') {
stage('Git Checkout'){
stage('Git & Dependencies'){ checkout([
$class: 'GitSCM',
checkout([$class: 'GitSCM', branches: [[name: 'develop']], branches: [[name: 'develop']],
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], doGenerateSubmoduleConfigurations: false,
submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/status-im/status-react.git']]]) extensions: [[$class: 'CleanBeforeCheckout']],
submoduleCfg: [],
load "$HOME/env.groovy" userRemoteConfigs: [[url: 'https://github.com/status-im/status-react.git']]
])
} }
stage('Clean Testflight Users'){ stage('Install Deps'){
sh ('bundle install')
}
withCredentials([string(credentialsId: 'FASTLANE_PASSWORD', variable: 'FASTLANE_PASSWORD'), stage('Clean Users'){
string(credentialsId: 'APPLE_ID', variable: 'APPLE_ID')]) { withCredentials([
string(credentialsId: 'FASTLANE_PASSWORD', variable: 'FASTLANE_PASSWORD'),
string(credentialsId: 'APPLE_ID', variable: 'APPLE_ID')]
) {
sh ('bundle install') sh ('bundle install')
sh ('bundle exec fastlane ios clean')}} sh ('bundle exec fastlane ios clean')
}
} }
}
} }

View File

@ -142,31 +142,28 @@ def pkgFilename(type, ext) {
} }
def githubNotify(apkUrl, e2eUrl, ipaUrl, dmgUrl, appUrl, zipUrl, changeId) { def githubNotify(Map urls) {
def githubIssuesUrl = 'https://api.github.com/repos/status-im/status-react/issues'
withCredentials([string(credentialsId: 'GIT_HUB_TOKEN', variable: 'githubToken')]) { withCredentials([string(credentialsId: 'GIT_HUB_TOKEN', variable: 'githubToken')]) {
def message = ( def message = "#### :white_check_mark: [${currentBuild.displayName}](${currentBuild.absoluteUrl}) "
"#### :white_check_mark: CI BUILD SUCCESSFUL\\n" + message += "CI BUILD SUCCESSFUL in ${currentBuild.durationString} (${GIT_COMMIT})\n"
"Jenkins job: [${currentBuild.displayName}](${currentBuild.absoluteUrl})\\n"+ message += '| | | | | |\n'
"##### Mobile\\n" + message += '|-|-|-|-|-|\n'
"* [Android](${apkUrl}), ([e2e](${e2eUrl}))\\n" + message += "| [Android](${urls.apk})([e2e](${urls.e2e})) | [iOS](${urls.ipa}) |"
"* [iOS](${ipaUrl})\\n") if (dmgUrl != null) {
message += " [MacOS](${urls.dmg}) | [AppImage](${urls.app}) | [Windows](${urls.win}) |"
if (dmgUrl != null && appUrl != null && zipUrl != null) { } else {
message = message + message += " ~~MacOS~~ | ~~AppImage~~ | ~~Windows~~~ |"
"##### Desktop\\n" +
"* [MacOS](${dmgUrl})\\n" +
"* [AppImage](${appUrl})\\n" +
"* [Windows](${zipUrl})"
} }
def script = ( def msgObj = [body: message]
"curl "+ def msgJson = new JsonBuilder(msgObj).toPrettyString()
"-u status-im:${githubToken} " + sh """
"-H 'Content-Type: application/json' " + curl --silent \
"--data '{\"body\": \"${message}\"}' " + -u status-im:${githubToken} \
"https://api.github.com/repos/status-im/status-react/issues/${changeId}/comments" -H "Content-Type: application/json" \
) --data '${msgJson}' \
def ghOutput = sh(returnStdout: true, script: script) "${githubIssuesUrl}/${env.CHANGE_ID}/comments"
println("Result of github comment curl: " + ghOutput); """.trim()
} }
} }