-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile
37 lines (37 loc) · 1.03 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
pipeline {
agent any
environment{
PASS=credentials('dockerToken')
}
stages {
stage('Build') {
steps {
sh'''
docker build -t muhammad2000/front .
'''
}
}
stage('Test') {
steps {
sh'''
docker build -f ./Dockertest .
docker-compose stop
docker-compose rm -f
docker-compose up -d
docker wait fronttest_container
docker start fronttest_container
VALUE=$(docker wait fronttest_container)
if [ "$VALUE" != "0" ] ; then exit 1 ; fi
'''
}
}
stage('Deploy') {
steps {
sh'''
docker login -u muhammad2000 -p $PASS
docker push muhammad2000/front
'''
}
}
}
}