forked from kahing/goofys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.45 KB
/
Makefile
File metadata and controls
58 lines (46 loc) · 1.45 KB
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
49
50
51
52
53
54
55
56
57
58
export CGO_ENABLED=0
run-test: s3proxy.jar
./test/run-tests.sh
s3proxy.jar:
wget https://github.com/gaul/s3proxy/releases/download/s3proxy-1.8.0/s3proxy -O s3proxy.jar
get-deps: s3proxy.jar
go get -t ./...
build:
go build -ldflags "-X main.Version=`git rev-parse HEAD`"
install:
go install -ldflags "-X main.Version=`git rev-parse HEAD`"
SERVICE=goofys
PATH_DOCKER_FILE=$(realpath ./build/Dockerfile)
DOCKER_REGISTRY_ENTRY=$(AWS_ECR_REGISTRY)/core/$(SERVICE)
ifneq ($(GIT_TAG),)
IMAGE_TAG = $(GIT_TAG)
else ifeq ($(GIT_BRANCH),master)
IMAGE_TAG = "latest"
else ifneq ($(GIT_BRANCH),)
IMAGE_TAG = $(GIT_BRANCH)
endif
.PHONY: docker_image_build
docker_image_build:
@echo ">>> Building docker image"
docker build \
-t $(SERVICE) \
--build-arg GIT_REPO="$(GIT_REPO)" \
--build-arg GIT_TAG="$(GIT_TAG)" \
--build-arg GIT_BRANCH="$(GIT_BRANCH)" \
--build-arg GIT_COMMIT="$(GIT_COMMIT)" \
-f $(PATH_DOCKER_FILE) \
.
.PHONY: docker_image_inspect
docker_image_inspect:
@echo ">>> Inspecting docker container"
docker inspect \
-f '{{index .ContainerConfig.Labels "repo"}}' \
-f '{{index .ContainerConfig.Labels "tag"}}' \
-f '{{index .ContainerConfig.Labels "branch"}}' \
-f '{{index .ContainerConfig.Labels "commit"}}' \
$(SERVICE)
.PHONY: docker_image_registry_push
docker_image_registry_push:
@echo ">>> Tag and push docker image"
@docker tag $(SERVICE) $(DOCKER_REGISTRY_ENTRY):$(IMAGE_TAG)
@docker push $(DOCKER_REGISTRY_ENTRY):$(IMAGE_TAG)