forked from Overv/openstreetmap-tile-server
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
30 lines (30 loc) · 1.17 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
27
28
29
30
os: linux
language: minimal
services:
- docker
# DOCKER_USERNAME/DOCKER_PASSWORD have been configured in Travis CI
# env:
before_install:
- echo "Before install"
before_script:
- docker pull fsievers/openstreetmap-tile-server || true
script:
- docker build --pull --cache-from fsievers/openstreetmap-tile-server --tag fsievers/openstreetmap-tile-server .
- docker volume create openstreetmap-data
- docker run --rm -v openstreetmap-data:/var/lib/postgresql/12/main fsievers/openstreetmap-tile-server import
- docker run --rm -v openstreetmap-data:/var/lib/postgresql/12/main -p 8080:80 -d fsievers/openstreetmap-tile-server run
- sleep 30
- make DOCKER_IMAGE=fsievers/openstreetmap-tile-server stop
after_script:
- docker images
after_success:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin ;
- export REPO=$DOCKER_USERNAME/openstreetmap-tile-server
- export TAG=`if [ “$TRAVIS_BRANCH” == “master” ]; then echo “latest”; else echo $TRAVIS_BRANCH ; fi`
- echo $REPO:$TAG:$TRAVIS_COMMIT
- docker build -f Dockerfile -t $REPO .
- docker tag $REPO $REPO:$TAG
- docker tag $REPO $REPO:travis-$TRAVIS_BUILD_NUMBER
- docker push $REPO
notifications:
email: true