diff --git a/Makefile b/Makefile index 05c90c6..f83ba11 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,32 @@ -BUILD := $(shell git log -1 --pretty=%h) +BUILD := $(shell git describe --tags --always --dirty) +DIR := $(shell pwd) TEST_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))test # define image names -APP := scidb -REGISTRY := fhprs +APP := fhprs +REGISTRY := seglh # build tags IMG := $(REGISTRY)/$(APP) IMG_VERSIONED := $(IMG):$(BUILD) IMG_LATEST := $(IMG):latest -.PHONY: push build tag test +.PHONY: push build tag test version cleanbuild -.PHONY: build - -push: build tag +push: build docker push $(IMG_VERSIONED) docker push $(IMG_LATEST) -build: - docker build -t $(IMG_VERSIONED) . - -tag: +build: version + docker buildx build --platform linux/amd64 -t $(IMG_VERSIONED) . || docker build -t $(IMG_VERSIONED) . docker tag $(IMG_VERSIONED) $(IMG_LATEST) + docker save $(IMG_VERSIONED) | gzip > $(DIR)/$(REGISTRY)-$(APP):$(BUILD).tar.gz test: build echo "Incomplete VCF (positions missing):" docker run -it --rm -v $(TEST_DIR):/resources $(IMG_VERSIONED) /resources/incomplete.vcf echo "Complete VCF (all variant positions covered):" docker run -it --rm -v $(TEST_DIR):/resources $(IMG_VERSIONED) /resources/complete.vcf + +cleanbuild: + docker buildx build --platform linux/amd64 --no-cache -t $(IMG_VERSIONED) . \ No newline at end of file diff --git a/README b/README.md similarity index 56% rename from README rename to README.md index 442046f..62a3ed6 100644 --- a/README +++ b/README.md @@ -9,6 +9,16 @@ Code adopted from Bristol and modernised for python3 and pyVCF. Uses build 38 ge ## Docker image build `make build` +To build the docker image from scratch, using no cached layers: + +`make cleanbuild` + +## Docker image upload +To upload the built docker image to DockerHub: + +`make push` + ## Test -This runs against the two files with all or paritally missing positions +This runs against the two files with all or partially missing positions + `make test`