43 lines
1.4 KiB
Makefile
43 lines
1.4 KiB
Makefile
## This Makefile uses the help target explained in the following blogpost:
|
|
##
|
|
## https://victoria.dev/blog/how-to-create-a-self-documenting-makefile/
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
# splits current git annotated tag into 'MAJOR MINOR PATCH EXTRAS'.
|
|
# intended to be used as arguments for certain scripts requiring a semver as args
|
|
current_semver := $(shell git describe | tr -d 'v' | tr '.' ' ' | tr '-' ' ')
|
|
|
|
.PHONY: help
|
|
help: ## Show this help
|
|
@grep -E -h '\s##\s' $(MAKEFILE_LIST) | \
|
|
sort | \
|
|
awk \
|
|
'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
|
|
|
.PHONY: go-install
|
|
go-install: ## Use `go install` to build and link the executable
|
|
go install -a ./cmd/presences/
|
|
|
|
.PHONY: docker-build
|
|
docker-build: ## Build container image
|
|
#docker-compose build \
|
|
#--build-arg bottin_version=`git describe`
|
|
docker-compose build
|
|
|
|
.PHONY: docker-deploy
|
|
docker-deploy: ## Using `docker-compose up`, deploy the database and containers
|
|
docker-compose up -d
|
|
|
|
.PHONY: docker-tag-from-git
|
|
docker-tag-from-git: ## Tag latest image according to annotated tag from `git describe`
|
|
./scripts/docker-tag.sh $(current_semver)
|
|
|
|
.PHONY: docker-push-from-git
|
|
docker-push-from-git: ## Push images to git.agecem.com according to annotated tag from `git describe`
|
|
./scripts/docker-push.sh $(current_semver)
|
|
|
|
## pipelines
|
|
|
|
.PHONY: deploy
|
|
deploy: docker-build docker-deploy ## Build and deploy container image
|