Skip to content

Commit

Permalink
Amend Makefile
Browse files Browse the repository at this point in the history
Added --platform flag to enable M* machines to build images. Also added
descriptions to Makefile to increase visability.
ND-168
  • Loading branch information
laurentb4 committed Mar 12, 2024
1 parent 5c50783 commit acc7374
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,37 @@ ifneq (,$(wildcard ./.env))
include .env
endif

authenticate_docker:
.DEFAULT_GOAL := help

.PHONY: authenticate_docker
authenticate_docker: ## Authenticate docker script
./scripts/authenticate_docker.sh

build: authenticate_docker
docker build -t mojo-${ENV}-ima-blackbox-exporter .
.PHONY: build
build: ## Docker build image
$(MAKE) authenticate_docker
docker build --platform linux/amd64 -t mojo-${ENV}-ima-blackbox-exporter .

publish: build
.PHONY: publish
publish: ## Docker build and deploy blackbox exporter repo
$(MAKE) build
ENV=${ENV} ./scripts/deploy.sh blackbox_exporter_repository_v2

deploy:
.PHONY: deploy
deploy: ## Redeploy ecs-service
ENV=${ENV} ./scripts/restart_ecs_service.sh

serve:
.PHONY: serve
serve: ## Run blackbox-exporter
docker run -d -p 9115:9115 --name blackbox-exporter mojo-${ENV}-ima-blackbox-exporter

stop:
.PHONY: stop
stop: ## Stop blackbox-exporter container
docker container stop blackbox-exporter

test:
.PHONY: test
test: ## Run tests
echo "No tests"

.PHONY: build deploy serve test
help:
@grep -h -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

0 comments on commit acc7374

Please sign in to comment.