Skip to content

Commit

Permalink
upd deps & formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gertd committed Jul 23, 2024
1 parent 87b8e04 commit c5c22b2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ issues:
- text: "G404"
linters:
- gosec
- text: "SA1019"
linters:
- staticcheck

run:
skip-dirs:
Expand Down
56 changes: 29 additions & 27 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
SHELL := $(shell which bash)
SHELL := $(shell which bash)

NO_COLOR := \033[0m
OK_COLOR := \033[32;01m
ERR_COLOR := \033[31;01m
WARN_COLOR := \033[36;01m
ATTN_COLOR := \033[33;01m
NO_COLOR := \033[0m
OK_COLOR := \033[32;01m
ERR_COLOR := \033[31;01m
WARN_COLOR := \033[36;01m
ATTN_COLOR := \033[33;01m

GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
GOPRIVATE := "github.com/aserto-dev"
DOCKER_BUILDKIT := 1
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
GOPRIVATE := "github.com/aserto-dev"
DOCKER_BUILDKIT := 1

EXT_DIR := ./.ext
EXT_BIN_DIR := ${EXT_DIR}/bin
EXT_TMP_DIR := ${EXT_DIR}/tmp
EXT_DIR := ./.ext
EXT_BIN_DIR := ${EXT_DIR}/bin
EXT_TMP_DIR := ${EXT_DIR}/tmp

VAULT_VERSION := 1.8.12
SVU_VERSION := 1.12.0
GOTESTSUM_VERSION := 1.11.0
GOLANGCI-LINT_VERSION := 1.56.2
GORELEASER_VERSION := 1.24.0
WIRE_VERSION := 0.6.0
VAULT_VER := 1.8.12
SVU_VER := 1.12.0
GOTESTSUM_VER := 1.11.0
GOLANGCI-LINT_VER := 1.56.2
GORELEASER_VER := 1.24.0
WIRE_VER := 0.6.0
BUF_VER := 1.34.0

RELEASE_TAG := $$(svu)
RELEASE_TAG := $$(svu)

.DEFAULT_GOAL := build
.DEFAULT_GOAL := build

.PHONY: deps
deps: info install-vault install-svu install-goreleaser install-golangci-lint install-gotestsum
Expand Down Expand Up @@ -88,15 +89,15 @@ info:
.PHONY: install-vault
install-vault: ${EXT_BIN_DIR} ${EXT_TMP_DIR}
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
@curl -s -o ${EXT_TMP_DIR}/vault.zip https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_${GOOS}_${GOARCH}.zip
@curl -s -o ${EXT_TMP_DIR}/vault.zip https://releases.hashicorp.com/vault/${VAULT_VER}/vault_${VAULT_VER}_${GOOS}_${GOARCH}.zip
@unzip -o ${EXT_TMP_DIR}/vault.zip vault -d ${EXT_BIN_DIR}/ &> /dev/null
@chmod +x ${EXT_BIN_DIR}/vault
@${EXT_BIN_DIR}/vault --version

.PHONY: install-buf
install-buf: ${EXT_BIN_DIR}
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
@gh release download --repo https://github.com/bufbuild/buf --pattern "buf-$$(uname -s)-$$(uname -m)" --output "${EXT_BIN_DIR}/buf" --clobber
@gh release download v${BUF_VER} --repo https://github.com/bufbuild/buf --pattern "buf-$$(uname -s)-$$(uname -m)" --output "${EXT_BIN_DIR}/buf" --clobber
@chmod +x ${EXT_BIN_DIR}/buf
@${EXT_BIN_DIR}/buf --version

Expand All @@ -121,15 +122,15 @@ install-svu-linux: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
.PHONY: install-gotestsum
install-gotestsum: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
@gh release download v${GOTESTSUM_VERSION} --repo https://github.com/gotestyourself/gotestsum --pattern "gotestsum_${GOTESTSUM_VERSION}_${GOOS}_${GOARCH}.tar.gz" --output "${EXT_TMP_DIR}/gotestsum.tar.gz" --clobber
@gh release download v${GOTESTSUM_VER} --repo https://github.com/gotestyourself/gotestsum --pattern "gotestsum_${GOTESTSUM_VER}_${GOOS}_${GOARCH}.tar.gz" --output "${EXT_TMP_DIR}/gotestsum.tar.gz" --clobber
@tar -xvf ${EXT_TMP_DIR}/gotestsum.tar.gz --directory ${EXT_BIN_DIR} gotestsum &> /dev/null
@chmod +x ${EXT_BIN_DIR}/gotestsum
@${EXT_BIN_DIR}/gotestsum --version

.PHONY: install-golangci-lint
install-golangci-lint: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
@gh release download v${GOLANGCI-LINT_VERSION} --repo https://github.com/golangci/golangci-lint --pattern "golangci-lint-${GOLANGCI-LINT_VERSION}-${GOOS}-${GOARCH}.tar.gz" --output "${EXT_TMP_DIR}/golangci-lint.tar.gz" --clobber
@gh release download v${GOLANGCI-LINT_VER} --repo https://github.com/golangci/golangci-lint --pattern "golangci-lint-${GOLANGCI-LINT_VER}-${GOOS}-${GOARCH}.tar.gz" --output "${EXT_TMP_DIR}/golangci-lint.tar.gz" --clobber
@tar --strip=1 -xvf ${EXT_TMP_DIR}/golangci-lint.tar.gz --strip-components=1 --directory ${EXT_TMP_DIR} &> /dev/null
@mv ${EXT_TMP_DIR}/golangci-lint ${EXT_BIN_DIR}/golangci-lint
@chmod +x ${EXT_BIN_DIR}/golangci-lint
Expand All @@ -138,21 +139,22 @@ install-golangci-lint: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
.PHONY: install-goreleaser
install-goreleaser: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
@gh release download v${GORELEASER_VERSION} --repo https://github.com/goreleaser/goreleaser --pattern "goreleaser_$$(uname -s)_$$(uname -m).tar.gz" --output "${EXT_TMP_DIR}/goreleaser.tar.gz" --clobber
@gh release download v${GORELEASER_VER} --repo https://github.com/goreleaser/goreleaser --pattern "goreleaser_$$(uname -s)_$$(uname -m).tar.gz" --output "${EXT_TMP_DIR}/goreleaser.tar.gz" --clobber
@tar -xvf ${EXT_TMP_DIR}/goreleaser.tar.gz --directory ${EXT_BIN_DIR} goreleaser &> /dev/null
@chmod +x ${EXT_BIN_DIR}/goreleaser
@${EXT_BIN_DIR}/goreleaser --version

.PHONY: install-wire
install-wire: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
@GOBIN=${PWD}/${EXT_BIN_DIR} go install github.com/google/wire/cmd/wire@v${WIRE_VERSION}
@GOBIN=${PWD}/${EXT_BIN_DIR} go install github.com/google/wire/cmd/wire@v${WIRE_VER}

.PHONY: clean
clean:
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
@rm -rf ${EXT_DIR}
@rm -rf ${BIN_DIR}
@rm -rf ./dist

${BIN_DIR}:
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
Expand Down

0 comments on commit c5c22b2

Please sign in to comment.