-
Notifications
You must be signed in to change notification settings - Fork 19
/
Jenkinsfile
66 lines (56 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
properties properties: [
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '30', numToKeepStr: '10']],
[$class: 'GithubProjectProperty', displayName: '', projectUrlStr: 'https://github.com/TobiasHennig/nativescript-toast/'],
]
@Library('mare-build-library')
def nodeJS = new de.mare.ci.jenkins.NodeJS()
def git = new de.mare.ci.jenkins.Git()
timeout(150) {
node('nativescript') {
def workspace = env.WORKSPACE
// PRINT ENVIRONMENT TO JOB
echo "workspace directory is $workspace"
echo "PATH is $env.PATH"
try {
stage('Checkout') {
checkout scm
}
stage('Build') {
nodeJS.nvm("install -g nativescript")
dir("publish") {
nodeJS.nvmRun("setup-dev-env")
}
}
stage('Webpack') {
parallel demo: {
dir("demo") {
nodeJS.nvmRun("clean")
nodeJS.nvmRun("build-android-bundle")
nodeJS.nvmRun("build-ios-bundle")
}
}, demoAngular: {
dir("demo-angular") {
nodeJS.nvmRun("clean")
nodeJS.nvmRun("build-android-bundle")
nodeJS.nvmRun("build-ios-bundle")
}
},
failFast: true
}
dir("src") {
stage('Test') {
nodeJS.nvmRun('test')
// junit 'test/android/build/reports/TEST-*.xml'
}
if(git.isDevelopBranch() || git.isFeatureBranch()){
stage('Publish NPM snapshot') {
nodeJS.publishSnapshot('.', env.BUILD_NUMBER, env.BRANCH_NAME)
}
}
}
} catch (e) {
mail subject: "${env.JOB_NAME} (${env.BUILD_NUMBER}): Error on build", to: 'github@martinreinhardt-online.de', body: "Please go to ${env.BUILD_URL}."
throw e
}
}
}