-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkinsfile2
56 lines (52 loc) · 1.22 KB
/
jenkinsfile2
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
52
53
54
55
56
pipeline {
agent any
stages {
stage('Verify Git Branch Now') {
steps {
sh(script: "echo $GIT_BRANCH")
}
}
stage('Print Directory') {
steps {
sh(script: "pwd")
sh(script: "ls -l | head -4")
}
}
stage('Build docker images') {
steps {
sh(script: "docker images -a")
sh(script: """
cd azure-vote
docker images -a
docker build -t docker-pipeline .
docker images -a
cd ..
""")
}
}
stage('Start Test App') {
steps {
sh(script: "docker images -a")
sh(script: "docker-compose up -d")
post{
success {
echo "App started successfully :)"
}
failure {
echo "App failed to start :("
}
}
}
}
stage('Run Tests') {
steps {
sh(script: "pytest ./tests/test_sample.py")
}
}
stage('Stop test app') {
steps {
sh(script: "docker-compose down")
}
}
}
}