fup
This commit is contained in:
parent
f08ffe10d8
commit
13ac2b6959
4
Makefile
4
Makefile
|
@ -2,9 +2,11 @@
|
||||||
# Makefile for Cadoles SP
|
# Makefile for Cadoles SP
|
||||||
################################
|
################################
|
||||||
|
|
||||||
IMAGE_REPO := reg.cadoles.com/cadoles
|
IMAGE_REPO ?= reg.cadoles.com/cadoles
|
||||||
IMAGE_VERSION ?= 0.0.1
|
IMAGE_VERSION ?= 0.0.1
|
||||||
|
|
||||||
DAY_SUFFIX_TAG ?= $(shell date +%Y%m%d)
|
DAY_SUFFIX_TAG ?= $(shell date +%Y%m%d)
|
||||||
|
|
||||||
|
COMMIT_ID ?= $(shell git rev-parse --short --verify HEAD)
|
||||||
|
|
||||||
include main.mk
|
include main.mk
|
||||||
|
|
9
main.mk
9
main.mk
|
@ -28,12 +28,12 @@ define install_trivy
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define release_image
|
define release_image
|
||||||
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-$(DAY_SUFFIX_TAG) ; \
|
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-$(COMMIT_ID) ; \
|
||||||
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION); \
|
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:$(IMAGE_VERSION); \
|
||||||
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:latest ; \
|
docker tag $(IMAGE_REPO)/$1:$(IMAGE_VERSION) $(IMAGE_REPO)/$1:latest ; \
|
||||||
docker push $(IMAGE_REPO)/$1:latest ; \
|
docker push $(IMAGE_REPO)/$1:latest ; \
|
||||||
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION) ; \
|
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION) ; \
|
||||||
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-$(DAY_SUFFIX_TAG)
|
docker push $(IMAGE_REPO)/$1:$(IMAGE_VERSION)-$(COMMIT_ID)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
#list:
|
#list:
|
||||||
|
@ -57,9 +57,12 @@ release: ${IMAGES_DIR}/*
|
||||||
@for name in $(basename $(notdir $^)); do \
|
@for name in $(basename $(notdir $^)); do \
|
||||||
$(call release_image,$${name},base); \
|
$(call release_image,$${name},base); \
|
||||||
done;\
|
done;\
|
||||||
|
git tag -f -a $(IMAGE_VERSION) -m "Version $(IMAGE_VERSION) released"; \
|
||||||
|
git tag -f -a $(IMAGE_VERSION)-$(COMMIT_ID) -m "Version $(IMAGE_VERSION)-$(COMMIT_ID) released"; \
|
||||||
|
git tag -f -a $(IMAGE_VERSION)-latest -m "Version $(IMAGE_VERSION)-latest released"; \
|
||||||
|
|
||||||
_release:
|
_release:
|
||||||
docker tag $(IMAGE_FULL_NAME):$(IMAGE_TAG) $(IMAGE_FULL_NAME):$(IMAGE_TAG)-$(IMAGE_VERSION)-$(DAY_SUFFIX_TAG)
|
docker tag $(IMAGE_FULL_NAME):$(IMAGE_TAG) $(IMAGE_FULL_NAME):$(IMAGE_TAG)-$(IMAGE_VERSION)-$(COMMIT_ID)
|
||||||
docker tag $(IMAGE_FULL_NAME):$(IMAGE_TAG) $(IMAGE_FULL_NAME):$(IMAGE_TAG)-$(IMAGE_VERSION)
|
docker tag $(IMAGE_FULL_NAME):$(IMAGE_TAG) $(IMAGE_FULL_NAME):$(IMAGE_TAG)-$(IMAGE_VERSION)
|
||||||
docker tag $(IMAGE_FULL_NAME):$(IMAGE_TAG) $(IMAGE_FULL_NAME):$(IMAGE_TAG)-latest
|
docker tag $(IMAGE_FULL_NAME):$(IMAGE_TAG) $(IMAGE_FULL_NAME):$(IMAGE_TAG)-latest
|
||||||
docker push $(IMAGE_FULL_NAME):$(IMAGE_TAG)-$(IMAGE_VERSION)-$(DAY_SUFFIX_TAG)
|
docker push $(IMAGE_FULL_NAME):$(IMAGE_TAG)-$(IMAGE_VERSION)-$(DAY_SUFFIX_TAG)
|
||||||
|
|
Loading…
Reference in New Issue