forked from balajikendey/https-github.com-rchidana-NodeApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
31 lines (23 loc) · 647 Bytes
/
Jenkinsfile
File metadata and controls
31 lines (23 loc) · 647 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
node {
def app
stage('Clone repository') {
/* Cloning the Repository to our Workspace */
checkout scm
}
stage('Build image') {
/* This builds the actual image */
app = docker.build("balajikendey/jenkins:latest")
}
stage('Test image') {
app.inside {
echo "Tests passed"
}
}
stage('Push image') {
docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
app.push("${env.BUILD_NUMBER}")
app.push("latest")
}
echo "Trying to Push Docker Build to DockerHub"
}
}