-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
35 lines (27 loc) · 960 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
SHELL=/bin/bash -e -o pipefail
PWD = $(shell pwd)
export PATH := $(PWD)/bin:$(PATH)
export CGO_ENABLED = 0
# https://github.com/golangci/golangci-lint/releases
GOLANGCI_VERSION = 1.56.2
VERSION ?= 0.0.1
IMAGE_TAG_BASE ?= stackitcloud/fake-jwt-server
IMG ?= $(IMAGE_TAG_BASE):$(VERSION)
download:
go mod download
.PHONY: build
build:
CGO_ENABLED=0 go build -ldflags "-s -w" -o ./bin/fake-jwt-server -v cmd/fakejwtserver/main.go
.PHONY: docker-build
docker-build:
GOOS=linux CGO_ENABLED=0 go build -ldflags "-s -w" -o ./fake-jwt-server -v cmd/fakejwtserver/main.go
docker build -t $(IMG) -f Dockerfile .
rm fake-jwt-server
GOLANGCI_LINT = bin/golangci-lint-$(GOLANGCI_VERSION)
$(GOLANGCI_LINT):
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b bin v$(GOLANGCI_VERSION)
@mv bin/golangci-lint "$(@)"
lint: $(GOLANGCI_LINT) download
$(GOLANGCI_LINT) run -v
run:
go run cmd/fakejwtserver/main.go