Skip to content

Commit 3a45ae6

Browse files
committed
Merge changes by @metalmatze for adding an automatic Docker build and
deploy on tagged commits.
2 parents 959b2e3 + 2bf48bf commit 3a45ae6

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
sudo: required
2+
13
language: go
24

5+
services:
6+
- docker
7+
38
go:
9+
- 1.8
410
- tip
511

612
before_install:
@@ -13,6 +19,10 @@ script:
1319

1420
after_success:
1521
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
22+
- if [ "${TRAVIS_BRANCH}" == "master" ]; then
23+
docker login -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}";
24+
docker push numbleroot/pluto;
25+
fi
1626

1727
deploy:
1828
provider: releases
@@ -23,6 +33,9 @@ deploy:
2333
on:
2434
tags: true
2535

36+
docker:
37+
- docker build -t numbleroot/pluto .
38+
2639
notifications:
2740
email:
2841
on_success: change

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM alpine
2+
3+
ADD ./pluto /usr/bin/pluto
4+
5+
ENTRYPOINT ["/usr/bin/pluto"]
6+
CMD ["-config", "/etc/pluto.toml"] # default location which can be easily overwritten from the outside

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ clean:
1414
build:
1515
CGO_ENABLED=0 go build -ldflags '-extldflags "-static"'
1616

17+
docker: build
18+
docker build -t numbleroot/pluto .
19+
1720
pki:
1821
if [ ! -d "private" ]; then mkdir private; fi
1922
chmod 0700 private

0 commit comments

Comments
 (0)