Skip to content

Commit

Permalink
Adopt go mod
Browse files Browse the repository at this point in the history
Also, "-i" is unnecessary now we've switched to go 1.12.
  • Loading branch information
bpineau committed Jul 6, 2019
1 parent 6e315e8 commit ca3e1e2
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 402 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export GO111MODULE=on
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ kubernetes-backup
dist/*
profile.cov
katafygio.8.gz
katafygio
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
FROM golang:1.12 as builder
WORKDIR /go/src/github.com/bpineau/katafygio
COPY . .
RUN go get -u github.com/Masterminds/glide
RUN make deps
RUN make build

FROM alpine:3.10
Expand Down
14 changes: 6 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
GOLANGCI_VERSION="1.12.5"
export GO111MODULE := on

all: build

GOLANGCI_VERSION="1.12.5"
tools:
which golangci-lint || ( \
curl -sfL "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_VERSION}/golangci-lint-${GOLANGCI_VERSION}-linux-amd64.tar.gz" | \
tar xz --strip-components 1 --wildcards '*/golangci-lint' && \
chmod 755 golangci-lint && \
mv golangci-lint ${GOPATH}/bin/ \
)
which glide || go get -u github.com/Masterminds/glide
which goveralls || go get github.com/mattn/goveralls

lint:
Expand All @@ -21,18 +22,15 @@ man:
fmt:
go fmt ./...

deps:
glide install

build:
env CGO_ENABLED=0 go build -i
env CGO_ENABLED=0 go build

install:
env CGO_ENABLED=0 go install

clean:
rm -rf dist/
go clean -i
go clean

coverall:
goveralls -coverprofile=profile.cov -service=travis-ci -package github.com/bpineau/katafygio/pkg/...
Expand All @@ -42,7 +40,7 @@ e2e:
go test -count=1 -v assets/e2e_test.go

test:
go test -i github.com/bpineau/katafygio/...
go test github.com/bpineau/katafygio/...
go test -race -cover -coverprofile=profile.cov github.com/bpineau/katafygio/...

.PHONY: tools lint fmt install clean coverall test all
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,6 @@ You can also deploy with the provided [helm](https://helm.sh/) chart:
helm install --name kf-backups --namespace kube-system assets/helm-chart/katafygio/
```

If you want to build from sources, assuming you have go 1.10 or up and glide in the path, and GOPATH configured:

```shell
make deps
make build
```

## See Also

* [Heptio Ark](https://github.com/heptio/ark) does sophisticated clusters backups, including volumes
Expand Down
Loading

0 comments on commit ca3e1e2

Please sign in to comment.