This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnurse-app.groovy
executable file
·66 lines (64 loc) · 3.13 KB
/
nurse-app.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
node('rhmap-jenkins-slave') {
stage('Checkout Code') {
sh 'git config --global user.email "[email protected]"'
sh 'git config --global user.name "ci-bot"'
git url: '[email protected]:innovation/easiER-AG--ER-Nurse-Administration-App.git', branch: 'develop'
sh 'git checkout web-app-build'
sh 'git merge develop --no-commit -X theirs'
}
stage('Build Web App') {
sh 'npm install'
sh 'npm run clean'
sh 'npm run build --prod'
}
stage("Bump Mobile Version to ${MOBILE_APP_VERSION}") {
sh "sed -r -i '/<widget/ s#version=\"([0-9]+).([0-9+]).([0-9]+)\"#version=\"${MOBILE_APP_VERSION}\"#' config.xml"
}
stage('Push Intermediate Result to RHMAP') {
isGitCommitNeeded = sh(
script: 'git status --porcelain | wc -l',
returnStdout: true
).trim()
if ("${isGitCommitNeeded}" == '0') {
echo "no git commits to be made"
} else {
sh 'git add --all www config.xml'
sh "git commit -m 'Jenkins Job ${env.BUILD_NUMBER} for app version: ${MOBILE_APP_VERSION}'"
}
// might to merge changes outside of www, like to config.xml
sh 'git push origin web-app-build -f'
}
stage('Build Mobile Clients') {
// prep fhc CLI to RHMAP
fhcTarget = readFile '/etc/secrets/fhc/target'
fhcUser = readFile '/etc/secrets/fhc/user'
fhcPassword = readFile '/etc/secrets/fhc/password'
fhcIOSKeypass = readFile '/etc/secrets/fhc/ios-keypass'
sh "fhc target ${fhcTarget}"
sh "fhc login ${fhcUser} ${fhcPassword}"
parallel android: {
env.ANDROID_DOWNLOAD_URL = sh(
script: "fhc build project=2agquyssx54uvo6npvmit626 app=2agquyutskuywqxtsvqqd7ry environment=default cloud_app=2agquyudsnwu4a4c5jcvi5ga tag=${CLOUD_APP_CONNECTION_TAG} destination=android git-branch=web-app-build | sed -n -e '/Download URL/ s/Download URL: //p'",
returnStdout: true
).trim()
if ( ANDROID_DOWNLOAD_URL.isEmpty() ){
error("something went wrong with your android build in RHMAP. please check the logs in RHMAP.")
}
}, ios: {
env.IOS_DOWNLOAD_URL = sh (
script: "fhc build project=2agquyssx54uvo6npvmit626 app=2agquyutskuywqxtsvqqd7ry environment=default cloud_app=2agquyudsnwu4a4c5jcvi5ga tag=${CLOUD_APP_CONNECTION_TAG} destination=ios git-branch=web-app-build bundleId=wqxogtipbtyozrsu2smxbnkx keypass=${fhcIOSKeypass} config=Release | sed -n -e '/Download URL/ s/Download URL: //; s/.zip?/.ipa?/p'",
returnStdout: true
).trim()
if ( IOS_DOWNLOAD_URL.isEmpty() ){
error("something went wrong with your iOS build in RHMAP. please check the logs in RHMAP.")
}
}, failFast: false
}
}
node('OSX') {
stage('Push iOS Client to TestFlight'){
deleteDir()
sh "curl -o nurse-app-${MOBILE_APP_VERSION}.ipa ${env.IOS_DOWNLOAD_URL}"
sh '/usr/local/bin/fastlane pilot upload -u $FASTLANE_USER'
}
}