-
Notifications
You must be signed in to change notification settings - Fork 5
/
Jenkinsfile
55 lines (48 loc) · 1.33 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
#!/usr/bin/env groovy
@Library('ZomisJenkins')
import net.zomis.jenkins.Duga
pipeline {
agent any
stages {
stage('Prepare') {
steps {
checkout scm
}
}
stage('Build') {
steps {
sh 'npm install && npm run build'
}
}
stage('Docker Image') {
when {
branch 'master'
}
steps {
script {
sh 'docker ps -q --filter name="cardshifter_client" | xargs -r docker stop'
sh 'rm -rf /home/zomis/docker-volumes/cardshifter-client'
sh 'cp -r $(pwd)/dist /home/zomis/docker-volumes/cardshifter-client'
sh 'docker run -d --rm --name cardshifter_client -v /home/zomis/docker-volumes/cardshifter-client:/usr/share/nginx/html:ro -p 22739:80 nginx'
}
}
}
/*
withSonarQubeEnv('My SonarQube Server') {
// requires SonarQube Scanner for Maven 3.2+
sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar'
}
*/
}
post {
success {
zpost(0)
}
unstable {
zpost(1)
}
failure {
zpost(2)
}
}
}