Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add versioned dockerfiles #21

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
language: go
sudo: required
services:
- docker

go:
- 1.6
- 1.5
- "1.10"
- "1.9"
- "1.8"

env:
- GO15VENDOREXPERIMENT=1
global:
- WATCHER_VERSION=0.2.4

matrix:
fast_finish: true

script: go test ./...

after_success:
./build.sh

9 changes: 9 additions & 0 deletions Dockerfiles/Dockerfile.go1.10
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM golang:1.10-alpine3.7

VOLUME /go/src

ARG WATCHER_VERSION=0.2.4

ADD watcher $GOPATH/bin/watcher

CMD ["watcher"]
9 changes: 9 additions & 0 deletions Dockerfiles/Dockerfile.go1.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM golang:1.8-alpine3.6

VOLUME /go/src

ARG WATCHER_VERSION=0.2.4

ADD watcher $GOPATH/bin/watcher

CMD ["watcher"]
9 changes: 9 additions & 0 deletions Dockerfiles/Dockerfile.go1.9
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM golang:1.9-alpine3.7

VOLUME /go/src

ARG WATCHER_VERSION=0.2.4

ADD watcher $GOPATH/bin/watcher

CMD ["watcher"]
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -xe
#if [ "$TRAVIS_BRANCH" == "master" ]; then
go build -o watcher cmd/watcher/main.go
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
GO_VERSION=$(go version | awk '{print $3}')

docker build -f Dockerfiles/Dockerfile.$GO_VERSION -t canthefason/go-watcher:$WATCHER_VERSION-$GO_VERSION .

docker push canthefason/go-watcher:$WATCHER_VERSION-$GO_VERSION
#fi
4 changes: 2 additions & 2 deletions common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ func TestParamsGet(t *testing.T) {

run := params.Get("run")
if run != "statler" {
t.Error("Expected statler but got %s in params.Get()", run)
t.Errorf("Expected statler but got %s in params.Get()", run)
t.FailNow()
}
}
Expand All @@ -20,7 +20,7 @@ func TestParamsClone(t *testing.T) {
params.cloneRunFlag()
watch := params.Get("watch")
if watch != "statler" {
t.Error("Expected statler but got %s when watch param is not set", watch)
t.Errorf("Expected statler but got %s when watch param is not set", watch)
}

params.Watcher["watch"] = "waldorf"
Expand Down
2 changes: 1 addition & 1 deletion watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func MustRegisterWatcher(params *Params) *Watcher {
if watchVendorStr != "" {
watchVendor, err = strconv.ParseBool(watchVendorStr)
if err != nil {
log.Println("Wrong watch-vendor value: %s (default=false)", watchVendorStr)
log.Printf("Wrong watch-vendor value: %s (default=false)\n", watchVendorStr)
}
}

Expand Down