-
Notifications
You must be signed in to change notification settings - Fork 15
/
Jenkinsfile
66 lines (63 loc) · 1.45 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
pipeline {
agent none
stages {
stage('Install packages & Lint & run tests') {
agent {
dockerfile {
filename 'Dockerfile'
dir 'test'
}
}
steps {
sh 'npm install -f'
sh 'npm run lint'
sh 'npm run test'
}
post {
always {
deleteDir() /* clean up our workspace */
}
}
}
stage('Release latest image on Docker hub') {
when { branch 'main' }
agent {
docker {
image 'docker:19.03.12-dind'
args '-e DOCKER_HOST=$DOCKER_HOST'
}
}
steps {
script {
def dockerImage = docker.build('linagora/esn-frontend-calendar', '--pull --no-cache .')
docker.withRegistry('', 'dockerHub') {
dockerImage.push('main')
}
}
}
post {
success {
echo 'Build OpenPaas front Docker image'
build wait: false, job: 'openpaas-front/main'
}
}
}
stage('Release tag on Docker hub') {
when { tag '*' }
agent {
docker {
image 'docker:19.03.12-dind'
args '-e DOCKER_HOST=$DOCKER_HOST'
}
}
steps {
script {
def dockerImage = docker.build('linagora/esn-frontend-calendar', '--pull --no-cache .')
docker.withRegistry('', 'dockerHub') {
dockerImage.push(env.TAG_NAME)
}
}
}
}
}
}