forked from LondheShubham153/node-todo-cicd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkinsfile
35 lines (33 loc) · 1016 Bytes
/
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
pipeline {
agent any
stages {
stage('code') {
steps {
git 'https://github.com/abhi016/node-todo-cicd.git'
}
}
stage('build') {
steps {
sh 'docker build -t aryann3003/node-todo:latest .'
}
}
stage('Push Image') {
steps {
withCredentials([usernamePassword(credentialsId: 'dockerhub', passwordVariable: 'dockerhubpass',usernameVariable: 'dockerhubuser')]) {
sh "docker login -u ${env.dockerhubuser} -p ${env.dockerhubpass}"
sh ' docker push aryann3003/node-todo:latest '
}
}
}
stage('deploy') {
steps {
sh 'docker-compose down && docker-compose up -d'
}
}
stage('test') {
steps {
echo 'confidence'
}
}
}
}