Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maint/go mod and valid seperator #10

Merged
merged 12 commits into from
Apr 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.idea
/kubernetes-secret-generator
/dist
35 changes: 0 additions & 35 deletions .gitlab-ci.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
before:
hooks:
- go vet ./...
- go test -v ./...
builds:
-
env:
- CGO_ENABLED=0
- GO111MODULE=on
goos:
- linux
goarch:
- amd64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
dockers:
-
image_templates:
- quay.io/mittwald/kubernetes-secret-generator:latest
- quay.io/mittwald/kubernetes-secret-generator:stable
- quay.io/mittwald/kubernetes-secret-generator:{{ .Tag }}
- quay.io/mittwald/kubernetes-secret-generator:{{ .Tag }}-{{ .Env.GO_VERSION }}
binaries:
- kubernetes-secret-generator
goos: linux
goarch: amd64
goarm: ''
40 changes: 33 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
language: go

go:
- 1.6
- 1.7
- 1.8
- '1.12'

before_script:
- sudo sysctl -w net.ipv4.ip_forward=1

install: true
services:
- docker

env:
global:
- GO111MODULE=on
- CGO_ENABLED=0
- GO_VERSION=1.12
- secure: aa2utqHdo2htOo5T42p7XGT43W95L8kavDICUp16ssEs6BMz/LTfrOn9AB30ZlpfmduzpnEC78+YsbCsoP/k//Z/GmrW0WLOxdWKEgYLnCZvqpI3k1FFvMilxlGaloGl5SMbw1v7f6mpeYmF4lWr7aFsONVu8ivqCZoRJK7QQf8E0175ZHpm6Xjzs1TZUTPT6GGPuWymVhE1MZqJYFwfPSE2xgsv7I4X7s4OLado4zfkxKynt+bV9+Vb960+nAY3oLVK9BYCmAh93uoIX5jveox0io+jrPMXKZRkwpW0jI3TuNnE8UTNKGm27Qj2huQVhFeFy+tGR37L6WDpuT47tD2V3WBo51RcpvZKlJD3HqPb1l7yW5EtLLa3K6lqa+uYbFXEDqMVvyuZhgyc2/rG6HlDf2bfM+/0njEV6XEUH2mLNiV8Viuab40WwZwrq+r5T8HxOZuUg+EShqC1en0VdjSXMWX5VHLlHog9qYe4UoBQw4A9s9DnfAgjTeEZ1wuH1uKoaaUQ+gA2UoZ9ywZxPmNJnq1phTQvQ+LnBiTbqen1C/ugKgkeE1U36hd21N5yjjYXqEZDoNxCuAc0GaucK5TzeJgL2/MJ0x5HetCmHB5T92BG6+2UjqZFfEnDjxszmPa5tXCJUnL4wa6OzgoFVwsez7HfA3SqDfSjf/Rn9s4=
script:
- "go vet $(go list ./... | grep -v vendor)"
- "go test -v $(go list ./... | grep -v vendor)"
- "go build"
- bash <(wget -qO- https://git.io/goreleaser) --snapshot --skip-publish --rm-dist

before_deploy:
- if [[ "${TRAVIS_BRANCH}" == "master" ]] && [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then docker login -u "${DOCKER_LOGIN_NAME}" -p "${DOCKER_LOGIN_PASSWORD}" "${DOCKER_LOGIN_URL}"; fi
- export FULL_IMAGE="${DOCKER_LOGIN_URL}/mittwald/kubernetes-secret-generator"
deploy:
- provider: script
skip_cleanup: true
script: bash <(wget -qO- https://git.io/goreleaser) --snapshot --skip-publish --rm-dist && docker push "${FULL_IMAGE}:latest"
on:
tags: false
branch: master
condition: $TRAVIS_OS_NAME = linux
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash -s -- --rm-dist
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
17 changes: 5 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
FROM golang:1.11

COPY . /go/src/github.com/mittwald/kubernetes-secret-generator
WORKDIR /go/src/github.com/mittwald/kubernetes-secret-generator
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o kubernetes-secret-generator

FROM scratch
MAINTAINER Martin Helmich <[email protected]>

COPY --from=0 /go/src/github.com/mittwald/kubernetes-secret-generator/kubernetes-secret-generator /kubernetes-secret-generator

CMD ["/kubernetes-secret-generator", "-logtostderr"]
FROM scratch
LABEL MAINTAINER="Martin Helmich <[email protected]>"
COPY kubernetes-secret-generator /kubernetes-secret-generator
ENTRYPOINT ["/kubernetes-secret-generator"]
CMD ["-logtostderr"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $ kubectl apply -f https://raw.githubusercontent.com/mittwald/kubernetes-secret-

Add the annotation `secret-generator.v1.mittwald.de/autogenerate` to any Kubernetes
secret object. The value of the annotation can be a field name
(or comma separated list of field names) within the secret; the
(or dot separated list of field names) within the secret; the
SecretGeneratorController will pick up this annotation and add a field [or fields]
(`password` in the example below) to the secret with a randomly generated string value.

Expand All @@ -44,4 +44,4 @@ data:

- Regenerate only certain fields
```
$ kubectl annotate secrets --all secret-generator.v1.mittwald.de/regenerate=password1,password2
$ kubectl annotate secrets --all secret-generator.v1.mittwald.de/regenerate=password1.password2
Loading