1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2024-11-24 08:52:25 +02:00
oauth2-proxy/Makefile

65 lines
1.9 KiB
Makefile
Raw Normal View History

2019-01-04 12:58:30 +02:00
include .env
BINARY := oauth2_proxy
2019-02-08 12:10:52 +02:00
VERSION := $(shell git describe --always --dirty --tags 2>/dev/null || echo "undefined")
# Allow to override image registry.
REGISTRY ?= quay.io/pusher
2019-01-07 18:41:11 +02:00
.NOTPARALLEL:
2019-01-04 12:58:30 +02:00
.PHONY: all
all: lint $(BINARY)
2019-01-04 12:58:30 +02:00
.PHONY: clean
clean:
rm -rf release
rm -f $(BINARY)
.PHONY: distclean
distclean: clean
rm -rf vendor
.PHONY: lint
lint:
GO111MODULE=on $(GOLANGCILINT) run
2019-01-04 12:58:30 +02:00
.PHONY: build
build: clean $(BINARY)
$(BINARY):
GO111MODULE=on CGO_ENABLED=0 $(GO) build -a -installsuffix cgo -ldflags="-X main.VERSION=${VERSION}" -o $@ github.com/pusher/oauth2_proxy
2019-01-04 12:58:30 +02:00
.PHONY: docker
docker:
docker build -f Dockerfile -t $(REGISTRY)/oauth2_proxy:latest .
.PHONY: docker-all
docker-all: docker
docker build -f Dockerfile -t $(REGISTRY)/oauth2_proxy:latest-amd64 .
docker build -f Dockerfile -t $(REGISTRY)/oauth2_proxy:${VERSION} .
docker build -f Dockerfile -t $(REGISTRY)/oauth2_proxy:${VERSION}-amd64 .
docker build -f Dockerfile.arm64 -t $(REGISTRY)/oauth2_proxy:latest-arm64 .
docker build -f Dockerfile.arm64 -t $(REGISTRY)/oauth2_proxy:${VERSION}-arm64 .
docker build -f Dockerfile.armv6 -t $(REGISTRY)/oauth2_proxy:latest-armv6 .
docker build -f Dockerfile.armv6 -t $(REGISTRY)/oauth2_proxy:${VERSION}-armv6 .
2019-02-08 12:05:57 +02:00
.PHONY: docker-push
docker-push:
docker push $(REGISTRY)/oauth2_proxy:latest
2019-02-08 12:05:57 +02:00
.PHONY: docker-push-all
docker-push-all: docker-push
docker push $(REGISTRY)/oauth2_proxy:latest-amd64
docker push $(REGISTRY)/oauth2_proxy:${VERSION}
docker push $(REGISTRY)/oauth2_proxy:${VERSION}-amd64
docker push $(REGISTRY)/oauth2_proxy:latest-arm64
docker push $(REGISTRY)/oauth2_proxy:${VERSION}-arm64
docker push $(REGISTRY)/oauth2_proxy:latest-armv6
docker push $(REGISTRY)/oauth2_proxy:${VERSION}-armv6
2019-01-04 12:58:30 +02:00
.PHONY: test
test: lint
GO111MODULE=on $(GO) test -v -race ./...
2019-01-04 12:58:30 +02:00
.PHONY: release
2019-01-07 18:41:11 +02:00
release: lint test
BINARY=${BINARY} VERSION=${VERSION} ./dist.sh