parent
13a01e7c56
commit
c6e7d68016
52
Makefile
52
Makefile
@ -15,60 +15,54 @@ PACKAGE_NAME := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW)
|
|||||||
PACKAGE_VERSION := $(PRODUCT_VERSION)-$(BUILD_NUMBER)
|
PACKAGE_VERSION := $(PRODUCT_VERSION)-$(BUILD_NUMBER)
|
||||||
PACKAGE_URL := http://$(S3_BUCKET).s3.amazonaws.com/$(COMPANY_NAME_LOW)/$(RELEASE_BRANCH)/ubuntu/$(PACKAGE_NAME)_$(PACKAGE_VERSION)_amd64.deb
|
PACKAGE_URL := http://$(S3_BUCKET).s3.amazonaws.com/$(COMPANY_NAME_LOW)/$(RELEASE_BRANCH)/ubuntu/$(PACKAGE_NAME)_$(PACKAGE_VERSION)_amd64.deb
|
||||||
|
|
||||||
UPDATE_LATEST := false
|
ifeq ($(RELEASE_BRANCH),$(filter $(RELEASE_BRANCH),unstable testing))
|
||||||
|
DOCKER_TAG := $(subst -,.,$(PACKAGE_VERSION))
|
||||||
ifneq (,$(findstring develop,$(GIT_BRANCH)))
|
|
||||||
DOCKER_TAG += $(subst -,.,$(PACKAGE_VERSION))
|
|
||||||
DOCKER_TAGS += latest
|
|
||||||
else ifneq (,$(findstring release,$(GIT_BRANCH)))
|
|
||||||
DOCKER_TAG += $(subst -,.,$(PACKAGE_VERSION))
|
|
||||||
else ifneq (,$(findstring hotfix,$(GIT_BRANCH)))
|
|
||||||
DOCKER_TAG += $(subst -,.,$(PACKAGE_VERSION))
|
|
||||||
else
|
else
|
||||||
DOCKER_TAG += $(subst -,.,$(PACKAGE_VERSION))-$(subst /,-,$(GIT_BRANCH))
|
DOCKER_TAG := $(subst -,.,$(PACKAGE_VERSION))-$(subst /,-,$(GIT_BRANCH))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DOCKER_TAGS += $(DOCKER_TAG)
|
DOCKER_IMAGE := $(subst -,,$(COMPANY_NAME_LOW))/4testing-$(PRODUCT_NAME_LOW)
|
||||||
|
DOCKER_DUMMY := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW)__$(DOCKER_TAG).dummy
|
||||||
DOCKER_REPO = $(COMPANY_NAME_LOW_ESCAPED)/4testing-$(PRODUCT_NAME_LOW)
|
|
||||||
|
|
||||||
COLON := __colon__
|
|
||||||
DOCKER_TARGETS := $(foreach TAG,$(DOCKER_TAGS),$(DOCKER_REPO)$(COLON)$(TAG))
|
|
||||||
|
|
||||||
DOCKER_ARCH := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW)_$(PACKAGE_VERSION).tar.gz
|
DOCKER_ARCH := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW)_$(PACKAGE_VERSION).tar.gz
|
||||||
|
|
||||||
DOCKER_ARCH_URI := $(COMPANY_NAME_LOW)/$(RELEASE_BRANCH)/docker/$(notdir $(DOCKER_ARCH))
|
DOCKER_ARCH_URI := $(COMPANY_NAME_LOW)/$(RELEASE_BRANCH)/docker/$(notdir $(DOCKER_ARCH))
|
||||||
|
|
||||||
.PHONY: all clean clean-docker deploy docker publish
|
.PHONY: all clean clean-docker image deploy docker publish
|
||||||
|
|
||||||
$(DOCKER_TARGETS): $(DEB_REPO_DATA)
|
$(DOCKER_DUMMY):
|
||||||
docker pull ubuntu:20.04
|
docker pull ubuntu:20.04
|
||||||
docker build \
|
docker build \
|
||||||
--build-arg PACKAGE_URL=$(PACKAGE_URL) \
|
--build-arg PACKAGE_URL=$(PACKAGE_URL) \
|
||||||
--build-arg COMPANY_NAME=$(COMPANY_NAME_LOW) \
|
--build-arg COMPANY_NAME=$(COMPANY_NAME_LOW) \
|
||||||
--build-arg PRODUCT_NAME=$(PRODUCT_NAME_LOW) \
|
--build-arg PRODUCT_NAME=$(PRODUCT_NAME_LOW) \
|
||||||
--build-arg ONLYOFFICE_VALUE=$(ONLYOFFICE_VALUE) \
|
--build-arg ONLYOFFICE_VALUE=$(ONLYOFFICE_VALUE) \
|
||||||
-t $(subst $(COLON),:,$@) . &&\
|
-t $(DOCKER_IMAGE):$(DOCKER_TAG) . && \
|
||||||
mkdir -p $$(dirname $@) && \
|
mkdir -p $$(dirname $@) && \
|
||||||
echo "Done" > $@
|
echo "Done" > $@
|
||||||
|
|
||||||
$(DOCKER_ARCH): $(DOCKER_TARGETS)
|
$(DOCKER_ARCH): $(DOCKER_DUMMY)
|
||||||
docker save $(DOCKER_REPO):$(DOCKER_TAG) | \
|
docker save $(DOCKER_IMAGE):$(DOCKER_TAG) | \
|
||||||
gzip > $@
|
gzip > $@
|
||||||
|
|
||||||
all: $(DOCKER_TARGETS)
|
all: image
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rfv $(DOCKER_TARGETS) $(DOCKER_ARCH)
|
rm -rfv *.dummy *.tar.gz
|
||||||
|
|
||||||
clean-docker:
|
clean-docker:
|
||||||
docker rmi -f $$(docker images -q $(COMPANY_NAME_LOW)/*) || exit 0
|
docker rmi -f $$(docker images -q $(COMPANY_NAME_LOW)/*) || exit 0
|
||||||
|
|
||||||
deploy: $(DOCKER_TARGETS)
|
image: $(DOCKER_DUMMY)
|
||||||
$(foreach TARGET,$(DOCKER_TARGETS), \
|
|
||||||
|
deploy: $(DOCKER_DUMMY)
|
||||||
for i in {1..3}; do \
|
for i in {1..3}; do \
|
||||||
docker push $(subst $(COLON),:,$(TARGET)) && break || sleep 1m; \
|
docker push $(DOCKER_IMAGE):$(DOCKER_TAG) && break || sleep 1m; \
|
||||||
done;)
|
done
|
||||||
|
ifeq ($(RELEASE_BRANCH),unstable)
|
||||||
|
docker tag $(DOCKER_IMAGE):$(DOCKER_TAG) $(DOCKER_IMAGE):latest
|
||||||
|
for i in {1..3}; do \
|
||||||
|
docker push $(DOCKER_IMAGE):latest && break || sleep 1m; \
|
||||||
|
done
|
||||||
|
endif
|
||||||
|
|
||||||
publish: $(DOCKER_ARCH)
|
publish: $(DOCKER_ARCH)
|
||||||
aws s3 cp --no-progress --acl public-read \
|
aws s3 cp --no-progress --acl public-read \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user