-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
33 lines (33 loc) · 1.01 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
pipeline {
agent any
stages{
stage("checkout"){
steps{
git url:"https://github.com/ghanatava/thedevopsproject.git", branch:"main"
}
}
stage("build"){
environment{
DOCKERHUB = credentials("DOCKERHUB")
}
steps{
sh "docker build ./frontend -t $DOCKERHUB_USR/auth-frontend"
sh "docker build ./backend -t $DOCKERHUB_USR/auth-backend"
sh "docker build ./nginx -t $DOCKERHUB_USR/auth-nginx"
}
}
stage("push"){
environment{
DOCKERHUB = credentials("DOCKERHUB")
}
steps{
sh '''
docker login -u $DOCKERHUB_USR -p $DOCKERHUB_PSW
docker push $DOCKERHUB_USR/auth-frontend
docker push $DOCKERHUB_USR/auth-backend
docker push $DOCKERHUB_USR/auth-nginx
'''
}
}
}
}