-
Notifications
You must be signed in to change notification settings - Fork 166
/
Jenkinsfile
56 lines (56 loc) · 1.43 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
pipeline {
agent any
environment {
GIT_REPO = 'BackVynils'
GIT_CREDENTIAL_ID = '277a9d46-cf19-4119-afd9-4054a7d35151'
SONARQUBE_URL = 'http://172.24.100.52:8082/sonar-misovirtual'
}
stages {
stage('Checkout') {
steps {
scmSkip(deleteBuild: true, skipPattern:'.*\\[ci-skip\\].*')
git branch: 'master',
credentialsId: env.GIT_CREDENTIAL_ID,
url: 'https://github.com/MISW-4104-Web/' + env.GIT_REPO
}
}
stage('Build') {
// Build app
steps {
script {
docker.image('citools-isis2603:latest').inside('-u root') {
sh '''
npm i -s
nest build
'''
}
}
}
}
stage('Test') {
steps {
script {
docker.image('citools-isis2603:latest').inside('-u root') {
sh '''
npm run test:cov
'''
}
}
}
}
stage('Static Analysis') {
// Run static analysis
steps {
sh '''
docker run --rm -u root -e SONAR_HOST_URL=${SONARQUBE_URL} -v ${WORKSPACE}:/usr/src sonarsource/sonar-scanner-cli:4.3
'''
}
}
}
post {
always {
// Clean workspace
cleanWs deleteDirs: true
}
}
}