This repository has been archived by the owner on Aug 22, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
49 lines (39 loc) · 1.46 KB
/
Makefile
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
SHELL := /bin/bash
.DEFAULT_GOAL := help
###########################
# VARIABLES
###########################
BUILD_ENV := NONE
###########################
# MAPPINGS
###########################
DOCKER_COMPOSE_NONE :=
DOCKER_COMPOSE_COMPOSE := docker-compose run dev
DOCKER_COMPOSE := $(DOCKER_COMPOSE_$(BUILD_ENV))
###########################
# TARGETS
###########################
.PHONY: help
help: ## help target to show available commands with information
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: information
information: ## echo some build information
@echo 'set build env to $(BUILD_ENV) and DOCKER_COMPOSE to $(DOCKER_COMPOSE)'
@echo 'use make -e BUILD_ENV=COMPOSE <target> for using docker-compose build environment'
.PHONY: validate
validate: information ## Validate the katacoda scenarios
$(DOCKER_COMPOSE) npx katacoda validate:all --repo=./tsdevops/
$(DOCKER_COMPOSE) npx katacoda validate:all --repo=./git/
.PHONY: markdownlint
markdownlint: information ## Validate markdown files
$(DOCKER_COMPOSE) npx markdownlint .github/ --ignore node_modules
$(DOCKER_COMPOSE) npx markdownlint . --ignore node_modules
.PHONY: bootstrap
bootstrap: ## Build Container
@if [ $(BUILD_ENV) = "COMPOSE" ]; then\
docker-compose build;\
fi
$(DOCKER_COMPOSE) npm ci
.PHONY: shell
shell: ## Open shell with dev dependencies installed in zsh
docker-compose run dev zsh