-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
38 lines (36 loc) · 956 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
pipeline {
agent { label 'master' }
tools {
maven 'Maven 3.6.0'
jdk 'jdk8'
}
environment {
VERSION="6.10.0"
GROUP = "NeotysLab"
APP_NAME="WhiteblockBlockChain"
DOCKERHUB="hrexed/whitebloclg"
}
stages {
stage('Checkout') {
agent { label 'master' }
steps {
git url:"https://github.com/${GROUP}/${APP_NAME}.git",
branch :'master'
}
}
stage('Docker build') {
steps {
sh "sed -i 's/VERSION_TO_REPLACE/${VERSION}/' $WORKSPACE/docker/Dockerfile"
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'TOKEN', usernameVariable: 'USER')]) {
sh "docker build -t ${DOCKERHUB}:${VERSION} $WORKSPACE/docker/"
sh "docker push ${DOCKERHUB}:${VERSION}"
}
}
}
}
post {
always {
cleanWs()
}
}
}