-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (26 loc) · 1.16 KB
/
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
default: build_container
build_container:
$(if $(and $(env),$(repository)),,$(error 'env' and/or 'repository' is not defined))
$(eval build_tag=$(env)-$(shell git rev-parse --short HEAD)-$(shell date +%s))
$(eval container_registry=$(repository)/crypto-bundle/bc-wallet-common-hdwallet-api)
$(eval context=$(or $(context),k0s-dev-cluster))
$(eval platform=$(or $(platform),linux/amd64))
$(eval short_commit_id=$(shell git rev-parse --short HEAD))
$(eval commit_id=$(shell git rev-parse HEAD))
$(eval build_number=0)
$(eval build_date=$(shell date +%s))
$(eval release_tag=$(shell git describe --tags $(commit_id))-$(short_commit_id)-$(build_number))
docker build \
--ssh default=$(SSH_AUTH_SOCK) \
--platform $(platform) \
--build-arg RACE= \
--build-arg RELEASE_TAG=$(release_tag) \
--build-arg COMMIT_ID=$(commit_id) \
--build-arg SHORT_COMMIT_ID=$(short_commit_id) \
--build-arg BUILD_NUMBER=$(build_number) \
--build-arg BUILD_DATE_TS=$(build_date) \
--tag $(container_registry):latest \
--tag $(container_registry):$(build_tag) .
docker push $(container_registry):latest
docker push $(container_registry):$(build_tag)
.PHONY: build_container