Skip to content

Commit

Permalink
Added dependency management
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Dines committed Jul 31, 2018
1 parent 657a05c commit 02f2e77
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
steps:
- checkout

- run: &install_dep
name: Install dep
command: command -v dep >/dev/null || curl 'https://raw.githubusercontent.com/golang/dep/master/install.sh' | sh

- run: make deps

- run: make lint
Expand Down Expand Up @@ -51,6 +55,8 @@ jobs:
steps:
- checkout

- run: *install_dep

- attach_workspace:
at: bin

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
bin/**
vendor/**
coverage.out
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM golang:latest AS build
WORKDIR /go/src/github.com/nathandines/forge
COPY . .

RUN command -v dep >/dev/null || \
curl 'https://raw.githubusercontent.com/golang/dep/master/install.sh' | sh

RUN make clean && \
make deps && \
make
Expand Down
119 changes: 119 additions & 0 deletions Gopkg.lock

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

42 changes: 42 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[[constraint]]
name = "github.com/aws/aws-sdk-go"
version = "1.15.1"

[[constraint]]
name = "github.com/ghodss/yaml"
version = "1.0.0"

[[constraint]]
name = "github.com/spf13/cobra"
version = "0.0.3"

[prune]
go-tests = true
unused-packages = true
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ coverage:
go tool cover -html=coverage.out

deps:
go get -v -d -t ./...
dep ensure -v -vendor-only

clean:
rm -rf bin

lint:
$(MAKE) -k gofmt govet godiff

GOFMT_CMD = gofmt -s -d .
GOFMT_CMD = gofmt -s -d main.go forgelib commands
gofmt:
@echo '$(GOFMT_CMD)'
@fmtout="$$($(GOFMT_CMD))"; \
Expand Down

0 comments on commit 02f2e77

Please sign in to comment.