-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
91 lines (84 loc) · 2.29 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
pipeline {
agent {
// docker {
// image 'node:8.16-onbuild'
// }
dockerfile {
filename './docker-agent/Dockerfile'
}
}
environment {
// CI = 'true'
CHROME_BIN = '/bin/google-chrome'
}
stages {
stage('NPM config') {
steps {
sh 'npm install'
echo 'dependencies installed'
}
}
// stage('scm checkout') {
// steps {
// git(
// url: 'https://github.com/adessoAG/tech-radar.git',
// credentialsId: '97893e53-8b02-438f-b91c-a91146a19ebd',
// branch: "master"
// )
// }
// }
stage('linting') {
steps {
sh 'rm -r ./build'
echo 'linting app code'
sh 'npm run lint'
}
}
stage('build react app') {
steps {
// sh 'npm install'
// echo 'dependencies installed'
sh 'npm audit fix'
sh 'npm run build'
echo 'react app built'
}
}
stage('unit tests') {
steps {
echo 'unit testing app'
// sh 'CI=true npm test'
}
}
stage('e2e tests') {
steps {
echo 'e2e testing app'
// sh 'node_modules/.bin/cypress run'
}
}
stage('build docker') {
steps {
sh 'docker build -t react-app:${BUILD_NUMBER} .'
echo 'docker container built'
}
}
// stage('deploy') {
// steps {
// sh ''
// sh 'docker-compose up'
// echo 'app deployed'
// }
// }
// stage('start app docker') {
// steps {
// sh 'docker stop react-app'
// sh 'docker rm react-app'
// sh 'docker run -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock -d --name=react-app react-app'
// }
// }
}
// post {
// always {
// archiveArtifacts artifacts: 'build/**'
// }
// }
}