Skip to content

Commit

Permalink
add travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
siren committed Jul 14, 2017
1 parent 0a40238 commit 3e66898
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sudo: required
branches:
only:
- master

services: docker
install: true

language: C

script: ./travis-build.sh

24 changes: 24 additions & 0 deletions travis-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set +e

# Set these environment variables
#DOCKER_USER // dockerhub credentials
#DOCKER_AUTH

ORG=${ORG:-hsldevcom}
DOCKER_TAG=${TRAVIS_BUILD_ID:-latest}
DOCKER_IMAGE=$ORG/hsl-map-server:${DOCKER_TAG}
DOCKER_IMAGE_LATEST=$ORG/hsl-map-server:latest

echo Building hsl-map-server: $DOCKER_IMAGE

docker build --tag=$DOCKER_IMAGE -f Dockerfile .

if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
docker login -u $DOCKER_USER -p $DOCKER_AUTH
docker push $DOCKER_IMAGE
docker tag $DOCKER_IMAGE $DOCKER_IMAGE_LATEST
docker push $DOCKER_IMAGE_LATEST
fi

echo Build completed

0 comments on commit 3e66898

Please sign in to comment.