oliverdavies.uk/Makefile

37 lines
905 B
Makefile
Raw Normal View History

2021-07-15 23:47:35 +00:00
COMPOSE_PROJECT_NAME?=oliverdavies-uk
2021-07-16 11:49:42 +00:00
DOCKER_WEB_IMAGE_NAME:=ghcr.io/opdavies/$(COMPOSE_PROJECT_NAME)-web
2021-07-15 23:47:35 +00:00
assets-watch:
npm ci
npm run watch
build-images:
2021-07-16 11:09:40 +00:00
docker image build . \
2021-07-15 23:47:35 +00:00
--file tools/docker/images/Dockerfile \
2021-07-16 11:49:42 +00:00
--tag $(DOCKER_WEB_IMAGE_NAME):$(DOCKER_TAG) \
--tag $(DOCKER_WEB_IMAGE_NAME):latest \
2021-07-16 11:09:40 +00:00
--target=production
2021-07-15 23:47:35 +00:00
deploy:
cd tools/deployment && ansible-playbook deploy.yml
2021-07-16 11:09:40 +00:00
destroy:
COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) docker-compose down --volumes --remove-orphans
2021-07-15 23:47:35 +00:00
disable:
COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) docker-compose down
enable:
2021-07-16 11:09:40 +00:00
COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) docker-compose up --detach --build
2021-07-15 23:47:35 +00:00
ps:
COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) docker-compose ps
push-images:
2021-07-16 11:49:42 +00:00
docker image push $(DOCKER_WEB_IMAGE_NAME):$(DOCKER_TAG)
docker image push $(DOCKER_WEB_IMAGE_NAME):latest
2021-07-15 23:47:35 +00:00
.PHONY: *
# vim: noexpandtab filetype=make