Skip to content

Commit e809226

Browse files
cosmincojocargcmurphy
authored andcommitted
Build improvments (#179)
* Add a semantic version to the usage text * Add a comment to the version function * Inject the version, git tag and build date as build variables * Update README * Fix lint warnings * Update README * Manage dependencies with dep tool instead of godep * Add a Makefile for common build tasks * Update the build file to use the make tool * Update Dockerfile * Add docker entry point in to make the passing of arguments easy * Update README * Add missing tools to the build * Drop 1.7 support and add 1.10 * Fix Go 1.10 according with the travis guidelines https://docs.travis-ci.com/user/languages/go/ * Update the tls-observatory package * Fix lint warnings * Change the output of the tests to be more verbose * Check if the are build errors before executing the rule test
1 parent 2115402 commit e809226

File tree

13 files changed

+311
-348
lines changed

13 files changed

+311
-348
lines changed

.travis.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
language: go
22

33
go:
4-
- 1.7
54
- 1.8
65
- 1.9
6+
- "1.10"
77
- tip
88

99
install:
10+
- go get -u github.com/golang/dep/cmd/dep
1011
- go get -u github.com/golang/lint/golint
11-
- go get -v github.com/onsi/ginkgo/ginkgo
12-
- go get -v github.com/onsi/gomega
13-
- go get -v golang.org/x/crypto/ssh
14-
- go get github.com/GoASTScanner/gas/cmd/gas/...
12+
- go get -u github.com/onsi/ginkgo/ginkgo
13+
- go get -u github.com/onsi/gomega
14+
- go get -u golang.org/x/crypto/ssh
15+
- go get -u github.com/GoASTScanner/gas/cmd/gas/...
1516
- go get -v -t ./...
1617
- export PATH=$PATH:$HOME/gopath/bin
1718

18-
before_script:
19-
- test -z "$(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr)"
20-
- test -z "$(golint . | tee /dev/stderr)"
21-
- go vet $(go list ./... | grep -v /vendor/)
22-
- gas ./...
23-
24-
script: ginkgo -r
19+
script: make test
2520

Dockerfile

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,8 @@
1-
# Docker version must be 17.05 or higher to allow multistage build
2-
# See build and run instructions in README.md
1+
FROM golang:1.9.4-alpine3.7
32

4-
# Builds Gas for utilization
5-
FROM golang:1.8.1-alpine as builder
6-
ENV workspace /go/src/github.com/GoASTScanner/gas
7-
ENV GOPATH /go
8-
COPY . $workspace
9-
WORKDIR $workspace
3+
ENV BIN=gas
104

11-
RUN go vet $(go list ./... | grep -v /vendor/)
12-
RUN CGO_ENABLED=0 go build -o gas .
5+
COPY build/*-linux-amd64 /go/bin/$BIN
6+
COPY docker-entrypoint.sh /usr/local/bin
137

14-
########################################################
15-
16-
# Runs Gas on all Go files in the current directory when
17-
# 'docker run' command in README is given
18-
FROM alpine:3.6
19-
20-
COPY --from=builder /go/src/github.com/GoASTScanner/gas/gas /
21-
22-
# Mounted directory should be placed into the workdir
23-
CMD /gas $(find . -path ./vendor -prune -o -type f -name "*.go")
8+
ENTRYPOINT ["docker-entrypoint.sh"]

Godeps/Godeps.json

Lines changed: 0 additions & 302 deletions
This file was deleted.

Godeps/Readme

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)