1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| node('pi-docker-agent') {
| def customImage
| def BUILDDATE = sh(script: "echo `date --rfc-3339=date`", returnStdout: true).trim()
|
| stage ('Checkout source'){
| checkout scm
| }
|
| stage ('Build image'){
| //Build the image
| customImage = docker.build("jenkins:${BUILDDATE}-build-${env.BUILD_ID}")
| }
| stage('Test Image'){
| customImage.inside {
| sh 'curl -s -o /dev/null -w "%{http_code}" localhost:8080/login'
| }
| }
| stage('Push Image'){
| docker.withRegistry('https://dev-reg.darkurthe.net'){
| customImage.push()
| customImage.push("latest")
| }
| }
| }
|
|