mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 02:04:28 +00:00
prepare Jenkinsfile.combined for PR builds
- add missing Lint step for mobile builds - add missing upload steps for android - prefix fastlane calls with bundle exec - update slackSend to format for PR builds - silence fastlane notifying slack, Jenkins already does Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
60b68758a8
commit
76e9501541
@ -32,6 +32,11 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Lint') {
|
||||
steps {
|
||||
script { mobile.runLint() }
|
||||
}
|
||||
}
|
||||
stage('Tests') {
|
||||
steps {
|
||||
script { mobile.runTests() }
|
||||
@ -53,19 +58,25 @@ pipeline {
|
||||
}
|
||||
}
|
||||
stage('Upload') {
|
||||
when { expression { params.BUILD_TYPE == 'release' } }
|
||||
steps {
|
||||
script { mobile.android.uploadToPlayStore() }
|
||||
script {
|
||||
switch (params.BUILD_TYPE) {
|
||||
case 'release':
|
||||
mobile.android.uploadToPlayStore(); break;
|
||||
case 'nightly':
|
||||
env.DIAWI_URL = mobile.android.uploadToDiawi()
|
||||
case 'e2e':
|
||||
e2eApk = mobile.android.uploadToSauceLabs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Run e2e') {
|
||||
when { expression { params.BUILD_TYPE == 'e2e' } }
|
||||
steps { script {
|
||||
mobile.android.uploadToDiawi()
|
||||
apk = mobile.android.uploadToSauceLabs()
|
||||
build(
|
||||
job: 'end-to-end-tests/status-app-nightly', wait: false,
|
||||
parameters: [string(name: 'apk', value: "--apk=${apk}")]
|
||||
parameters: [string(name: 'apk', value: "--apk=${e2eApk}")]
|
||||
)
|
||||
} }
|
||||
}
|
||||
|
@ -54,15 +54,18 @@ pipeline {
|
||||
apkUrl = cmn.uploadArtifact(findFiles(glob: "pkg/*.${params.BUILD_TYPE}.apk")[0].path)
|
||||
dmgUrl = cmn.uploadArtifact(findFiles(glob: 'pkg/*.dmg')[0].path)
|
||||
appUrl = cmn.uploadArtifact(findFiles(glob: 'pkg/*.AppImage')[0].path)
|
||||
/* special case for iOS Diawi link */
|
||||
/* special case for iOS Diawi links */
|
||||
ipaUrl = ios.getBuildVariables().get('DIAWI_URL')
|
||||
} }
|
||||
}
|
||||
stage('Notify') {
|
||||
steps {
|
||||
steps { script {
|
||||
slackSend(
|
||||
message: (
|
||||
"Build success! "+
|
||||
(CHANGE_ID != null ?
|
||||
"Build PR #${BRANCH_NAME}(${CHANGE_BRANCH}) success! " :
|
||||
"Build ${params.BUILD_TYPE} success! "
|
||||
)+
|
||||
"<${currentBuild.absoluteUrl}|${currentBuild.displayName}> "+
|
||||
"(${currentBuild.durationString})\n"+
|
||||
(params.BUILD_TYPE == 'nightly' ?
|
||||
@ -71,12 +74,15 @@ pipeline {
|
||||
"(<${e2eUrl}|e2e>), "+
|
||||
"<${ipaUrl}|iOS>, "+
|
||||
"<${dmgUrl}|MacOS>, "+
|
||||
"<${appUrl}|AppImage>"
|
||||
: '')
|
||||
"<${appUrl}|AppImage>" :
|
||||
"Packages: "+
|
||||
"<${dro.getBuildVariables().get('DIAWI_URL')}|Android>, "+
|
||||
"<${ios.getBuildVariables().get('DIAWI_URL')}|iOS>"
|
||||
)
|
||||
),
|
||||
color: 'good'
|
||||
)
|
||||
}
|
||||
} }
|
||||
}
|
||||
stage('Publish') {
|
||||
when { expression { params.BUILD_TYPE == 'nightly' } }
|
||||
|
@ -36,6 +36,11 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Lint') {
|
||||
steps {
|
||||
script { mobile.runLint() }
|
||||
}
|
||||
}
|
||||
stage('Tests') {
|
||||
steps {
|
||||
script { mobile.runTests() }
|
||||
|
@ -42,10 +42,8 @@ def uploadToSauceLabs() {
|
||||
withCredentials([
|
||||
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),
|
||||
string(credentialsId: 'SAUCE_USERNAME', variable: 'SAUCE_USERNAME'),
|
||||
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
|
||||
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
|
||||
]) {
|
||||
sh 'fastlane android saucelabs'
|
||||
sh 'bundle exec fastlane android saucelabs'
|
||||
}
|
||||
return env.SAUCE_LABS_APK
|
||||
}
|
||||
@ -53,14 +51,12 @@ def uploadToSauceLabs() {
|
||||
def uploadToDiawi() {
|
||||
env.SAUCE_LABS_APK = "im.status.ethereum-e2e-${GIT_COMMIT.take(6)}.apk"
|
||||
withCredentials([
|
||||
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),
|
||||
string(credentialsId: 'SAUCE_USERNAME', variable: 'SAUCE_USERNAME'),
|
||||
string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GITHUB_TOKEN'),
|
||||
string(credentialsId: 'SLACK_JENKINS_WEBHOOK', variable: 'SLACK_URL')
|
||||
string(credentialsId: 'diawi-token', variable: 'DIAWI_TOKEN'),
|
||||
]) {
|
||||
sh 'fastlane android saucelabs'
|
||||
sh 'bundle exec fastlane android upload_diawi'
|
||||
}
|
||||
return env.SAUCE_LABS_APK
|
||||
diawiUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
|
||||
return diawiUrl
|
||||
}
|
||||
|
||||
return this
|
||||
|
@ -18,7 +18,7 @@ def compile(type = 'nightly') {
|
||||
string(credentialsId: 'APPLE_ID', variable: 'APPLE_ID'),
|
||||
string(credentialsId: 'fastlane-match-password', variable:'MATCH_PASSWORD')
|
||||
]) {
|
||||
sh "fastlane ios ${target}"
|
||||
sh "bundle exec fastlane ios ${target}"
|
||||
}
|
||||
def pkg = common.pkgFilename(type, 'ipa')
|
||||
sh "cp status-adhoc/StatusIm.ipa ${pkg}"
|
||||
@ -28,10 +28,8 @@ def compile(type = 'nightly') {
|
||||
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'
|
||||
sh 'bundle exec fastlane ios upload_diawi'
|
||||
}
|
||||
diawiUrl = readFile "${env.WORKSPACE}/fastlane/diawi.out"
|
||||
return diawiUrl
|
||||
|
@ -21,6 +21,10 @@ def prep(type = 'nightly') {
|
||||
}
|
||||
}
|
||||
|
||||
def runLint() {
|
||||
sh 'lein cljfmt check'
|
||||
}
|
||||
|
||||
def runTests() {
|
||||
sh 'lein test-cljs'
|
||||
}
|
||||
|
@ -93,7 +93,6 @@ def notify_about_new_build(source, url)
|
||||
change_id = ENV["CHANGE_ID"]
|
||||
|
||||
unless change_id.nil?
|
||||
|
||||
github_api(
|
||||
server_url: "https://api.github.com",
|
||||
api_token: ENV["GITHUB_TOKEN"],
|
||||
@ -103,19 +102,21 @@ def notify_about_new_build(source, url)
|
||||
"body": msg
|
||||
}
|
||||
)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def upload_to_diawi_and_notify(source)
|
||||
def upload_to_diawi(source)
|
||||
diawi(
|
||||
token: ENV["DIAWI_TOKEN"],
|
||||
file: source
|
||||
)
|
||||
|
||||
File.write("diawi.out", lane_context[SharedValues::UPLOADED_FILE_LINK_TO_DIAWI])
|
||||
end
|
||||
|
||||
def upload_to_diawi_and_notify(source)
|
||||
upload_to_diawi(source)
|
||||
|
||||
notify_about_new_build(
|
||||
source,
|
||||
@ -218,9 +219,7 @@ platform :ios do
|
||||
desc "---"
|
||||
desc "Output: writes `fastlane/diawi.out` file url of the uploded file"
|
||||
lane :upload_diawi do
|
||||
upload_to_diawi_and_notify(
|
||||
"status-adhoc/StatusIm.ipa"
|
||||
)
|
||||
upload_to_diawi("status-adhoc/StatusIm.ipa")
|
||||
end
|
||||
|
||||
desc "This fastlane step is a workaround!"
|
||||
@ -284,9 +283,7 @@ platform :android do
|
||||
desc "---"
|
||||
desc "Output: writes `fastlane/diawi.out` file url of the uploded file"
|
||||
lane :upload_diawi do
|
||||
upload_to_diawi_and_notify(
|
||||
"android/app/build/outputs/apk/release/app-release.apk"
|
||||
)
|
||||
upload_to_diawi("android/app/build/outputs/apk/release/app-release.apk")
|
||||
end
|
||||
|
||||
desc "`fastlane android saucelabs` - upload .apk to sauce labs"
|
||||
|
Loading…
x
Reference in New Issue
Block a user