-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
72 lines (64 loc) · 1.9 KB
/
Jenkinsfile
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
67
68
69
70
71
72
pipeline {
agent { node 'xcode' }
stages {
stage('Checkout and Setup') {
steps {
checkout([
$class: 'GitSCM',
branches: scm.branches,
doGenerateSubmoduleConfigurations: false,
extensions: scm.extensions + [[$class: 'SubmoduleOption', disableSubmodules: false, recursiveSubmodules: true, reference: '', trackingSubmodules: false]],
submoduleCfg: [],
userRemoteConfigs: scm.userRemoteConfigs
])
sh 'brew bundle'
sh 'rbenv install -s && rbenv local'
sh 'gem install bundler && bundle update'
}
}
stage('Build & Test') {
steps {
sh 'bundle exec fastlane test'
}
post {
always {
checkstyle pattern: 'output/swiftlint.xml'
junit 'output/tests/report.junit'
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'output/tests', reportFiles: 'report.html', reportName: 'Unit Tests Report', reportTitles: 'tests'])
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'output/coverage', reportFiles: 'index.html', reportName: 'XCov Report', reportTitles: 'xcov'])
}
success {
archiveArtifacts artifacts:'output/MiKee.*'
}
}
}
stage('Deployment') {
when {
expression { env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'develop' }
}
parallel {
stage('Beta') {
when {
expression { return env.BRANCH_NAME == 'develop' }
}
steps {
sh 'bundle exec fastlane beta'
}
}
stage('AppStore') {
when {
expression { return env.BRANCH_NAME == 'master' }
}
steps {
sh 'bundle exec fastlane release'
}
post {
success {
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'output/screenshots', reportFiles: 'screenshots.html', reportName: 'Screenshots', reportTitles: 'screenshots'])
}
}
}
}
}
}
}