-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
41 lines (36 loc) · 1.08 KB
/
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
pipeline{
agent any
environment {
APP_NAME = "complete-prodcution-e2e-pipeline"
RELEASE = "1.0.0"
DOCKER_USER = "fir3eye"
DOCKER_PASS = 'dockerhub'
IMAGE_NAME = "${DOCKER_USER}" + "/" + "${APP_NAME}"
IMAGE_TAG = "${RELEASE}-${BUILD_NUMBER}"
}
stages{
stage("Cleanup Workspace"){
steps {
cleanWs()
}
}
stage("Checkout from SCM"){
steps {
git branch: 'master', credentialsId: 'github', url: 'https://github.com/Fir3eye/nodeapp_tests03.git'
}
}
stage("Build & Push Docker Image") {
steps {
script {
docker.withRegistry('',DOCKER_PASS) {
docker_image = docker.build "${IMAGE_NAME}"
}
docker.withRegistry('',DOCKER_PASS) {
docker_image.push("${IMAGE_TAG}")
docker_image.push('latest')
}
}
}
}
}
}