Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Commit 2b998b7

Browse files
authored
Merge pull request #29 from mlangbehn/docker_in_ci
Add docker-compose test to Travis CI
2 parents e5c0f6d + 052447a commit 2b998b7

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ language: python
33
python: 2.7
44
sudo: required
55

6+
services:
7+
- docker
8+
69
addons:
710
apt:
811
sources:
@@ -25,4 +28,5 @@ before_script:
2528
- "./tests/test-shellcheck.sh"
2629
- "./tests/test-yamllint.sh"
2730

28-
script: true
31+
script:
32+
- "./tests/test-docker-compose.sh"

tests/test-docker-compose.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash -e
2+
3+
test_failed(){
4+
echo -e >&2 "\033[0;31mdocker-compose test failed!\033[0m"
5+
exit 1
6+
}
7+
8+
test_passed(){
9+
echo -e "\033[0;32mdocker-compose test passed!\033[0m"
10+
}
11+
12+
main(){
13+
if ! docker-compose up -d; then
14+
test_failed
15+
elif ! docker-compose ps; then
16+
test_failed
17+
elif ! nc -z -v localhost 30080; then
18+
test_failed
19+
else
20+
test_passed
21+
fi
22+
}
23+
24+
main "$@"

0 commit comments

Comments
 (0)