-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use viper to map env vars as flag (#520)
* feat: use viper to map env vars as flag * feat: prevent race condition * chore: port viper binding to prerun * fix: e2e tests * fix: build step in ci * chore: restore old structure * chore: remove unused code
- Loading branch information
1 parent
8706af4
commit ed7b162
Showing
78 changed files
with
723 additions
and
1,020 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ name: main | |
|
||
steps: | ||
- name: prepare | ||
image: quay.io/sighup/golang:1.22.0 | ||
image: quay.io/sighup/golang:1.22.3 | ||
pull: always | ||
depends_on: | ||
- clone | ||
|
@@ -22,7 +22,7 @@ steps: | |
GOTMPDIR: /drone/src/.go/tmp | ||
|
||
- name: license | ||
image: quay.io/sighup/golang:1.22.0 | ||
image: quay.io/sighup/golang:1.22.3 | ||
pull: always | ||
depends_on: | ||
- prepare | ||
|
@@ -35,7 +35,7 @@ steps: | |
GOTMPDIR: /drone/src/.go/tmp | ||
|
||
- name: lint | ||
image: quay.io/sighup/golang:1.22.0 | ||
image: quay.io/sighup/golang:1.22.3 | ||
pull: always | ||
depends_on: | ||
- prepare | ||
|
@@ -48,7 +48,7 @@ steps: | |
GOTMPDIR: /drone/src/.go/tmp | ||
|
||
- name: test-unit | ||
image: quay.io/sighup/golang:1.22.0 | ||
image: quay.io/sighup/golang:1.22.3 | ||
pull: always | ||
depends_on: | ||
- prepare | ||
|
@@ -61,7 +61,7 @@ steps: | |
GOTMPDIR: /drone/src/.go/tmp | ||
|
||
- name: test-integration | ||
image: quay.io/sighup/golang:1.22.0 | ||
image: quay.io/sighup/golang:1.22.3 | ||
pull: always | ||
depends_on: | ||
- prepare | ||
|
@@ -84,8 +84,8 @@ steps: | |
- apt update | ||
- apt install -y curl git make ssh unzip | ||
# Install Golang & deps | ||
- curl -sL https://go.dev/dl/go1.22.0.linux-amd64.tar.gz -o go1.22.0.tar.gz | ||
- rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.0.tar.gz | ||
- curl -sL https://go.dev/dl/go1.22.3.linux-amd64.tar.gz -o go1.22.3.tar.gz | ||
- rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.3.tar.gz | ||
- echo 'export PATH=$$PATH:/usr/local/go/bin:/root/go/bin' >> /etc/profile | ||
- export PATH=$$PATH:/usr/local/go/bin:/root/go/bin | ||
- go install github.com/onsi/ginkgo/v2/[email protected] | ||
|
@@ -108,7 +108,7 @@ steps: | |
# Run tests | ||
- make test-e2e | ||
# Cleanup | ||
- rm go1.22.0.tar.gz | ||
- rm go1.22.3.tar.gz | ||
- rm awscliv2.zip | ||
environment: | ||
CGO_ENABLED: 0 | ||
|
@@ -132,7 +132,7 @@ steps: | |
from_secret: TERRAFORM_TF_STATES_BUCKET_NAME | ||
|
||
- name: build | ||
image: quay.io/sighup/golang:1.22.0 | ||
image: quay.io/sighup/golang:1.22.3 | ||
pull: always | ||
depends_on: | ||
- lint | ||
|
@@ -158,7 +158,7 @@ steps: | |
from_secret: GITHUB_TOKEN | ||
|
||
- name: build-release | ||
image: quay.io/sighup/golang:1.22.0 | ||
image: quay.io/sighup/golang:1.22.3 | ||
pull: always | ||
depends_on: | ||
- lint | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
bats 1.8.2 | ||
drone 1.7.0 | ||
golang 1.22.0 | ||
golangci-lint 1.55.2 | ||
golang 1.22.3 | ||
golangci-lint 1.59.1 | ||
goreleaser 1.24.0 | ||
kubectx 0.9.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,12 +46,12 @@ env: | |
@grep -v '^#' .env | sed 's/^/export /' | ||
|
||
tools: | ||
@go install github.com/daixiang0/gci@v0.12.1 | ||
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 | ||
@go install github.com/daixiang0/gci@v0.13.4 | ||
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1 | ||
@go install github.com/google/[email protected] | ||
@go install github.com/nikolaydubina/go-cover-treemap@v1.3.0 | ||
@go install github.com/onsi/ginkgo/v2/ginkgo@v2.15.0 | ||
@go install golang.org/x/tools/cmd/goimports@v0.17.0 | ||
@go install github.com/nikolaydubina/go-cover-treemap@v1.4.2 | ||
@go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.0 | ||
@go install golang.org/x/tools/cmd/goimports@v0.22.0 | ||
@go install mvdan.cc/[email protected] | ||
@go install github.com/momaek/[email protected] | ||
|
||
|
@@ -109,12 +109,12 @@ format-go: fmt fumpt imports gci formattag | |
fmt: | ||
@find . -name "*.go" -type f -not -path '*/vendor/*' \ | ||
| sed 's/^\.\///g' \ | ||
| xargs -I {} sh -c 'echo "formatting {}.." && gofmt -w -s {}' | ||
| xargs -I {} -S 5000 sh -c 'echo "formatting {}.." && gofmt -w -s {}' | ||
|
||
fumpt: | ||
@find . -name "*.go" -type f -not -path '*/vendor/*' \ | ||
| sed 's/^\.\///g' \ | ||
| xargs -I {} sh -c 'echo "formatting {}.." && gofumpt -w -extra {}' | ||
| xargs -I {} -S 5000 sh -c 'echo "formatting {}.." && gofumpt -w -extra {}' | ||
|
||
imports: | ||
@goimports -v -w -e -local github.com/sighupio main.go | ||
|
@@ -124,20 +124,20 @@ imports: | |
gci: | ||
@find . -name "*.go" -type f -not -path '*/vendor/*' \ | ||
| sed 's/^\.\///g' \ | ||
| xargs -I {} sh -c 'echo "formatting imports for {}.." && \ | ||
| xargs -I {} -S 5000 sh -c 'echo "formatting imports for {}.." && \ | ||
gci write --skip-generated -s standard -s default -s "Prefix(github.com/sighupio)" {}' | ||
|
||
formattag: | ||
@find . -name "*.go" -type f -not -path '*/vendor/*' \ | ||
| sed 's/^\.\///g' \ | ||
| xargs -I {} sh -c 'formattag -file {}' | ||
| xargs -I {} -S 5000 sh -c 'formattag -file {}' | ||
|
||
.PHONY: lint lint-go | ||
|
||
lint: lint-go | ||
|
||
lint-go: | ||
@GOFLAGS=-mod=mod golangci-lint -v run --color=always --config=${_PROJECT_DIRECTORY}/.rules/.golangci.yml ./... | ||
@GOFLAGS=-mod=mod golangci-lint -v run --color=always --max-same-issues 25 --config=${_PROJECT_DIRECTORY}/.rules/.golangci.yml ./... | ||
|
||
.PHONY: test-unit test-integration test-e2e test-all show-coverage | ||
|
||
|
Oops, something went wrong.