forked from eficode-academy/war-ci-servers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
64 lines (64 loc) · 1.42 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
pipeline {
agent any
environment {
docker_username = 'praqmasofus'
}
stages {
stage('Clone down') {
steps {
stash(excludes: '.git', name: 'code')
deleteDir()
}
}
stage('Test and build') {
parallel {
stage('Test app') {
options {
skipDefaultCheckout(true)
}
steps {
unstash 'code'
sh 'bash ci/unit-test-app.sh'
stash(excludes: '.git', name: 'code')
}
}
stage('Build app') {
options {
skipDefaultCheckout(true)
}
steps {
unstash 'code'
sh 'bash ci/build-app.sh'
archiveArtifacts 'app/build/libs/'
stash(excludes: '.git', name: 'code')
}
}
}
}
stage('Build docker') {
options {
skipDefaultCheckout(true)
}
environment {
DCREDS = credentials('docker')
}
steps {
unstash 'code'
sh 'bash ci/lint-dockerfile.sh'
sh 'echo "$DCREDS_PSW" | docker login -u "$DCREDS_USR" --password-stdin'
sh 'bash ci/build-docker.sh'
sh 'bash ci/push-docker.sh'
}
}
stage('System test') {
options {
skipDefaultCheckout(true)
}
steps {
unstash 'code'
sh 'bash ci/component-test.sh'
sh 'bash ci/performance-test.sh'
}
}
}
}