Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.

Commit

Permalink
Use Docker to test in CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
agonzalezro committed May 2, 2016
1 parent d3baddd commit 84ca5b8
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor/
bin/
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM golang:1.6.2-alpine

ENV APP $GOPATH/src/github.com/agonzalezro/polo
RUN mkdir -p $APP
WORKDIR $APP

ADD glide.yaml $APP/glide.yaml
ADD glide.lock $APP/glide.lock
RUN apk add --no-cache git \
&& go get -u github.com/Masterminds/glide/... \
&& go get -u github.com/jteeuwen/go-bindata/... \
&& glide install \
&& apk del git

ADD . $APP
RUN apk add --no-cache make \
&& make \
&& apk del make

ENTRYPOINT ["bin/polo"]
CMD ["--help"]
9 changes: 7 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
machine:
services:
- docker

dependencies:
override:
- go get github.com/constabulary/gb/...
- docker info
- docker build -t agonzalezro/polo .

test:
override:
- gb test
- docker run --entrypoint go agonzalezro/polo test $(docker run --entrypoint glide agonzalezro/polo novendor)
4 changes: 2 additions & 2 deletions cmd/polo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var (

startDaemon = app.Flag("start-daemon", "Start a simple HTTP server watching for markdown changes.").Short('d').Bool()
port = app.Flag("port", "Port where to run the server.").Default("8080").Short('p').Int()
configPath = app.Flag("config", "The settings file.").Short('c').Default("config.json").ExistingFile()
configPath = app.Flag("config", "The settings file.").Short('c').Default("config.json").String()

templatesBasePath = app.Flag("templates-base-path", fmt.Sprintf("Where the '%s/' folder resides (in case it exists).", site.TemplatesRelativePath)).Default(".").ExistingDir()

Expand Down Expand Up @@ -85,7 +85,7 @@ func main() {
}

addr := fmt.Sprintf(":%d", *port)
log.Infof("Static server running on %s\n", addr)
log.Info("Static server running on ", addr)
log.Fatal(http.ListenAndServe(addr, http.FileServer(http.Dir(*output))))
}
}
38 changes: 38 additions & 0 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
parent: null
package: main
import:
- package: github.com/Sirupsen/logrus
- package: gopkg.in/fsnotify.v1
- package: github.com/jessevdk/go-flags
- package: github.com/russross/blackfriday
- package: gopkg.in/alecthomas/kingpin.v2
- package: github.com/stretchr/testify

0 comments on commit 84ca5b8

Please sign in to comment.