-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
50 lines (44 loc) · 1017 Bytes
/
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
#!/usr/bin/env groovy
// Copyright 2018, Development Gateway, see COPYING
pipeline {
agent any
environment {
HTTP_PROXY = 'http://proxy.devgateway.org:3128/'
HTTPS_PROXY = 'http://proxy.devgateway.org:3128/'
APP_NAME = 'polipo'
VERSION = '1.1.2'
IMAGE = "devgateway/$APP_NAME:$VERSION"
}
stages {
stage('Build') {
steps {
script {
docker.build(env.IMAGE, "--build-arg=VERSION=$VERSION .")
}
}
} // stage
stage('Publish') {
steps {
script {
docker.withRegistry('', 'dockerhub-ssemenukha') {
docker.image(env.IMAGE).push()
}
}
}
} // stage
} // stages
post {
success {
script {
def msg = sh(
returnStdout: true,
script: 'git log --oneline --format=%B -n 1 HEAD | head -n 1'
)
slackSend(
message: "Built <$BUILD_URL|$JOB_NAME $BUILD_NUMBER>: $msg",
color: "good"
)
}
}
}
}