update jenkinsfiles and build.gradle to use build_no.sh

This commit is contained in:
Jakub Sokołowski 2018-05-07 14:32:56 +02:00 committed by Jakub Sokołowski
parent 176817dc55
commit f97fec1547
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
4 changed files with 11 additions and 3 deletions

View File

@ -63,13 +63,17 @@ node ('macos1'){
}
stage('Build (iOS)') {
def build_no = sh(returnStdout: true, script: 'git rev-list --count HEAD').trim()
def build_no = sh(returnStdout: true, script: './build_no.sh').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('Push Build Tag') {
sh ('git push --tags')
}
stage('Deploy (Android)') {
def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/'
println (artifact_dir + 'app-release.apk')

View File

@ -66,7 +66,7 @@ node ('macos1'){
stage('Build (iOS)') {
withCredentials([string(credentialsId: 'jenkins_pass', variable: 'password')]) {
def build_no = sh(returnStdout: true, script: 'git rev-list --count HEAD').trim()
def build_no = sh(returnStdout: true, script: './build_no.sh').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'
@ -75,6 +75,10 @@ node ('macos1'){
}
}
stage('Push build tag') {
sh ('git push --tags')
}
stage('Deploy (Android)') {
sh ('bundle exec fastlane android release || exit 0')
}

View File

@ -98,7 +98,7 @@ def enableProguardInReleaseBuilds = false
def getVersionCode = { ->
new ByteArrayOutputStream().withStream { stdOut ->
exec {
commandLine "git", "rev-list", "--count", "HEAD"
commandLine "./build_no.sh"
standardOutput = stdOut
}
return stdOut.toString().toInteger()

0
build_no.sh Normal file → Executable file
View File