Skip to content

Instantly share code, notes, and snippets.

@undernewmanagement
Created December 1, 2022 15:02
Show Gist options
  • Save undernewmanagement/fbc924185f8a354d81f589031d64280d to your computer and use it in GitHub Desktop.
Save undernewmanagement/fbc924185f8a354d81f589031d64280d to your computer and use it in GitHub Desktop.
TAG:=$(shell date "+%Y%m%d%H%M")
HOST:=yourhost.com
IMAGE_NAME:=screenshots
###############################################################################
# HELP / DEFAULT COMMAND
###############################################################################
.PHONY: help
help:
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: build
build: ## Build the screenshots services
docker build -t $(IMAGE_NAME) -t $(IMAGE_NAME):$(TAG) .
.PHONY: build-prod
build-prod: ## Build the screenshots services remotely
docker -H ssh://$(HOST) build -t $(IMAGE_NAME) -t $(IMAGE_NAME):$(TAG) .
.PHONY: prod-deploy
prod-deploy: ## deploy to production
docker-compose -H ssh://$(HOST) up -d
.PHONY: prod-migrate
prod-migrate: ## run production migrations
docker-compose -H ssh://$(HOST) exec web ./manage.py migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment