-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.travis.yml
26 lines (26 loc) · 1.05 KB
/
.travis.yml
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
---
language: python
python:
- 2.7
services:
- docker
install:
- docker build -t lighttpd .
- docker run --name lighttpd -v /etc/localtime:/etc/localtime:ro -v $PWD/htdocs:/var/www/localhost/htdocs -p 8080:80 -p 443:443 -d lighttpd:latest
script:
- docker ps | grep -q lighttpd
- test "$(curl -I http://localhost:8080 2>/dev/null | head -n1 | cut -d' ' -f2)" == "200"
- test "$(curl -I --insecure https://localhost 2>/dev/null | head -n1 | cut -d' ' -f2)" == "200"
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_EVENT_TYPE" != "pull_request" ]; then
docker build -t lighttpd .;
docker tag lighttpd:latest m4rcu5/lighttpd:latest;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push m4rcu5/lighttpd:latest;
fi
- if [ "$TRAVIS_BRANCH" == "develop" ] && [ "$TRAVIS_EVENT_TYPE" != "pull_request" ]; then
docker build -t lighttpd .;
docker tag lighttpd:latest m4rcu5/lighttpd:staging;
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push m4rcu5/lighttpd:staging;
fi