-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathMakefile
48 lines (37 loc) · 993 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
39
40
41
42
43
44
45
46
47
48
# Makefile for the Docker image upmcenterprises/registry-creds
# MAINTAINER: Steve Sloka <[email protected]>
# If you update this image please bump the tag value before pushing.
TAG = 1.10
PREFIX = upmcenterprises
BIN = registry-creds
GO111MODULE=off
# docker build arguments for internal proxy
ifneq ($(http_proxy),)
HTTP_PROXY_BUILD_ARG=--build-arg http_proxy=$(http_proxy)
else
HTTP_PROXY_BUILD_ARG=
endif
ifneq ($(https_proxy),)
HTTPS_PROXY_BUILD_ARG=--build-arg https_proxy=$(https_proxy)
else
HTTPS_PROXY_BUILD_ARG=
endif
.PHONY: all
all: container
.PHONY: build
build: main.go
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -o $(BIN) --ldflags '-w' $<
.PHONY: container
container: build
docker build -t $(PREFIX)/$(BIN):$(TAG) \
$(HTTP_PROXY_BUILD_ARG) \
$(HTTPS_PROXY_BUILD_ARG) .
.PHONY: push
push:
docker push $(PREFIX)/$(BIN):$(TAG)
.PHONY: clean
clean:
rm -f $(BIN)
.PHONY: test
test: clean
go test -v $(go list ./... | grep -v vendor)