-
Notifications
You must be signed in to change notification settings - Fork 11
/
Jenkinsfile
63 lines (54 loc) · 1.18 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
pipeline {
agent {
label 'graphdb-jenkins-node'
}
tools {
nodejs 'nodejs-14.17.0'
}
environment {
CI = "true"
}
stages {
stage('Prepare') {
steps {
sh "node --version"
sh "docker-compose -f test-e2e/docker-compose.yml up -d"
}
}
stage('Install') {
steps {
sh "npm ci"
}
}
stage('Unit Test') {
steps {
sh "npm run lint"
sh "npm run lint:test"
sh "npm run test:report"
}
}
stage('Acceptance Test') {
steps {
sh "npm run build"
sh "npm run install:local"
sh "wait-on http://localhost:7200/protocol -t 60000"
sh "(cd test-e2e/ && npm install && npm link graphdb && npm run test)"
}
}
stage('Sonar') {
steps {
withSonarQubeEnv('SonarCloud') {
sh "node sonar-project.js --branch='${env.ghprbSourceBranch}' --target-branch='${env.ghprbTargetBranch}' --pull-request-id='${env.ghprbPullId}'"
}
}
}
}
post {
always {
dir("test-e2e/") {
sh "docker logs graphdb"
sh "docker-compose down -v --remove-orphans --rmi=local || true"
}
}
}
}