-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
51 lines (49 loc) · 1.54 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
42
43
44
45
46
47
48
49
50
51
pipeline {
agent any
stages {
stage('Git Pull') {
steps {
git branch: 'master', url: 'https://github.com/rushi30699/SPE_MAJOR_PROJECT.git'
}
}
stage('Building a Docker frontend Image') {
steps {
dir('frontend') {
script {
imageName = docker.build("rushi4350/chat-frontend:frontend")
}
}
}
}
stage('Push The Docker frontend Image') {
steps {
script {
withDockerRegistry([credentialsId: "docker-hub-credentials", url: ""]) {
imageName.push()
}
}
}
}
stage('Building a Docker backend Image') {
steps {
dir('server') {
script {
imageName = docker.build("rushi4350/chat-backend:backend2")
}
}
}
}
stage('Push The Docker backend Image') {
steps {
script {
withDockerRegistry([credentialsId: "docker-hub-credentials", url: ""]) {
imageName.push()
}
}
}
}
stage('Ansible Pull Docker Image') {
steps {sh 'ansible-playbook -i localhost, --connection=local /home/lenovo/IdeaProjects/SPE_MAJOR/ansible-deploy/ansible-book.yml'}
}
}
}