-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
29 lines (25 loc) · 737 Bytes
/
Jenkinsfile
File metadata and controls
29 lines (25 loc) · 737 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
node {
def app
stage('Clone Repo') {
/* This Stage Clones the Repository to our Workspace */
checkout scm
}
stage('Build Image') {
/* This Stage Builds the Docker Image */
app = docker.build("atreyamohan/testnodeapp")
}
stage('Test Image') {
/* This Stage Tests the Docker Image */
app.inside {
echo "Tests Passed"
}
}
stage('Push Image') {
/* This Stage pushes the image to the Repo */
docker.withRegistry('https://registry.hub.docker.com', 'docker-hub') {
app.push("${env.BUILD_NUMBER}")
app.push("latest")
}
echo "Pushing Docker Image to DockerHub Repository"
}
}