Timeout and abort Jenkins jobs after 90 minutes.
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
parent
1aae1a9645
commit
ff86ea7f95
|
@ -14,117 +14,119 @@ def installJSDeps() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node ('macos') {
|
timeout(90) {
|
||||||
def apkUrl = ''
|
node ('macos') {
|
||||||
def ipaUrl = ''
|
def apkUrl = ''
|
||||||
def testPassed = true
|
def ipaUrl = ''
|
||||||
def branch;
|
def testPassed = true
|
||||||
|
def branch;
|
||||||
|
|
||||||
load "$HOME/env.groovy"
|
load "$HOME/env.groovy"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
stage('Git & Dependencies') {
|
stage('Git & Dependencies') {
|
||||||
slackSend color: 'good', message: BRANCH_NAME + '(' + env.CHANGE_BRANCH + ') build started. ' + env.BUILD_URL
|
slackSend color: 'good', message: BRANCH_NAME + '(' + env.CHANGE_BRANCH + ') build started. ' + env.BUILD_URL
|
||||||
|
|
||||||
checkout scm
|
checkout scm
|
||||||
sh 'git rebase origin/develop'
|
sh 'git rebase origin/develop'
|
||||||
|
|
||||||
sh 'rm -rf node_modules'
|
sh 'rm -rf node_modules'
|
||||||
sh 'cp .env.jenkins .env'
|
sh 'cp .env.jenkins .env'
|
||||||
sh 'lein deps'
|
sh 'lein deps'
|
||||||
|
|
||||||
installJSDeps()
|
installJSDeps()
|
||||||
|
|
||||||
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
||||||
sh 'cd ios && pod install && cd ..'
|
sh 'cd ios && pod install && cd ..'
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Code style checks') {
|
stage('Code style checks') {
|
||||||
sh 'lein cljfmt check'
|
sh 'lein cljfmt check'
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Tests') {
|
stage('Tests') {
|
||||||
sh 'lein test-cljs'
|
sh 'lein test-cljs'
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
sh 'lein prod-build'
|
sh 'lein prod-build'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Android
|
// Android
|
||||||
stage('Build (Android)') {
|
stage('Build (Android)') {
|
||||||
sh 'cd android && ./gradlew assembleRelease'
|
sh 'cd android && ./gradlew assembleRelease'
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Deploy (Android)') {
|
stage('Deploy (Android)') {
|
||||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token'), string(credentialsId: 'GIT_HUB_TOKEN', variable: 'githubToken')] ) {
|
withCredentials([string(credentialsId: 'diawi-token', variable: 'token'), string(credentialsId: 'GIT_HUB_TOKEN', variable: 'githubToken')] ) {
|
||||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@android/app/build/outputs/apk/release/app-release.apk -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@android/app/build/outputs/apk/release/app-release.apk -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||||
sh 'sleep 10'
|
sh 'sleep 10'
|
||||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||||
apkUrl = 'https://i.diawi.com/' + hash
|
apkUrl = 'https://i.diawi.com/' + hash
|
||||||
|
|
||||||
def commentMsg = "apk uploaded to " + apkUrl + " for branch " + BRANCH_NAME
|
def commentMsg = "apk uploaded to " + apkUrl + " for branch " + BRANCH_NAME
|
||||||
def ghOutput = sh(returnStdout: true, script: "curl -u status-im:" + githubToken + " -H 'Content-Type: application/json' --data '{\"body\": \"" + commentMsg + "\"}' https://api.github.com/repos/status-im/status-react/issues/" + CHANGE_ID + "/comments")
|
def ghOutput = sh(returnStdout: true, script: "curl -u status-im:" + githubToken + " -H 'Content-Type: application/json' --data '{\"body\": \"" + commentMsg + "\"}' https://api.github.com/repos/status-im/status-react/issues/" + CHANGE_ID + "/comments")
|
||||||
println("Result of github comment curl: " + ghOutput)
|
println("Result of github comment curl: " + ghOutput)
|
||||||
|
|
||||||
sh ('echo ARTIFACT Android: ' + apkUrl)
|
sh ('echo ARTIFACT Android: ' + apkUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// iOS
|
||||||
|
stage('Build (iOS)') {
|
||||||
|
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
||||||
|
sh 'xcodebuild -exportArchive -exportPath status -archivePath status.xcarchive -exportOptionsPlist ~/archive.plist'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy (iOS)') {
|
||||||
|
withCredentials([string(credentialsId: 'diawi-token', variable: 'token'), string(credentialsId: 'GIT_HUB_TOKEN', variable: 'githubToken')]) {
|
||||||
|
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@status/StatusIm.ipa -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||||
|
sh 'sleep 10'
|
||||||
|
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||||
|
ipaUrl = 'https://i.diawi.com/' + hash
|
||||||
|
|
||||||
|
def commentMsg = "ipa uploaded to " + ipaUrl + " for branch " + BRANCH_NAME
|
||||||
|
def ghOutput = sh(returnStdout: true, script: "curl -u status-im:" + githubToken + " -H 'Content-Type: application/json' --data '{\"body\": \"" + commentMsg + "\"}' https://api.github.com/repos/status-im/status-react/issues/" + CHANGE_ID + "/comments")
|
||||||
|
println("Result of github comment curl: " + ghOutput)
|
||||||
|
|
||||||
|
sh ('echo ARTIFACT iOS: ' + ipaUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Slack Notification') {
|
||||||
|
def c = (testPassed ? 'good' : 'warning' )
|
||||||
|
|
||||||
|
slackSend color: c, message: 'Branch: ' + BRANCH_NAME +
|
||||||
|
'\nAndroid: ' + apkUrl +
|
||||||
|
'\niOS: ' + ipaUrl
|
||||||
|
}
|
||||||
|
|
||||||
|
// Android for e2e
|
||||||
|
stage('Build (Android) for e2e tests') {
|
||||||
|
sh 'cd android && mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/app-release.original.apk && ENVFILE=.env.e2e ./gradlew assembleRelease'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Upload apk for e2e tests') {
|
||||||
|
if (env.CHANGE_ID != null){
|
||||||
|
withCredentials([string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'key'), string(credentialsId: 'SAUCE_USERNAME', variable: 'username')]){
|
||||||
|
def apk_name = env.CHANGE_ID + '.apk'
|
||||||
|
sh('curl -u ' + username+ ':' + key + ' -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/' + username + '/' + apk_name + '?overwrite=true --data-binary @android/app/build/outputs/apk/release/app-release.apk')
|
||||||
|
}
|
||||||
|
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
||||||
|
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@android/app/build/outputs/apk/release/app-release.apk -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||||
|
sh 'sleep 10'
|
||||||
|
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||||
|
apkUrl = 'https://i.diawi.com/' + hash
|
||||||
|
|
||||||
|
sh ('echo ARTIFACT Android for e2e tests: ' + apkUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
slackSend color: 'bad', message: BRANCH_NAME + ' failed to build. ' + env.BUILD_URL
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// iOS
|
|
||||||
stage('Build (iOS)') {
|
|
||||||
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
|
||||||
sh 'xcodebuild -exportArchive -exportPath status -archivePath status.xcarchive -exportOptionsPlist ~/archive.plist'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Deploy (iOS)') {
|
|
||||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token'), string(credentialsId: 'GIT_HUB_TOKEN', variable: 'githubToken')]) {
|
|
||||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@status/StatusIm.ipa -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
|
||||||
sh 'sleep 10'
|
|
||||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
|
||||||
ipaUrl = 'https://i.diawi.com/' + hash
|
|
||||||
|
|
||||||
def commentMsg = "ipa uploaded to " + ipaUrl + " for branch " + BRANCH_NAME
|
|
||||||
def ghOutput = sh(returnStdout: true, script: "curl -u status-im:" + githubToken + " -H 'Content-Type: application/json' --data '{\"body\": \"" + commentMsg + "\"}' https://api.github.com/repos/status-im/status-react/issues/" + CHANGE_ID + "/comments")
|
|
||||||
println("Result of github comment curl: " + ghOutput)
|
|
||||||
|
|
||||||
sh ('echo ARTIFACT iOS: ' + ipaUrl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Slack Notification') {
|
|
||||||
def c = (testPassed ? 'good' : 'warning' )
|
|
||||||
|
|
||||||
slackSend color: c, message: 'Branch: ' + BRANCH_NAME +
|
|
||||||
'\nAndroid: ' + apkUrl +
|
|
||||||
'\niOS: ' + ipaUrl
|
|
||||||
}
|
|
||||||
|
|
||||||
// Android for e2e
|
|
||||||
stage('Build (Android) for e2e tests') {
|
|
||||||
sh 'cd android && mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/app-release.original.apk && ENVFILE=.env.e2e ./gradlew assembleRelease'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Upload apk for e2e tests') {
|
|
||||||
if (env.CHANGE_ID != null){
|
|
||||||
withCredentials([string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'key'), string(credentialsId: 'SAUCE_USERNAME', variable: 'username')]){
|
|
||||||
def apk_name = env.CHANGE_ID + '.apk'
|
|
||||||
sh('curl -u ' + username+ ':' + key + ' -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/' + username + '/' + apk_name + '?overwrite=true --data-binary @android/app/build/outputs/apk/release/app-release.apk')
|
|
||||||
}
|
|
||||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
|
||||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@android/app/build/outputs/apk/release/app-release.apk -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
|
||||||
sh 'sleep 10'
|
|
||||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
|
||||||
apkUrl = 'https://i.diawi.com/' + hash
|
|
||||||
|
|
||||||
sh ('echo ARTIFACT Android for e2e tests: ' + apkUrl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (e) {
|
|
||||||
slackSend color: 'bad', message: BRANCH_NAME + ' failed to build. ' + env.BUILD_URL
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,21 +2,24 @@ env.LANG="en_US.UTF-8"
|
||||||
env.LANGUAGE="en_US.UTF-8"
|
env.LANGUAGE="en_US.UTF-8"
|
||||||
env.LC_ALL="en_US.UTF-8"
|
env.LC_ALL="en_US.UTF-8"
|
||||||
|
|
||||||
node ('macos'){
|
|
||||||
|
|
||||||
stage('Git & Dependencies'){
|
timeout(90) {
|
||||||
|
node ('macos'){
|
||||||
|
|
||||||
checkout([$class: 'GitSCM', branches: [[name: 'develop']],
|
stage('Git & Dependencies'){
|
||||||
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']],
|
|
||||||
submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/status-im/status-react.git']]])
|
|
||||||
|
|
||||||
load "$HOME/env.groovy"
|
checkout([$class: 'GitSCM', branches: [[name: 'develop']],
|
||||||
}
|
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']],
|
||||||
|
submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/status-im/status-react.git']]])
|
||||||
stage('Clean Testflight Users'){
|
|
||||||
|
load "$HOME/env.groovy"
|
||||||
withCredentials([string(credentialsId: 'FASTLANE_PASSWORD', variable: 'FASTLANE_PASSWORD'),
|
}
|
||||||
string(credentialsId: 'APPLE_ID', variable: 'APPLE_ID')]) {
|
|
||||||
sh ('bundle install')
|
stage('Clean Testflight Users'){
|
||||||
sh ('bundle exec fastlane ios clean')}}
|
|
||||||
|
withCredentials([string(credentialsId: 'FASTLANE_PASSWORD', variable: 'FASTLANE_PASSWORD'),
|
||||||
|
string(credentialsId: 'APPLE_ID', variable: 'APPLE_ID')]) {
|
||||||
|
sh ('bundle install')
|
||||||
|
sh ('bundle exec fastlane ios clean')}}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,102 +17,104 @@ def installJSDeps() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node ('macos'){
|
timeout(90) {
|
||||||
def apkUrl = ''
|
node ('macos'){
|
||||||
def ipaUrl = ''
|
def apkUrl = ''
|
||||||
def testPassed = true
|
def ipaUrl = ''
|
||||||
|
def testPassed = true
|
||||||
|
|
||||||
load "$HOME/env.groovy"
|
load "$HOME/env.groovy"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
stage('Git & Dependencies') {
|
stage('Git & Dependencies') {
|
||||||
slackSend color: 'good', message: 'Nightly build started. ' + env.BUILD_URL
|
slackSend color: 'good', message: 'Nightly build started. ' + env.BUILD_URL
|
||||||
|
|
||||||
checkout scm
|
checkout scm
|
||||||
|
|
||||||
sh 'rm -rf node_modules'
|
sh 'rm -rf node_modules'
|
||||||
sh 'cp .env.jenkins .env'
|
sh 'cp .env.jenkins .env'
|
||||||
sh 'lein deps'
|
sh 'lein deps'
|
||||||
installJSDeps()
|
installJSDeps()
|
||||||
|
|
||||||
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
||||||
sh 'cd ios && pod install && cd ..'
|
sh 'cd ios && pod install && cd ..'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Tests') {
|
||||||
|
sh 'lein test-cljs'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
sh 'lein prod-build'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build (Android)') {
|
||||||
|
sh 'cd android && ./gradlew assembleRelease'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build (iOS)') {
|
||||||
|
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
||||||
|
sh 'xcodebuild -exportArchive -exportPath status -archivePath status.xcarchive -exportOptionsPlist ~/archive.plist'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy (Android)') {
|
||||||
|
def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/'
|
||||||
|
println (artifact_dir + 'app-release.apk')
|
||||||
|
sh ('ls -la ' + artifact_dir)
|
||||||
|
def artifact = (artifact_dir + 'app-release.apk')
|
||||||
|
def server = Artifactory.server('artifacts')
|
||||||
|
def shortCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(6)
|
||||||
|
def filename = 'im.status.ethereum-' + shortCommit + '.apk'
|
||||||
|
def newArtifact = (artifact_dir + filename)
|
||||||
|
sh ('mv ' + artifact + ' ' + newArtifact)
|
||||||
|
def uploadSpec = '{ "files": [ { "pattern": "*apk/release/' + filename + '", "target": "nightlies-local" }]}'
|
||||||
|
def buildInfo = server.upload(uploadSpec)
|
||||||
|
apkUrl = 'http://artifacts.status.im:8081/artifactory/nightlies-local/' + filename
|
||||||
|
|
||||||
|
sh ('echo ARTIFACT Android: ' + apkUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy (iOS)') {
|
||||||
|
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
||||||
|
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@status/StatusIm.ipa -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||||
|
sh 'sleep 10'
|
||||||
|
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||||
|
ipaUrl = 'https://i.diawi.com/' + hash
|
||||||
|
|
||||||
|
sh ('echo ARTIFACT iOS: ' + ipaUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
slackSend color: 'bad', message: 'Nightly build (develop) failed to build. ' + env.BUILD_URL
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Tests') {
|
stage('Slack Notification') {
|
||||||
sh 'lein test-cljs'
|
def c = (testPassed ? 'good' : 'warning' )
|
||||||
}
|
slackSend color: c, message: 'Nightly build (develop) \nTests: ' + (testPassed ? ':+1:' : ':-1:') + ')\nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl
|
||||||
|
build job: 'status-react/status-nightly-publish-link', parameters: [[$class: 'StringParameterValue', name: 'APK_URL', value: apkUrl], [$class: 'StringParameterValue', name: 'IOS_URL', value: ipaUrl]]
|
||||||
|
}
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build (Android) for e2e tests') {
|
||||||
sh 'lein prod-build'
|
sh 'cd android && mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/app-release.original.apk && ENVFILE=.env.e2e ./gradlew assembleRelease'
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build (Android)') {
|
stage('Upload apk for e2e tests') {
|
||||||
sh 'cd android && ./gradlew assembleRelease'
|
if (env.CHANGE_ID != null){
|
||||||
}
|
withCredentials([string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'key'), string(credentialsId: 'SAUCE_USERNAME', variable: 'username')]){
|
||||||
|
def apk_name = env.CHANGE_ID + '.apk'
|
||||||
|
sh('curl -u ' + username+ ':' + key + ' -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/' + username + '/' + apk_name + '?overwrite=true --data-binary @android/app/build/outputs/apk/release/app-release.apk')
|
||||||
|
}
|
||||||
|
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
||||||
|
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@android/app/build/outputs/apk/release/app-release.apk -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||||
|
sh 'sleep 10'
|
||||||
|
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||||
|
apkUrl = 'https://i.diawi.com/' + hash
|
||||||
|
|
||||||
stage('Build (iOS)') {
|
sh ('echo ARTIFACT Android for e2e tests: ' + apkUrl)
|
||||||
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
}
|
||||||
sh 'xcodebuild -exportArchive -exportPath status -archivePath status.xcarchive -exportOptionsPlist ~/archive.plist'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
stage('Deploy (Android)') {
|
|
||||||
def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/'
|
|
||||||
println (artifact_dir + 'app-release.apk')
|
|
||||||
sh ('ls -la ' + artifact_dir)
|
|
||||||
def artifact = (artifact_dir + 'app-release.apk')
|
|
||||||
def server = Artifactory.server('artifacts')
|
|
||||||
def shortCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(6)
|
|
||||||
def filename = 'im.status.ethereum-' + shortCommit + '.apk'
|
|
||||||
def newArtifact = (artifact_dir + filename)
|
|
||||||
sh ('mv ' + artifact + ' ' + newArtifact)
|
|
||||||
def uploadSpec = '{ "files": [ { "pattern": "*apk/release/' + filename + '", "target": "nightlies-local" }]}'
|
|
||||||
def buildInfo = server.upload(uploadSpec)
|
|
||||||
apkUrl = 'http://artifacts.status.im:8081/artifactory/nightlies-local/' + filename
|
|
||||||
|
|
||||||
sh ('echo ARTIFACT Android: ' + apkUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Deploy (iOS)') {
|
|
||||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
|
||||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@status/StatusIm.ipa -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
|
||||||
sh 'sleep 10'
|
|
||||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
|
||||||
ipaUrl = 'https://i.diawi.com/' + hash
|
|
||||||
|
|
||||||
sh ('echo ARTIFACT iOS: ' + ipaUrl)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
slackSend color: 'bad', message: 'Nightly build (develop) failed to build. ' + env.BUILD_URL
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Slack Notification') {
|
|
||||||
def c = (testPassed ? 'good' : 'warning' )
|
|
||||||
slackSend color: c, message: 'Nightly build (develop) \nTests: ' + (testPassed ? ':+1:' : ':-1:') + ')\nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl
|
|
||||||
build job: 'status-react/status-nightly-publish-link', parameters: [[$class: 'StringParameterValue', name: 'APK_URL', value: apkUrl], [$class: 'StringParameterValue', name: 'IOS_URL', value: ipaUrl]]
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build (Android) for e2e tests') {
|
|
||||||
sh 'cd android && mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/app-release.original.apk && ENVFILE=.env.e2e ./gradlew assembleRelease'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Upload apk for e2e tests') {
|
|
||||||
if (env.CHANGE_ID != null){
|
|
||||||
withCredentials([string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'key'), string(credentialsId: 'SAUCE_USERNAME', variable: 'username')]){
|
|
||||||
def apk_name = env.CHANGE_ID + '.apk'
|
|
||||||
sh('curl -u ' + username+ ':' + key + ' -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/' + username + '/' + apk_name + '?overwrite=true --data-binary @android/app/build/outputs/apk/release/app-release.apk')
|
|
||||||
}
|
|
||||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
|
||||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@android/app/build/outputs/apk/release/app-release.apk -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
|
||||||
sh 'sleep 10'
|
|
||||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
|
||||||
apkUrl = 'https://i.diawi.com/' + hash
|
|
||||||
|
|
||||||
sh ('echo ARTIFACT Android for e2e tests: ' + apkUrl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,120 +17,122 @@ def installJSDeps() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node ('macos'){
|
timeout(90) {
|
||||||
def apkUrl = ''
|
node ('macos'){
|
||||||
def ipaUrl = ''
|
def apkUrl = ''
|
||||||
def testPassed = true
|
def ipaUrl = ''
|
||||||
def latest_tag;
|
def testPassed = true
|
||||||
|
def latest_tag;
|
||||||
|
|
||||||
load "$HOME/env.groovy"
|
load "$HOME/env.groovy"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
stage('Git & Dependencies') {
|
stage('Git & Dependencies') {
|
||||||
slackSend color: 'good', message: 'Nightly build started. ' + env.BUILD_URL
|
slackSend color: 'good', message: 'Nightly build started. ' + env.BUILD_URL
|
||||||
|
|
||||||
checkout scm
|
checkout scm
|
||||||
|
|
||||||
sh 'git fetch --tags'
|
sh 'git fetch --tags'
|
||||||
latest_tag = sh(returnStdout: true, script: 'git describe --tags `git rev-list --tags=release --max-count=1`').trim()
|
latest_tag = sh(returnStdout: true, script: 'git describe --tags `git rev-list --tags=release --max-count=1`').trim()
|
||||||
sh 'rm -rf node_modules'
|
sh 'rm -rf node_modules'
|
||||||
sh 'cp .env.nightly .env'
|
sh 'cp .env.nightly .env'
|
||||||
sh 'lein deps'
|
sh 'lein deps'
|
||||||
installJSDeps()
|
installJSDeps()
|
||||||
|
|
||||||
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
||||||
sh 'cd ios && pod install && cd ..'
|
sh 'cd ios && pod install && cd ..'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Tests') {
|
||||||
|
sh 'lein test-cljs'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
sh 'lein prod-build'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build (Android)') {
|
||||||
|
sh 'cd android && ./gradlew assembleRelease'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build (iOS)') {
|
||||||
|
withCredentials([string(credentialsId: 'jenkins_pass', variable: 'password')]) {
|
||||||
|
def build_no = sh(returnStdout: true, script: 'git rev-list --count HEAD').trim()
|
||||||
|
sh ('plutil -replace CFBundleShortVersionString -string ' + latest_tag + ' ios/StatusIm/Info.plist')
|
||||||
|
sh ('plutil -replace CFBundleVersion -string ' + build_no + ' ios/StatusIm/Info.plist')
|
||||||
|
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
||||||
|
sh ('security unlock-keychain -p ' + password + ' login.keychain')
|
||||||
|
sh 'xcodebuild -exportArchive -exportPath status_appstore -archivePath status.xcarchive -exportOptionsPlist ~/archive-release.plist'
|
||||||
|
sh 'xcodebuild -exportArchive -exportPath status -archivePath status.xcarchive -exportOptionsPlist ~/archive.plist'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy (Android)') {
|
||||||
|
def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/'
|
||||||
|
println (artifact_dir + 'app-release.apk')
|
||||||
|
def artifact = (artifact_dir + 'app-release.apk')
|
||||||
|
def server = Artifactory.server('artifacts')
|
||||||
|
shortCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(6)
|
||||||
|
def filename = 'im.status.ethereum-' + shortCommit + '.apk'
|
||||||
|
def newArtifact = (artifact_dir + filename)
|
||||||
|
sh ('cp ' + artifact + ' ' + newArtifact)
|
||||||
|
def uploadSpec = '{ "files": [ { "pattern": "*apk/release/' + filename + '", "target": "nightlies-local" }]}'
|
||||||
|
def buildInfo = server.upload(uploadSpec)
|
||||||
|
apkUrl = 'http://artifacts.status.im:8081/artifactory/nightlies-local/' + filename
|
||||||
|
|
||||||
|
//todo: handle version differently instead of exit 0
|
||||||
|
sh ('bundle exec fastlane android nightly || exit 0')
|
||||||
|
sh ('echo ARTIFACT Android: ' + apkUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy (iOS)') {
|
||||||
|
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
||||||
|
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@status/StatusIm.ipa -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||||
|
sh 'sleep 10'
|
||||||
|
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||||
|
ipaUrl = 'https://i.diawi.com/' + hash
|
||||||
|
|
||||||
|
//todo: handle version differently instead of exit 0
|
||||||
|
sh ('bundle exec fastlane ios nightly || exit 0')
|
||||||
|
sh ('echo ARTIFACT iOS: ' + ipaUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
slackSend color: 'bad', message: 'Nightly build (develop) failed to build. ' + env.BUILD_URL
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Tests') {
|
stage('Run status-nightly-publish-link job') {
|
||||||
sh 'lein test-cljs'
|
build job: 'status-react/status-nightly-publish-link', parameters: [[$class: 'StringParameterValue', name: 'APK_URL', value: apkUrl], [$class: 'StringParameterValue', name: 'IOS_URL', value: ipaUrl]]
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build (Android) for e2e tests') {
|
||||||
sh 'lein prod-build'
|
sh 'cd android && mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/app-release.original.apk && ENVFILE=.env.e2e ./gradlew assembleRelease'
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build (Android)') {
|
stage('Upload apk for e2e tests') {
|
||||||
sh 'cd android && ./gradlew assembleRelease'
|
withCredentials([string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'key'), string(credentialsId: 'SAUCE_USERNAME', variable: 'username')]){
|
||||||
}
|
apk_name = 'im.status.ethereum-e2e-' + shortCommit + '.apk'
|
||||||
|
sh('curl -u ' + username+ ':' + key + ' -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/' + username + '/' + apk_name + '?overwrite=true --data-binary @android/app/build/outputs/apk/release/app-release.apk')
|
||||||
|
}
|
||||||
|
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
||||||
|
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@android/app/build/outputs/apk/release/app-release.apk -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||||
|
sh 'sleep 10'
|
||||||
|
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||||
|
testApkUrl = 'https://i.diawi.com/' + hash
|
||||||
|
|
||||||
stage('Build (iOS)') {
|
sh ('echo ARTIFACT Android for e2e tests: ' + testApkUrl)
|
||||||
withCredentials([string(credentialsId: 'jenkins_pass', variable: 'password')]) {
|
}
|
||||||
def build_no = sh(returnStdout: true, script: 'git rev-list --count HEAD').trim()
|
}
|
||||||
sh ('plutil -replace CFBundleShortVersionString -string ' + latest_tag + ' ios/StatusIm/Info.plist')
|
|
||||||
sh ('plutil -replace CFBundleVersion -string ' + build_no + ' ios/StatusIm/Info.plist')
|
stage('Slack Notification') {
|
||||||
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
def c = (testPassed ? 'good' : 'warning' )
|
||||||
sh ('security unlock-keychain -p ' + password + ' login.keychain')
|
slackSend color: c, message: 'Nightly build (develop) \nTests: ' + (testPassed ? ':+1:' : ':-1:') + ')\nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl + '\n Android for e2e: ' + testApkUrl
|
||||||
sh 'xcodebuild -exportArchive -exportPath status_appstore -archivePath status.xcarchive -exportOptionsPlist ~/archive-release.plist'
|
}
|
||||||
sh 'xcodebuild -exportArchive -exportPath status -archivePath status.xcarchive -exportOptionsPlist ~/archive.plist'
|
|
||||||
|
stage('Run extended e2e tests') {
|
||||||
|
build job: 'end-to-end-tests/status-app-nightly', parameters: [string(name: 'apk', value: '--apk=' + apk_name)], wait: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Deploy (Android)') {
|
|
||||||
def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/'
|
|
||||||
println (artifact_dir + 'app-release.apk')
|
|
||||||
def artifact = (artifact_dir + 'app-release.apk')
|
|
||||||
def server = Artifactory.server('artifacts')
|
|
||||||
shortCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(6)
|
|
||||||
def filename = 'im.status.ethereum-' + shortCommit + '.apk'
|
|
||||||
def newArtifact = (artifact_dir + filename)
|
|
||||||
sh ('cp ' + artifact + ' ' + newArtifact)
|
|
||||||
def uploadSpec = '{ "files": [ { "pattern": "*apk/release/' + filename + '", "target": "nightlies-local" }]}'
|
|
||||||
def buildInfo = server.upload(uploadSpec)
|
|
||||||
apkUrl = 'http://artifacts.status.im:8081/artifactory/nightlies-local/' + filename
|
|
||||||
|
|
||||||
//todo: handle version differently instead of exit 0
|
|
||||||
sh ('bundle exec fastlane android nightly || exit 0')
|
|
||||||
sh ('echo ARTIFACT Android: ' + apkUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Deploy (iOS)') {
|
|
||||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
|
||||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@status/StatusIm.ipa -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
|
||||||
sh 'sleep 10'
|
|
||||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
|
||||||
ipaUrl = 'https://i.diawi.com/' + hash
|
|
||||||
|
|
||||||
//todo: handle version differently instead of exit 0
|
|
||||||
sh ('bundle exec fastlane ios nightly || exit 0')
|
|
||||||
sh ('echo ARTIFACT iOS: ' + ipaUrl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
slackSend color: 'bad', message: 'Nightly build (develop) failed to build. ' + env.BUILD_URL
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Run status-nightly-publish-link job') {
|
|
||||||
build job: 'status-react/status-nightly-publish-link', parameters: [[$class: 'StringParameterValue', name: 'APK_URL', value: apkUrl], [$class: 'StringParameterValue', name: 'IOS_URL', value: ipaUrl]]
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build (Android) for e2e tests') {
|
|
||||||
sh 'cd android && mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/app-release.original.apk && ENVFILE=.env.e2e ./gradlew assembleRelease'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Upload apk for e2e tests') {
|
|
||||||
withCredentials([string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'key'), string(credentialsId: 'SAUCE_USERNAME', variable: 'username')]){
|
|
||||||
apk_name = 'im.status.ethereum-e2e-' + shortCommit + '.apk'
|
|
||||||
sh('curl -u ' + username+ ':' + key + ' -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/' + username + '/' + apk_name + '?overwrite=true --data-binary @android/app/build/outputs/apk/release/app-release.apk')
|
|
||||||
}
|
|
||||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
|
||||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@android/app/build/outputs/apk/release/app-release.apk -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
|
||||||
sh 'sleep 10'
|
|
||||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
|
||||||
testApkUrl = 'https://i.diawi.com/' + hash
|
|
||||||
|
|
||||||
sh ('echo ARTIFACT Android for e2e tests: ' + testApkUrl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Run extended e2e tests') {
|
|
||||||
build job: 'end-to-end-tests/status-app-nightly', parameters: [string(name: 'apk', value: '--apk=' + apk_name)], wait: false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,112 +14,114 @@ def installJSDeps() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node ('macos') {
|
timeout(90) {
|
||||||
def apkUrl = ''
|
node ('macos') {
|
||||||
def ipaUrl = ''
|
def apkUrl = ''
|
||||||
def testPassed = true
|
def ipaUrl = ''
|
||||||
def branch;
|
def testPassed = true
|
||||||
|
def branch;
|
||||||
|
|
||||||
load "$HOME/env.groovy"
|
load "$HOME/env.groovy"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
stage('Git & Dependencies') {
|
stage('Git & Dependencies') {
|
||||||
slackSend color: 'good', message: REPO + ":" + BRANCH_NAME + ' build started. ' + env.BUILD_URL
|
slackSend color: 'good', message: REPO + ":" + BRANCH_NAME + ' build started. ' + env.BUILD_URL
|
||||||
|
|
||||||
checkout scm
|
checkout scm
|
||||||
|
|
||||||
sh 'rm -rf node_modules'
|
sh 'rm -rf node_modules'
|
||||||
|
|
||||||
sh 'test ${JENKINS_REBASE_DEVELOP} -eq 1 && git rebase origin/develop || echo "Not rebasing on develop."'
|
sh 'test ${JENKINS_REBASE_DEVELOP} -eq 1 && git rebase origin/develop || echo "Not rebasing on develop."'
|
||||||
|
|
||||||
// Assume all parameters are set in Jenkins 'Parameterized build'
|
// Assume all parameters are set in Jenkins 'Parameterized build'
|
||||||
// TODO(oskarth): Consider read/write from .env to avoid having to specify in Jenkins again
|
// TODO(oskarth): Consider read/write from .env to avoid having to specify in Jenkins again
|
||||||
// sh 'cp .env.jenkins .env'
|
// sh 'cp .env.jenkins .env'
|
||||||
sh 'echo TESTFAIRY_ENABLED=' + TESTFAIRY_ENABLED + '>>' + '.env'
|
sh 'echo TESTFAIRY_ENABLED=' + TESTFAIRY_ENABLED + '>>' + '.env'
|
||||||
sh 'echo STUB_STATUS_GO=' + STUB_STATUS_GO + '>>' + '.env'
|
sh 'echo STUB_STATUS_GO=' + STUB_STATUS_GO + '>>' + '.env'
|
||||||
sh 'echo ETHEREUM_DEV_CLUSTER=' + ETHEREUM_DEV_CLUSTER + '>>' + '.env'
|
sh 'echo ETHEREUM_DEV_CLUSTER=' + ETHEREUM_DEV_CLUSTER + '>>' + '.env'
|
||||||
sh 'echo MAINNET_NETWORKS_ENABLED=' + MAINNET_NETWORKS_ENABLED + '>>' + '.env'
|
sh 'echo MAINNET_NETWORKS_ENABLED=' + MAINNET_NETWORKS_ENABLED + '>>' + '.env'
|
||||||
sh 'echo LOG_LEVEL=' + LOG_LEVEL + '>>' + '.env'
|
sh 'echo LOG_LEVEL=' + LOG_LEVEL + '>>' + '.env'
|
||||||
sh 'echo LOG_LEVEL_STATUS_GO=' + LOG_LEVEL_STATUS_GO + '>>' + '.env'
|
sh 'echo LOG_LEVEL_STATUS_GO=' + LOG_LEVEL_STATUS_GO + '>>' + '.env'
|
||||||
sh 'echo OFFLINE_INBOX_ENABLED=' + OFFLINE_INBOX_ENABLED + '>>' + '.env'
|
sh 'echo OFFLINE_INBOX_ENABLED=' + OFFLINE_INBOX_ENABLED + '>>' + '.env'
|
||||||
sh 'echo POW_TARGET=' + POW_TARGET + '>>' + '.env'
|
sh 'echo POW_TARGET=' + POW_TARGET + '>>' + '.env'
|
||||||
sh 'echo POW_TIME=' + POW_TIME + '>>' + '.env'
|
sh 'echo POW_TIME=' + POW_TIME + '>>' + '.env'
|
||||||
sh 'echo MAINNET_WARNING_ENABLED=' + MAINNET_WARNING_ENABLED + '>>' + '.env'
|
sh 'echo MAINNET_WARNING_ENABLED=' + MAINNET_WARNING_ENABLED + '>>' + '.env'
|
||||||
sh 'echo DEFAULT_NETWORK=' + DEFAULT_NETWORK + '>>' + '.env'
|
sh 'echo DEFAULT_NETWORK=' + DEFAULT_NETWORK + '>>' + '.env'
|
||||||
|
|
||||||
sh 'echo "**********************************************************************"'
|
sh 'echo "**********************************************************************"'
|
||||||
sh 'echo PARAMETERIZED BUILD - USING CUSTOM ENVIRONMENT'
|
sh 'echo PARAMETERIZED BUILD - USING CUSTOM ENVIRONMENT'
|
||||||
sh 'cat .env'
|
sh 'cat .env'
|
||||||
sh 'echo "**********************************************************************"'
|
sh 'echo "**********************************************************************"'
|
||||||
|
|
||||||
sh 'lein deps'
|
sh 'lein deps'
|
||||||
installJSDeps()
|
installJSDeps()
|
||||||
|
|
||||||
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
||||||
sh 'cd ios && pod install && cd ..'
|
sh 'cd ios && pod install && cd ..'
|
||||||
}
|
|
||||||
|
|
||||||
stage('Tests') {
|
|
||||||
sh 'lein test-cljs'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build') {
|
|
||||||
sh 'lein prod-build'
|
|
||||||
}
|
|
||||||
|
|
||||||
// Android
|
|
||||||
stage('Build (Android)') {
|
|
||||||
sh 'cd android && ./gradlew assembleRelease'
|
|
||||||
}
|
}
|
||||||
stage('Deploy (Android)') {
|
|
||||||
|
stage('Tests') {
|
||||||
|
sh 'lein test-cljs'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
sh 'lein prod-build'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Android
|
||||||
|
stage('Build (Android)') {
|
||||||
|
sh 'cd android && ./gradlew assembleRelease'
|
||||||
|
}
|
||||||
|
stage('Deploy (Android)') {
|
||||||
|
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
||||||
|
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@android/app/build/outputs/apk/release/app-release.apk -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||||
|
sh 'sleep 10'
|
||||||
|
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||||
|
apkUrl = 'https://i.diawi.com/' + hash
|
||||||
|
|
||||||
|
sh ('echo ARTIFACT Android: ' + apkUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// try {
|
||||||
|
// stage('Test (Android)') {
|
||||||
|
// sauce('b9aded57-5cc1-4f6b-b5ea-42d989987852') {
|
||||||
|
// sh 'cd test/appium && mvn -DapkUrl=' + apkUrl + ' test'
|
||||||
|
// saucePublisher()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } catch(e) {
|
||||||
|
// testPassed = false
|
||||||
|
// }
|
||||||
|
|
||||||
|
// iOS
|
||||||
|
stage('Build (iOS)') {
|
||||||
|
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
||||||
|
sh 'xcodebuild -exportArchive -exportPath status -archivePath status.xcarchive -exportOptionsPlist ~/archive.plist'
|
||||||
|
}
|
||||||
|
stage('Deploy (iOS)') {
|
||||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
||||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@android/app/build/outputs/apk/release/app-release.apk -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@status/StatusIm.ipa -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||||
sh 'sleep 10'
|
sh 'sleep 10'
|
||||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||||
apkUrl = 'https://i.diawi.com/' + hash
|
ipaUrl = 'https://i.diawi.com/' + hash
|
||||||
|
|
||||||
|
sh ('echo ARTIFACT iOS: ' + ipaUrl)
|
||||||
|
|
||||||
sh ('echo ARTIFACT Android: ' + apkUrl)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// try {
|
stage('Slack Notification') {
|
||||||
// stage('Test (Android)') {
|
def c = (testPassed ? 'good' : 'warning' )
|
||||||
// sauce('b9aded57-5cc1-4f6b-b5ea-42d989987852') {
|
slackSend color: c, message: 'Branch: ' + REPO + ":" + BRANCH_NAME +
|
||||||
// sh 'cd test/appium && mvn -DapkUrl=' + apkUrl + ' test'
|
'\nAndroid: ' + apkUrl +
|
||||||
// saucePublisher()
|
'\niOS: ' + ipaUrl
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } catch(e) {
|
|
||||||
// testPassed = false
|
|
||||||
// }
|
|
||||||
|
|
||||||
// iOS
|
|
||||||
stage('Build (iOS)') {
|
|
||||||
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
|
||||||
sh 'xcodebuild -exportArchive -exportPath status -archivePath status.xcarchive -exportOptionsPlist ~/archive.plist'
|
|
||||||
}
|
|
||||||
stage('Deploy (iOS)') {
|
|
||||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
|
||||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@status/StatusIm.ipa -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
|
||||||
sh 'sleep 10'
|
|
||||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
|
||||||
ipaUrl = 'https://i.diawi.com/' + hash
|
|
||||||
|
|
||||||
sh ('echo ARTIFACT iOS: ' + ipaUrl)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
stage('Slack Notification') {
|
} catch (e) {
|
||||||
def c = (testPassed ? 'good' : 'warning' )
|
slackSend color: 'bad', message: REPO + ":" + BRANCH_NAME + ' failed to build. ' + env.BUILD_URL
|
||||||
slackSend color: c, message: 'Branch: ' + REPO + ":" + BRANCH_NAME +
|
throw e
|
||||||
'\nAndroid: ' + apkUrl +
|
}
|
||||||
'\niOS: ' + ipaUrl
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
|
||||||
slackSend color: 'bad', message: REPO + ":" + BRANCH_NAME + ' failed to build. ' + env.BUILD_URL
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,104 +17,106 @@ def installJSDeps() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node ('macos'){
|
timeout(90) {
|
||||||
def apkUrl = ''
|
node ('macos'){
|
||||||
def ipaUrl = ''
|
def apkUrl = ''
|
||||||
def testPassed = true
|
def ipaUrl = ''
|
||||||
def version
|
def testPassed = true
|
||||||
|
def version
|
||||||
|
|
||||||
load "$HOME/env.groovy"
|
load "$HOME/env.groovy"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
stage('Git & Dependencies') {
|
stage('Git & Dependencies') {
|
||||||
slackSend color: 'good', message: BRANCH_NAME + ' build started. ' + env.BUILD_URL
|
slackSend color: 'good', message: BRANCH_NAME + ' build started. ' + env.BUILD_URL
|
||||||
|
|
||||||
if (!BRANCH_NAME.startsWith("release/")){
|
if (!BRANCH_NAME.startsWith("release/")){
|
||||||
error "Wrong branch name format: " + BRANCH_NAME + ", but it should be `release/version`"
|
error "Wrong branch name format: " + BRANCH_NAME + ", but it should be `release/version`"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkout scm
|
||||||
|
|
||||||
|
version = BRANCH_NAME.substring(8)
|
||||||
|
sh 'echo "' + version + '" > .version'
|
||||||
|
|
||||||
|
sh 'git fetch --tags'
|
||||||
|
|
||||||
|
sh 'rm -rf node_modules'
|
||||||
|
sh 'cp .env.prod .env'
|
||||||
|
sh 'lein deps'
|
||||||
|
installJSDeps()
|
||||||
|
|
||||||
|
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
||||||
|
sh 'cd ios && pod install && cd ..'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Tests') {
|
||||||
|
sh 'lein test-cljs'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
sh 'lein prod-build'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build (Android)') {
|
||||||
|
sh 'cd android && ./gradlew assembleRelease -PreleaseVersion=' + version
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build (iOS)') {
|
||||||
|
def build_no = sh(returnStdout: true, script: './build_no.sh --tag').trim()
|
||||||
|
sh ('plutil -replace CFBundleShortVersionString -string ' + version + ' ios/StatusIm/Info.plist')
|
||||||
|
sh ('plutil -replace CFBundleVersion -string ' + build_no + ' ios/StatusIm/Info.plist')
|
||||||
|
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
||||||
|
sh 'xcodebuild -exportArchive -exportPath status -archivePath status.xcarchive -exportOptionsPlist ~/archive.plist'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy (Android)') {
|
||||||
|
def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/'
|
||||||
|
println (artifact_dir + 'app-release.apk')
|
||||||
|
sh ('ls -la ' + artifact_dir)
|
||||||
|
def artifact = (artifact_dir + 'app-release.apk')
|
||||||
|
def server = Artifactory.server('artifacts')
|
||||||
|
def shortCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(6)
|
||||||
|
def filename = 'im.status.ethereum-' + shortCommit + '.apk'
|
||||||
|
def newArtifact = (artifact_dir + filename)
|
||||||
|
sh ('mv ' + artifact + ' ' + newArtifact)
|
||||||
|
def uploadSpec = '{ "files": [ { "pattern": "*apk/release/' + filename + '", "target": "nightlies-local" }]}'
|
||||||
|
def buildInfo = server.upload(uploadSpec)
|
||||||
|
apkUrl = 'http://artifacts.status.im:8081/artifactory/nightlies-local/' + filename
|
||||||
|
|
||||||
|
sh ('echo ARTIFACT Android: ' + apkUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy (iOS)') {
|
||||||
|
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
||||||
|
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@status/StatusIm.ipa -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
||||||
|
sh 'sleep 10'
|
||||||
|
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
||||||
|
ipaUrl = 'https://i.diawi.com/' + hash
|
||||||
|
|
||||||
|
sh ('echo ARTIFACT iOS: ' + ipaUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Push build tag') {
|
||||||
|
withCredentials([[
|
||||||
|
$class: 'UsernamePasswordMultiBinding',
|
||||||
|
credentialsId: 'jenkins-status-im',
|
||||||
|
usernameVariable: 'GIT_USER',
|
||||||
|
passwordVariable: 'GIT_PASS'
|
||||||
|
]]) {
|
||||||
|
sh ('git push --tags https://${GIT_USER}:${GIT_PASS}@github.com/status-im/status-react --tags')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
slackSend color: 'bad', message: 'Release build failed to build. ' + env.BUILD_URL
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
|
|
||||||
checkout scm
|
stage('Slack Notification') {
|
||||||
|
def c = (testPassed ? 'good' : 'warning' )
|
||||||
version = BRANCH_NAME.substring(8)
|
slackSend color: c, message: 'Release build \nTests: ' + (testPassed ? ':+1:' : ':-1:') + ')\nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl
|
||||||
sh 'echo "' + version + '" > .version'
|
|
||||||
|
|
||||||
sh 'git fetch --tags'
|
|
||||||
|
|
||||||
sh 'rm -rf node_modules'
|
|
||||||
sh 'cp .env.prod .env'
|
|
||||||
sh 'lein deps'
|
|
||||||
installJSDeps()
|
|
||||||
|
|
||||||
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
|
||||||
sh 'cd ios && pod install && cd ..'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Tests') {
|
|
||||||
sh 'lein test-cljs'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build') {
|
|
||||||
sh 'lein prod-build'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build (Android)') {
|
|
||||||
sh 'cd android && ./gradlew assembleRelease -PreleaseVersion=' + version
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build (iOS)') {
|
|
||||||
def build_no = sh(returnStdout: true, script: './build_no.sh --tag').trim()
|
|
||||||
sh ('plutil -replace CFBundleShortVersionString -string ' + version + ' ios/StatusIm/Info.plist')
|
|
||||||
sh ('plutil -replace CFBundleVersion -string ' + build_no + ' ios/StatusIm/Info.plist')
|
|
||||||
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
|
||||||
sh 'xcodebuild -exportArchive -exportPath status -archivePath status.xcarchive -exportOptionsPlist ~/archive.plist'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Deploy (Android)') {
|
|
||||||
def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/'
|
|
||||||
println (artifact_dir + 'app-release.apk')
|
|
||||||
sh ('ls -la ' + artifact_dir)
|
|
||||||
def artifact = (artifact_dir + 'app-release.apk')
|
|
||||||
def server = Artifactory.server('artifacts')
|
|
||||||
def shortCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim().take(6)
|
|
||||||
def filename = 'im.status.ethereum-' + shortCommit + '.apk'
|
|
||||||
def newArtifact = (artifact_dir + filename)
|
|
||||||
sh ('mv ' + artifact + ' ' + newArtifact)
|
|
||||||
def uploadSpec = '{ "files": [ { "pattern": "*apk/release/' + filename + '", "target": "nightlies-local" }]}'
|
|
||||||
def buildInfo = server.upload(uploadSpec)
|
|
||||||
apkUrl = 'http://artifacts.status.im:8081/artifactory/nightlies-local/' + filename
|
|
||||||
|
|
||||||
sh ('echo ARTIFACT Android: ' + apkUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Deploy (iOS)') {
|
|
||||||
withCredentials([string(credentialsId: 'diawi-token', variable: 'token')]) {
|
|
||||||
def job = sh(returnStdout: true, script: 'curl https://upload.diawi.com/ -F token='+token+' -F file=@status/StatusIm.ipa -F find_by_udid=0 -F wall_of_apps=0 | jq -r ".job"').trim()
|
|
||||||
sh 'sleep 10'
|
|
||||||
def hash = sh(returnStdout: true, script: "curl -vvv 'https://upload.diawi.com/status?token="+token+"&job="+job+"'|jq -r '.hash'").trim()
|
|
||||||
ipaUrl = 'https://i.diawi.com/' + hash
|
|
||||||
|
|
||||||
sh ('echo ARTIFACT iOS: ' + ipaUrl)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Push build tag') {
|
|
||||||
withCredentials([[
|
|
||||||
$class: 'UsernamePasswordMultiBinding',
|
|
||||||
credentialsId: 'jenkins-status-im',
|
|
||||||
usernameVariable: 'GIT_USER',
|
|
||||||
passwordVariable: 'GIT_PASS'
|
|
||||||
]]) {
|
|
||||||
sh ('git push --tags https://${GIT_USER}:${GIT_PASS}@github.com/status-im/status-react --tags')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
slackSend color: 'bad', message: 'Release build failed to build. ' + env.BUILD_URL
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Slack Notification') {
|
|
||||||
def c = (testPassed ? 'good' : 'warning' )
|
|
||||||
slackSend color: c, message: 'Release build \nTests: ' + (testPassed ? ':+1:' : ':-1:') + ')\nAndroid: ' + apkUrl + '\n iOS: ' + ipaUrl
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,87 +17,89 @@ def installJSDeps() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node ('macos'){
|
timeout(90) {
|
||||||
def apkUrl = ''
|
node ('macos'){
|
||||||
def ipaUrl = ''
|
def apkUrl = ''
|
||||||
def testPassed = true
|
def ipaUrl = ''
|
||||||
def version
|
def testPassed = true
|
||||||
|
def version
|
||||||
|
|
||||||
load "$HOME/env.groovy"
|
load "$HOME/env.groovy"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
stage('Git & Dependencies') {
|
stage('Git & Dependencies') {
|
||||||
slackSend color: 'good', message: BRANCH_NAME + ' build started. ' + env.BUILD_URL
|
slackSend color: 'good', message: BRANCH_NAME + ' build started. ' + env.BUILD_URL
|
||||||
|
|
||||||
if (!BRANCH_NAME.startsWith("release/")){
|
if (!BRANCH_NAME.startsWith("release/")){
|
||||||
error "Wrong branch name format: " + BRANCH_NAME + ", but it should be `release/version`"
|
error "Wrong branch name format: " + BRANCH_NAME + ", but it should be `release/version`"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkout scm
|
||||||
|
|
||||||
|
version = BRANCH_NAME.substring(8)
|
||||||
|
sh 'echo "' + version + '" > .version'
|
||||||
|
|
||||||
|
sh 'git fetch --tags'
|
||||||
|
|
||||||
|
sh 'rm -rf node_modules'
|
||||||
|
sh 'cp .env.prod .env'
|
||||||
|
sh 'lein deps'
|
||||||
|
installJSDeps()
|
||||||
|
|
||||||
|
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
||||||
|
sh 'cd ios && pod install && cd ..'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Tests') {
|
||||||
|
sh 'lein test-cljs'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
sh 'lein prod-build'
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build (Android)') {
|
||||||
|
sh 'cd android && ./gradlew assembleRelease -PreleaseVersion=' + version
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build (iOS)') {
|
||||||
|
withCredentials([string(credentialsId: 'jenkins_pass', variable: 'password')]) {
|
||||||
|
def build_no = sh(returnStdout: true, script: './build_no.sh --tag').trim()
|
||||||
|
sh ('plutil -replace CFBundleShortVersionString -string ' + version + ' ios/StatusIm/Info.plist')
|
||||||
|
sh ('plutil -replace CFBundleVersion -string ' + build_no + ' ios/StatusIm/Info.plist')
|
||||||
|
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
||||||
|
sh ('security unlock-keychain -p ' + password + ' login.keychain')
|
||||||
|
sh 'xcodebuild -exportArchive -exportPath status_appstore -archivePath status.xcarchive -exportOptionsPlist ~/archive-release.plist'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy (Android)') {
|
||||||
|
sh ('bundle exec fastlane android release || exit 0')
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy (iOS)') {
|
||||||
|
sh ('bundle exec fastlane ios release || exit 0')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
stage('Push build tag') {
|
||||||
|
withCredentials([[
|
||||||
|
$class: 'UsernamePasswordMultiBinding',
|
||||||
|
credentialsId: 'jenkins-status-im',
|
||||||
|
usernameVariable: 'GIT_USER',
|
||||||
|
passwordVariable: 'GIT_PASS'
|
||||||
|
]]) {
|
||||||
|
sh ('git push --tags https://${GIT_USER}:${GIT_PASS}@github.com/status-im/status-react --tags')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
slackSend color: 'bad', message: 'Release build failed uploading to iTC/Play Market. ' + env.BUILD_URL
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
|
|
||||||
checkout scm
|
stage('Slack Notification') {
|
||||||
|
slackSend color: 'good', message: 'Release build ' + version + ' succesfully aploade to iTC/Play Market'
|
||||||
version = BRANCH_NAME.substring(8)
|
|
||||||
sh 'echo "' + version + '" > .version'
|
|
||||||
|
|
||||||
sh 'git fetch --tags'
|
|
||||||
|
|
||||||
sh 'rm -rf node_modules'
|
|
||||||
sh 'cp .env.prod .env'
|
|
||||||
sh 'lein deps'
|
|
||||||
installJSDeps()
|
|
||||||
|
|
||||||
sh 'mvn -f modules/react-native-status/ios/RCTStatus dependency:unpack'
|
|
||||||
sh 'cd ios && pod install && cd ..'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Tests') {
|
|
||||||
sh 'lein test-cljs'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build') {
|
|
||||||
sh 'lein prod-build'
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build (Android)') {
|
|
||||||
sh 'cd android && ./gradlew assembleRelease -PreleaseVersion=' + version
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build (iOS)') {
|
|
||||||
withCredentials([string(credentialsId: 'jenkins_pass', variable: 'password')]) {
|
|
||||||
def build_no = sh(returnStdout: true, script: './build_no.sh --tag').trim()
|
|
||||||
sh ('plutil -replace CFBundleShortVersionString -string ' + version + ' ios/StatusIm/Info.plist')
|
|
||||||
sh ('plutil -replace CFBundleVersion -string ' + build_no + ' ios/StatusIm/Info.plist')
|
|
||||||
sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive'
|
|
||||||
sh ('security unlock-keychain -p ' + password + ' login.keychain')
|
|
||||||
sh 'xcodebuild -exportArchive -exportPath status_appstore -archivePath status.xcarchive -exportOptionsPlist ~/archive-release.plist'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Deploy (Android)') {
|
|
||||||
sh ('bundle exec fastlane android release || exit 0')
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Deploy (iOS)') {
|
|
||||||
sh ('bundle exec fastlane ios release || exit 0')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
stage('Push build tag') {
|
|
||||||
withCredentials([[
|
|
||||||
$class: 'UsernamePasswordMultiBinding',
|
|
||||||
credentialsId: 'jenkins-status-im',
|
|
||||||
usernameVariable: 'GIT_USER',
|
|
||||||
passwordVariable: 'GIT_PASS'
|
|
||||||
]]) {
|
|
||||||
sh ('git push --tags https://${GIT_USER}:${GIT_PASS}@github.com/status-im/status-react --tags')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
slackSend color: 'bad', message: 'Release build failed uploading to iTC/Play Market. ' + env.BUILD_URL
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Slack Notification') {
|
|
||||||
slackSend color: 'good', message: 'Release build ' + version + ' succesfully aploade to iTC/Play Market'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue