mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
38 lines
774 B
Text
38 lines
774 B
Text
|
#REGISTRY ?= ensl
|
||
|
PROJECT ?= ensl-plugin
|
||
|
TAG ?= latest
|
||
|
|
||
|
.PHONY: all test clean build
|
||
|
|
||
|
ifdef REGISTRY
|
||
|
IMAGE=$(REGISTRY)/$(PROJECT):$(TAG)
|
||
|
else
|
||
|
IMAGE=$(PROJECT)
|
||
|
endif
|
||
|
|
||
|
all:
|
||
|
@echo "Available targets:"
|
||
|
@echo " * build - build a Docker image for $(IMAGE)"
|
||
|
@echo " * pull - pull $(IMAGE)"
|
||
|
@echo " * push - push $(IMAGE)"
|
||
|
@echo " * test - build and test $(IMAGE)"
|
||
|
|
||
|
build:
|
||
|
docker-compose build -f docker-compose.dev.yml
|
||
|
|
||
|
run: build
|
||
|
docker-compose up -f docker-compose.dev.yml
|
||
|
|
||
|
pull:
|
||
|
docker pull $(IMAGE) || true
|
||
|
|
||
|
push:
|
||
|
docker push $(IMAGE)
|
||
|
|
||
|
clean:
|
||
|
docker ps -a | awk '{ print $$1,$$2 }' | grep $(IMAGE) |awk '{print $$1 }' |xargs -I {} docker rm {}
|
||
|
docker images -a |grep $(IMAGE) |awk '{print $$3}' |xargs -I {} docker rmi {}
|
||
|
|
||
|
test: build
|
||
|
@echo "TODO"
|