-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (41 loc) · 1.47 KB
/
Makefile
File metadata and controls
52 lines (41 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.PHONY: \
image \
up \
docker-compose \
test \
\
.DEFAULT_GOAL:=help
SHELL := /bin/bash
# ==============================================================================
# Building containers
# $(shell git rev-parse --short HEAD)
VERSION := dev
DOCKER_COMPOSE_FILE := infra/docker-compose.yml
image: ## Build a challenge service image in docker
@:$(call check_defined, VERSION, version)
docker build \
-f infra/challenge.Dockerfile \
-t challenge:$(VERSION) \
--build-arg BUILD_REF=$(VERSION) \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
.
up: ## Build and start challenge service and dependencies
docker-compose -f $(DOCKER_COMPOSE_FILE) up --build -d --force-recreate --remove-orphans challenge
clean: ## Stops running services and removes containers, volumes and images
docker-compose -f $(DOCKER_COMPOSE_FILE) kill
docker-compose -f $(DOCKER_COMPOSE_FILE) rm -sfv
# ==============================================================================
# Running tests within the local computer
test: ## Run tests inside a container
docker-compose -f $(DOCKER_COMPOSE_FILE) build test
docker-compose -f $(DOCKER_COMPOSE_FILE) run --rm test
# ==============================================================================
# Help
help: ## Show this help message
@echo
@echo ' Usage:'
@echo ' make <target>'
@echo
@echo ' Targets:'
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
@echo