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 = 15
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)
17TESTCOVER ?= -coverprofile c.out
33lint: validate-go-version
34 GO111MODULE=on $(GOLANGCILINT) run
37build: validate-go-version clean $(BINARY)
40 CGO_ENABLED=0 $(GO) build -a -installsuffix cgo -ldflags="-X main.VERSION=${VERSION}" -o $@ github.com/oauth2-proxy/oauth2-proxy/v7
42DOCKER_BUILD_PLATFORM ?= linux/amd64,linux/arm64,linux/arm/v6
44DOCKER_BUILD := docker build --build-arg VERSION=${VERSION}
45DOCKER_BUILDX := docker buildx build ${DOCKER_BUILDX_ARGS} --platform ${DOCKER_BUILD_PLATFORM} --build-arg VERSION=${VERSION}
49 $(DOCKER_BUILDX) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:latest .
53 $(DOCKER_BUILD) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:latest-amd64 .
54 $(DOCKER_BUILD) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:${VERSION} .
55 $(DOCKER_BUILD) -f Dockerfile -t $(REGISTRY)/oauth2-proxy:${VERSION}-amd64 .
56 $(DOCKER_BUILD) -f Dockerfile.arm64 -t $(REGISTRY)/oauth2-proxy:latest-arm64 .
57 $(DOCKER_BUILD) -f Dockerfile.arm64 -t $(REGISTRY)/oauth2-proxy:${VERSION}-arm64 .
58 $(DOCKER_BUILD) -f Dockerfile.armv6 -t $(REGISTRY)/oauth2-proxy:latest-armv6 .
59 $(DOCKER_BUILD) -f Dockerfile.armv6 -t $(REGISTRY)/oauth2-proxy:${VERSION}-armv6 .
63 docker buildx build --push --platform ${DOCKER_BUILD_PLATFORM} -t $(REGISTRY)/oauth2-proxy:latest .
65.PHONY: docker-push-all
66docker-push-all: docker-push
67 docker push $(REGISTRY)/oauth2-proxy:latest-amd64
68 docker push $(REGISTRY)/oauth2-proxy:${VERSION}
69 docker push $(REGISTRY)/oauth2-proxy:${VERSION}-amd64
70 docker push $(REGISTRY)/oauth2-proxy:latest-arm64
71 docker push $(REGISTRY)/oauth2-proxy:${VERSION}-arm64
72 docker push $(REGISTRY)/oauth2-proxy:latest-armv6
73 docker push $(REGISTRY)/oauth2-proxy:${VERSION}-armv6
79.PHONY: verify-generate
80verify-generate: generate
85 GO111MODULE=on $(GO) test $(TESTCOVER) -v -race ./...
88release: validate-go-version lint test
89 BINARY=${BINARY} VERSION=${VERSION} ./dist.sh
91.PHONY: validate-go-version
93 @if [ $(GO_MAJOR_VERSION) -gt $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION) ]; then \
95 elif [ $(GO_MAJOR_VERSION) -lt $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION) ]; then \
96 echo '$(GO_VERSION_VALIDATION_ERR_MSG)';\
98 elif [ $(GO_MINOR_VERSION) -lt $(MINIMUM_SUPPORTED_GO_MINOR_VERSION) ] ; then \
99 echo '$(GO_VERSION_VALIDATION_ERR_MSG)';\
103# local-env can be used to interact with the local development environment
105# make local-env-up # Bring up a basic test environment
106# make local-env-down # Tear down the basic test environment
107# make local-env-nginx-up # Bring up an nginx based test environment
108# make local-env-nginx-down # Tead down the nginx based test environment
111 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