Skip to content

Commit

Permalink
Merge pull request spiffe#662 from marcosy/adding-go-modules
Browse files Browse the repository at this point in the history
Replacing dep with go modules
  • Loading branch information
marcosy authored Jan 4, 2019
2 parents a8aa4d0 + 7fbe74b commit a70be87
Show file tree
Hide file tree
Showing 17 changed files with 390 additions and 950 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ cache:

script:
- ./build.sh setup
- ./build.sh vendor
- ./build.sh utils
- ./build.sh protobuf_verify
- ./build.sh test
Expand Down Expand Up @@ -42,8 +41,8 @@ deploy:
on:
tags: true
condition: $GITHUB_TOKEN != ""

notifications:
slack:
secure: auV9VWkA50+tf4cKUUkMH/KqggKSJCBV9ruLSF1LVgqQYnK34rp/PPzx4gTiQYA07ltnu8Hi13XMoN5+OFsRfzVRCKP1tlGuTvVhpsoyMGiNxBY1Yw2OhZXRoSjCwJkuBsAkkaxAgsC58IEnxhKq+M83dDYx+WiybO+aQnQ6ExbGE4oUBhhBkYKrHy4Kt9/3yWLqicV/VXFtvwbXG5OG1zNNOYCUEud4Y8j6pcb0kyVqlHFjAjasLPsln0QSaTxOThLZCxMZD2zpbI1xxO5tBusqDe1QOMSgsyAbDaNk7wCb2kU+0hRKcfiuWShrswhECSJsYUImLq4c77WbdhrjRgscgY2779T/jaJHbG3Lx7GlDWYLSgFcM8VfZK+K5XPcm35F2qGPiEjtYEEAPS2qQM9PZyvTEVPxjNEc2PE3bINTjibcKbfATNa1ULQvJ6ixtSL9Ao8828iUfaR0mK4eaWnJckov5OaGvah+v6vh49JqZTEN3Or8XTUw0ra14euS6jR30XB2Y3S8/0NuvHY+ytJe36yQn9FdFM3asNpBuNP7F9v00WJr3+Lhg7KHMd0m19ulwtmXiWJYU25AVMk/oXp+aq+678AvhYkYZGaUzC3timsuTlAjH9DA9yxBW+8KE9y46Jq8vXHXhKTfdKDVVUyOFxKKGAjCA5QbeKx+5QU=

21 changes: 7 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ from the SPIFFE project.

For basic development you will need:

* **Go** (https://golang.org/dl/)
* **Dep**, for managing third-party dependancies (https://github.com/golang/dep)
* **Go 1.11** or higher (https://golang.org/dl/)

For development that requires changes to the gRPC interfaces you will need:

Expand All @@ -22,25 +21,23 @@ For development that requires changes to the gRPC interfaces you will need:

# Building

It is assumed that this repository lives in $GOPATH/src/github.com/spiffe/spire on your local disk,
and that your GOPATH only contains one element.
Since go modules are used, this repository can live in any folder on your local disk (it is not required to be in GOPATH).

Because of the use of dep and the unusual layout of this repository a Makefile is provide for
common actions.
A Makefile is provided for common actions.

* `dep ensure` - installs all the dependencies listed in Gopkg.toml
* `make all` - installs 3rd-party dependencies, build all binaries, and run all tests
* `make` - builds all binaries
* `make cmd/spire-agent` - builds one binary
* `make test` - runs all tests

**Other Makefile targets**

* `vendor` - installs 3rd-party dependencies using dep
* `vendor` - Make vendored copy of dependencies using go mod
* `race-test` - run `go test -race`
* `clean` - cleans `vendor` directory, dep cache
* `clean` - cleans `vendor` directory
* `distclean` - removes caches in addition to `make clean`
* `utils` - installs gRPC related development utilities
* `help` - shows makefile targets and description

## Development in Docker

Expand All @@ -60,10 +57,7 @@ $ make container
$ make cmd
```

Because the docker container shares $GOPATH you will not have to re-install the go dependencies
every time you run the container. NOTE: any binaries installed from within the container will be
located in $GOPATH/bin/linux_amd64 to avoid conflicts with the host OS (Packages are automatically
versioned by golang into `$GOPATH/pkg/<os>_<arch>`)
Because the docker container shares `$GOPATH/pkg/mod` you will not have to re-install the go dependencies every time you run the container.

## CI

Expand All @@ -74,7 +68,6 @@ checks. It is also used to bootstrap the Go environment in the Docker container.
* `protobuf` - regenerate the gRPC pb.go and README.md files
* `protobuf_verify` - check that the checked-in generated code is up-to-date
* `distclean` - calls `make distclean` and removes the directory `.build-<os>-<arch>`
* `vendor` - calls `make vendor` and checks that the `Gopkg.lock` file is up-to-date
* `artifact` - generate a `.tgz` containing all of the SPIFFE binaries
* `test` - when called from within a Travis-CI build, runs coverage tests in addition to the
regular tests
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ ENV GOROOT=/root/build
ENV GOBIN=$GOPATH/bin/linux_amd64
ENV PATH=$GOROOT/bin:$GOBIN:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN mkdir /root/go
WORKDIR /root/go/src/github.com/spiffe/spire
WORKDIR /root/spire
Loading

0 comments on commit a70be87

Please sign in to comment.