Skip to content

Commit

Permalink
Build improvments (securego#179)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
cosmincojocar authored and gcmurphy committed Mar 12, 2018
1 parent 2115402 commit e809226
Show file tree
Hide file tree
Showing 13 changed files with 311 additions and 348 deletions.
19 changes: 7 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
language: go

go:
- 1.7
- 1.8
- 1.9
- "1.10"
- tip

install:
- go get -u github.com/golang/dep/cmd/dep
- go get -u github.com/golang/lint/golint
- go get -v github.com/onsi/ginkgo/ginkgo
- go get -v github.com/onsi/gomega
- go get -v golang.org/x/crypto/ssh
- go get github.com/GoASTScanner/gas/cmd/gas/...
- go get -u github.com/onsi/ginkgo/ginkgo
- go get -u github.com/onsi/gomega
- go get -u golang.org/x/crypto/ssh
- go get -u github.com/GoASTScanner/gas/cmd/gas/...
- go get -v -t ./...
- export PATH=$PATH:$HOME/gopath/bin

before_script:
- test -z "$(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr)"
- test -z "$(golint . | tee /dev/stderr)"
- go vet $(go list ./... | grep -v /vendor/)
- gas ./...

script: ginkgo -r
script: make test

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

# Builds Gas for utilization
FROM golang:1.8.1-alpine as builder
ENV workspace /go/src/github.com/GoASTScanner/gas
ENV GOPATH /go
COPY . $workspace
WORKDIR $workspace
ENV BIN=gas

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

########################################################

# Runs Gas on all Go files in the current directory when
# 'docker run' command in README is given
FROM alpine:3.6

COPY --from=builder /go/src/github.com/GoASTScanner/gas/gas /

# Mounted directory should be placed into the workdir
CMD /gas $(find . -path ./vendor -prune -o -type f -name "*.go")
ENTRYPOINT ["docker-entrypoint.sh"]
302 changes: 0 additions & 302 deletions Godeps/Godeps.json

This file was deleted.

5 changes: 0 additions & 5 deletions Godeps/Readme

This file was deleted.

Loading

0 comments on commit e809226

Please sign in to comment.