This repository was 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 pathionic-mobile-client.groovy
executable file
·40 lines (40 loc) · 1.85 KB
/
ionic-mobile-client.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
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/Holmes-Test-ionic-hello-world.git', branch: 'master'
sh 'git checkout web-app-build'
sh 'git rebase master'
}
stage ('Build Web App'){
sh 'npm install'
sh 'npm run clean'
sh 'npm run build --prod'
}
stage ('Push Web App Build Result to Git Server'){
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'
sh "git commit -m 'Jenkins Job ${env.BUILD_NUMBER} npm run build result'"
}
// might to merge changes outside of www, like to config.xml
sh 'git push origin web-app-build -f'
}
stage ('Build Mobile Clients'){
fhcTarget = readFile '/etc/secrets/fhc/target'
fhcUser = readFile '/etc/secrets/fhc/user'
fhcPassword = readFile '/etc/secrets/fhc/password'
sh "fhc target ${fhcTarget}"
sh "fhc login ${fhcUser} ${fhcPassword}"
parallel android: {
sh "fhc build project=gibfv3giclwnzfyczkpfob2b app=gibfv3blcmmcwxd2a33fvald environment=default cloud_app=gibfv3dtp423wrbvhhqjubxt tag=0.0.1 destination=android git-branch=web-app-build"
}, ios: {
sh "fhc build project=gibfv3giclwnzfyczkpfob2b app=gibfv3blcmmcwxd2a33fvald environment=default cloud_app=gibfv3dtp423wrbvhhqjubxt tag=0.0.1 destination=ios git-branch=web-app-build bundleId=3qdmddk6frtwba3b6nfmibwg keypass=password config=Distribution"
}, failFast: false
}
}