-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
40 lines (32 loc) · 1.16 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
node (label: 'master') {
stage('Checkout') {
if(env.GERRIT_REFSPEC && env.GERRIT_PATCHSET_REVISION) {
println "Building from Gerrit with Refspec: $GERRIT_REFSPEC and branch $GERRIT_PATCHSET_REVISION"
checkout([$class: 'GitSCM', branches: [[name: "$GERRIT_PATCHSET_REVISION"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'gerrit_id_rsa', name: "", refspec: "$GERRIT_REFSPEC", url: 'ssh://[email protected]:29418/tabris-js-cli']]])
} else {
git url: '[email protected]:eclipsesource/tabris-js-cli.git', credentialsId: 'tabris-js-cli_id_rsa'
}
}
/* Requires the Docker Pipeline plugin to be installed */
docker.image('node:10-alpine').inside {
def scmInfo
stage('Checkout') {
scmInfo = checkout scm
}
stage('Install') {
ansiColor('xterm') {
sh 'apk update'
sh 'apk add bash'
sh 'npm -v'
sh 'npm ci'
}
}
timeout(time: 10, unit: 'MINUTES') {
stage('Test') {
ansiColor('xterm') {
sh 'npm test'
}
}
}
}
}