forked from dhamith93/sqlite-online
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
48 lines (42 loc) · 1.03 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
pipeline {
environment {
registry = 'dhamith93/sqlite-online'
registryCredential = 'dockerhub_id'
dockerImage = ''
}
agent any
stages {
stage('build and test') {
steps {
sh 'npm ci'
sh 'npm run test:ci'
}
}
stage('building docker image') {
steps {
script {
dockerImage = docker.build registry + ":$BUILD_NUMBER"
}
}
}
stage('deploying image to docker hub') {
steps {
script {
docker.withRegistry('', registryCredential) {
dockerImage.push()
}
}
}
}
stage('cleaning up') {
steps {
sh "docker rmi $registry:$BUILD_NUMBER"
}
}
}
post {
always {
junit 'results/cypress-report.xml'
}
}
}