2GOLANGCILINT ?= golangci-lint
5VERSION ?= $(shell git describe --always --dirty --tags 2>/dev/null || echo "undefined")
6# Allow to override image registry.
7REGISTRY ?= quay.io/oauth2-proxy
10GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
11GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
12MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
13MINIMUM_SUPPORTED_GO_MINOR_VERSION = 14
14GO_VERSION_VALIDATION_ERR_MSG = Golang version is not supported, please update to at least $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION).$(MINIMUM_SUPPORTED_GO_MINOR_VERSION)
16DOCKER_BUILD := docker build --build-arg VERSION=${VERSION}
19TESTCOVER ?= -coverprofile c.out
35lint: validate-go-version
36 GO111MODULE=on $(GOLANGCILINT) run
39build: validate-go-version clean $(BINARY)
42 GO111MODULE=on CGO_ENABLED=0 $(GO) build -a -installsuffix cgo -ldflags="-X main.VERSION=${VERSION}" -o $@ github.com/oauth2-proxy/oauth2-proxy
46 $(DOCKER_BUILD) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:latest .
50 $(DOCKER_BUILD) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:latest-amd64 .
51 $(DOCKER_BUILD) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:${VERSION} .
52 $(DOCKER_BUILD) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:${VERSION}-amd64 .
53 $(DOCKER_BUILD) -f Dockerfile.arm64 -t $(REGISTRY)/oauth2-proxy:latest-arm64 .
54 $(DOCKER_BUILD) -f Dockerfile.arm64 -t $(REGISTRY)/oauth2-proxy:${VERSION}-arm64 .
55 $(DOCKER_BUILD) -f Dockerfile.armv6 -t $(REGISTRY)/oauth2-proxy:latest-armv6 .
56 $(DOCKER_BUILD) -f Dockerfile.armv6 -t $(REGISTRY)/oauth2-proxy:${VERSION}-armv6 .
60 docker push $(REGISTRY)/oauth2-proxy:latest
62.PHONY: docker-push-all
63docker-push-all: docker-push
64 docker push $(REGISTRY)/oauth2-proxy:latest-amd64
65 docker push $(REGISTRY)/oauth2-proxy:${VERSION}
66 docker push $(REGISTRY)/oauth2-proxy:${VERSION}-amd64
67 docker push $(REGISTRY)/oauth2-proxy:latest-arm64
68 docker push $(REGISTRY)/oauth2-proxy:${VERSION}-arm64
69 docker push $(REGISTRY)/oauth2-proxy:latest-armv6
70 docker push $(REGISTRY)/oauth2-proxy:${VERSION}-armv6
74 GO111MODULE=on $(GO) test $(TESTCOVER) -v -race ./...
78 BINARY=${BINARY} VERSION=${VERSION} ./dist.sh
80.PHONY: validate-go-version
82 @if [ $(GO_MAJOR_VERSION) -gt $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION) ]; then \
84 elif [ $(GO_MAJOR_VERSION) -lt $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION) ]; then \
85 echo '$(GO_VERSION_VALIDATION_ERR_MSG)';\
87 elif [ $(GO_MINOR_VERSION) -lt $(MINIMUM_SUPPORTED_GO_MINOR_VERSION) ] ; then \
88 echo '$(GO_VERSION_VALIDATION_ERR_MSG)';\
92# local-env can be used to interact with the local development environment
94# make local-env-up # Bring up a basic test environment
95# make local-env-down # Tear down the basic test environment
96# make local-env-nginx-up # Bring up an nginx based test environment
97# make local-env-nginx-down # Tead down the nginx based test environment
100 make -C contrib/local-environment $*
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list