-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR contains: * Automatic version detection by using git tags * Fix for the Makefile (double package target) * Enable Travis CI to build the Docker images and push to Docker Hub
- Loading branch information
Showing
4 changed files
with
22 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,16 @@ | ||
language: go | ||
script: make test | ||
|
||
services: | ||
- docker | ||
|
||
script: | ||
- make test | ||
|
||
after_success: | ||
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin | ||
- export REPO=$DOCKER_USER/tile38 | ||
- export COMMIT_SHORT=$(git rev-parse --short HEAD) | ||
- docker build -f docker/Dockerfile -t $REPO:$COMMIT_SHORT . | ||
- export TAG=`if [ ! -z "$TRAVIS_TAG" ]; then echo $TRAVIS_TAG; elif [ "$TRAVIS_BRANCH" == "master" ]; then echo "edge"; else echo ""; fi` | ||
- if [[ ! -z "$TAG" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker tag $REPO:$COMMIT_SHORT $REPO:$TAG && docker push $REPO:$TAG && echo "Pushed $REPO:$TAG"; else echo "Not pushing, either not on master or on a PR"; fi | ||
- if [[ ! -z "$TRAVIS_TAG" ]]; then docker tag $REPO:$COMMIT_SHORT $REPO:latest && docker push $REPO:latest && echo "Pushed $REPO:latest"; else echo "Not pushing, no tag"; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,13 @@ | ||
FROM alpine:3.4 | ||
|
||
ENV TILE38_VERSION 1.12.0 | ||
ENV TILE38_DOWNLOAD_URL https://github.com/tidwall/tile38/releases/download/$TILE38_VERSION/tile38-$TILE38_VERSION-linux-amd64.tar.gz | ||
ADD ./tile38-server /usr/local/bin | ||
ADD ./tile38-cli /usr/local/bin | ||
|
||
RUN addgroup -S tile38 && adduser -S -G tile38 tile38 | ||
|
||
RUN apk update \ | ||
&& apk add ca-certificates \ | ||
&& update-ca-certificates \ | ||
&& apk add openssl \ | ||
&& wget -O tile38.tar.gz "$TILE38_DOWNLOAD_URL" \ | ||
&& tar -xzvf tile38.tar.gz \ | ||
&& rm -f tile38.tar.gz \ | ||
&& mv tile38-$TILE38_VERSION-linux-amd64/tile38-server /usr/local/bin \ | ||
&& mv tile38-$TILE38_VERSION-linux-amd64/tile38-cli /usr/local/bin \ | ||
&& rm -fR tile38-$TILE38_VERSION-linux-amd64 | ||
|
||
RUN mkdir /data && chown tile38:tile38 /data | ||
RUN addgroup -S tile38 && \ | ||
adduser -S -G tile38 tile38 && \ | ||
mkdir /data && chown tile38:tile38 /data | ||
|
||
VOLUME /data | ||
WORKDIR /data | ||
|
||
EXPOSE 9851 | ||
CMD ["tile38-server"] | ||
CMD ["tile38-server", "-d", "/data"] |