forked from bitly/oauth2_proxy
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
38 lines (28 loc) · 803 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
36
37
38
VERSION := $(shell git describe --always --tags --abbrev=0 | tail -c +2)
RELEASE := $(shell git describe --always --tags | awk -F- '{ if ($$2) dot="."} END { printf "1%s%s%s%s\n",dot,$$2,dot,$$3}')
.PHONY: build test
default: clean test build
test:
go test -timeout 60s ./...
clean:
rm -rf build
build:
mkdir -p build/usr/bin
go build -ldflags "-X main.VERSION=${VERSION}-${RELEASE}" -o build/usr/bin/oauth2-proxy .
rpm:
fpm -t rpm \
-s "dir" \
--description "OAuth2-proxy" \
-C ./build/ \
--vendor "SKB Kontur" \
--name "oauth2-proxy" \
--version "${VERSION}" \
--iteration "${RELEASE}" \
-p build
default: build
run: clean build
./build/usr/bin/oauth2-proxy -provider=passport -config etc/oauth2_proxy.cfg
docker:
docker-compose build
up: docker
docker-compose up -d