-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
43 lines (38 loc) · 1010 Bytes
/
Jenkinsfile
File metadata and controls
43 lines (38 loc) · 1010 Bytes
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
pipeline {
agent any
environment {
DOCKER_HUB_CREDENTIALS = credentials('dockerhub')
DOCKER_IMAGE_NAME = "infraxus/infraxus-server"
DOCKER_IMAGE_TAG = "${env.BUILD_NUMBER}"
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build') {
steps {
script {
sh 'gradle build --no-daemon'
}
}
}
stage('Build & Push Docker Image') {
steps {
script {
docker.withRegistry('https://registry.hub.docker.com', DOCKER_HUB_CREDENTIALS) {
def customImage = docker.build(DOCKER_IMAGE_NAME, ".")
customImage.push(DOCKER_IMAGE_TAG)
customImage.push('latest')
}
}
}
}
}
post {
always {
cleanWs()
}
}
}