-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.txt
41 lines (33 loc) · 969 Bytes
/
Jenkinsfile.txt
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
pipeline{
agent any
stages{
stage('Build Jar'){
steps{
bat 'mvn clean package -DskipTests'
}
}
stage('Build Image'){
steps{
bat 'docker build -t=vrica/selenium:latest .'
}
}
stage('Push Image'){
environment{
// assuming you have stored the credentials with this name
DOCKER_HUB = credentials('dockerhub-creds')
}
steps{
// There might be a warning.
bat "docker login -u ${DOCKER_HUB_USR} -p ${DOCKER_HUB_PSW}"
bat 'docker push vrica/selenium:latest'
bat "docker tag vrica/selenium:latest vrica/selenium:${env.BUILD_NUMBER}"
bat "docker push vrica/selenium:${env.BUILD_NUMBER}"
}
}
}
post {
always {
bat 'docker logout'
}
}
}