Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
Some generic project improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark authored and matyix committed Nov 21, 2018
1 parent 94c1f06 commit 6eae966
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -72,7 +72,7 @@ jobs:
- run:
name: Run verification
command:
make verify
make check
environment:
VAULT_ADDR: http://localhost:8200
VAULT_TOKEN: 227e1cce-6bf7-30bb-2d2a-acc854318caf
Expand Down
15 changes: 15 additions & 0 deletions .editorconfig
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.go]
indent_style = tab

[{Makefile,*.mk}]
indent_style = tab
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -20,6 +20,7 @@ operator/tmp/_output/bin/*
/vendor/
/.licensei.cache
bin/*
/build/


# IDE integration
Expand Down
8 changes: 8 additions & 0 deletions .golangci.yml
@@ -0,0 +1,8 @@
run:
skip-dirs:
- operator

linters:
disable:
- errcheck
- megacheck
25 changes: 18 additions & 7 deletions Dockerfile
@@ -1,14 +1,25 @@
FROM golang:1.11-alpine as golang
RUN apk add --update --no-cache ca-certificates curl git make
RUN mkdir -p /go/src/github.com/banzaicloud/bank-vaults
ADD Gopkg.* Makefile /go/src/github.com/banzaicloud/bank-vaults/
WORKDIR /go/src/github.com/banzaicloud/bank-vaults
ARG GO_VERSION=1.11

FROM golang:${GO_VERSION}-alpine AS builder

RUN apk add --update --no-cache ca-certificates make git curl mercurial

ARG PACKAGE=github.com/banzaicloud/bank-vaults

RUN mkdir -p /go/src/${PACKAGE}
WORKDIR /go/src/${PACKAGE}

COPY Gopkg.* Makefile /go/src/${PACKAGE}/
RUN make vendor
ADD . /go/src/github.com/banzaicloud/bank-vaults

COPY . /go/src/${PACKAGE}
RUN go install ./cmd/bank-vaults


FROM alpine:3.7

RUN apk add --no-cache ca-certificates
COPY --from=golang /go/bin/bank-vaults /usr/local/bin/bank-vaults

COPY --from=builder /go/bin/bank-vaults /usr/local/bin/bank-vaults

ENTRYPOINT ["/usr/local/bin/bank-vaults"]
26 changes: 19 additions & 7 deletions Dockerfile.operator
@@ -1,16 +1,28 @@
FROM golang:1.11-alpine as golang
RUN apk add --update --no-cache ca-certificates curl git make
RUN mkdir -p /go/src/github.com/banzaicloud/bank-vaults
ADD Gopkg.* Makefile /go/src/github.com/banzaicloud/bank-vaults/
WORKDIR /go/src/github.com/banzaicloud/bank-vaults
ARG GO_VERSION=1.11

FROM golang:${GO_VERSION}-alpine AS builder

RUN apk add --update --no-cache ca-certificates make git curl mercurial

ARG PACKAGE=github.com/banzaicloud/bank-vaults

RUN mkdir -p /go/src/${PACKAGE}
WORKDIR /go/src/${PACKAGE}

COPY Gopkg.* Makefile /go/src/${PACKAGE}/
RUN make vendor
ADD . /go/src/github.com/banzaicloud/bank-vaults

COPY . /go/src/${PACKAGE}
RUN go install ./operator/cmd/vault-operator


FROM alpine:3.7

RUN apk add --no-cache ca-certificates
COPY --from=golang /go/bin/vault-operator /usr/local/bin/vault-operator

COPY --from=builder /go/bin/vault-operator /usr/local/bin/vault-operator

RUN adduser -D vault-operator
USER vault-operator

ENTRYPOINT ["/usr/local/bin/vault-operator"]
60 changes: 17 additions & 43 deletions Gopkg.toml
@@ -1,33 +1,24 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# 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

required = [
"k8s.io/code-generator/cmd/client-gen"
]

[prune]
go-tests = true
unused-packages = true
non-go = true

[[prune.project]]
name = "k8s.io/code-generator"
unused-packages = false
non-go = false
go-tests = false

[[prune.project]]
name = "k8s.io/gengo"
unused-packages = false
non-go = false
go-tests = false

[[constraint]]
name = "cloud.google.com/go"
version = "0.20.0"
Expand Down Expand Up @@ -110,23 +101,6 @@ version = "v1.1.5"
branch = "master"
# version = "=v0.0.5"

[prune]
go-tests = true
unused-packages = true
non-go = true

[[prune.project]]
name = "k8s.io/code-generator"
unused-packages = false
non-go = false
go-tests = false

[[prune.project]]
name = "k8s.io/gengo"
unused-packages = false
non-go = false
go-tests = false

[[constraint]]
name = "github.com/Azure/azure-sdk-for-go"
version = ">=18.0.0"
Expand Down

0 comments on commit 6eae966

Please sign in to comment.