make β ΡΡΠΈΠ»ΠΈΡΠ°, Π°Π²ΡΠΎΠΌΠ°ΡΠΈΠ·ΠΈΡΡΡΡΠ°Ρ ΠΏΡΠΎΡΠ΅ΡΡ ΠΏΡΠ΅ΠΎΠ±ΡΠ°Π·ΠΎΠ²Π°Π½ΠΈΡ ΡΠ°ΠΉΠ»ΠΎΠ² ΠΈΠ· ΠΎΠ΄Π½ΠΎΠΉ ΡΠΎΡΠΌΡ Π² Π΄ΡΡΠ³ΡΡ. Π§Π°ΡΠ΅ Π²ΡΠ΅Π³ΠΎ ΡΡΠΎ ΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΈΡ ΠΈΡΡ
ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΊΠΎΠ΄Π° Π² ΠΎΠ±ΡΠ΅ΠΊΡΠ½ΡΠ΅ ΡΠ°ΠΉΠ»Ρ ΠΈ ΠΏΠΎΡΠ»Π΅Π΄ΡΡΡΠ°Ρ ΠΊΠΎΠΌΠΏΠΎΠ½ΠΎΠ²ΠΊΠ° Π² ΠΈΡΠΏΠΎΠ»Π½ΡΠ΅ΠΌΡΠ΅ ΡΠ°ΠΉΠ»Ρ ΠΈΠ»ΠΈ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ.
ΠΠΎΠ½ΡΠΈΠ³ ΡΠ°ΠΉΠ» ΠΊ ΡΡΠΎΠΉ ΡΡΠΈΠ»ΠΈΡΠ΅ β Makefile.
CONTAINER_NAME ?= mycontainer
RELEASE_VERSION ?= 0.0.0
DISTRIB_BUILD_NUMBER ?= 0
DISTRIB_PATH ?= mydistrib.zip
IMAGE_NAME = $(CONTAINER_NAME):$(RELEASE_VERSION)-$(DISTRIB_BUILD_NUMBER)
all: clean check build
build: build-image:
docker build -t $(IMAGE_NAME) ./
build: build-image
docker run -w /build --name $(CONTAINER_NAME) $(IMAGE_NAME) /bin/bash -c "./build.sh $(RELEASE_VERSION) $(DISTRIB_BUILD_NUMBER)"
docker container cp $(CONTAINER_NAME):/some/path/x86_64/cont.rpm
check: build-image
docker run --rm -w /build --name $(CONTAINER_NAME) $(IMAGE_NAME) /bin/bash -c "./check.sh"
clean:
rm -f $(DISTRIB_PATH) /other/path
docker container rm -f $(CONTAINER_NAME) 2>/dev/null || echo 'Container not found'
docker image rm -f $(IMAGE_NAME) 2>/dev/null || echo 'Image not found'
distrib:
cp -r build/liquibase ./
zip -r -Z store $(DISTRIB_PATH) liquibase
.PHONY: all build-image build clean distrib