-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
73 lines (66 loc) · 2.65 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
##@ Utilities Common Tasks
.PHONY: help
help: ## This help message
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^(\s|[a-zA-Z_0-9-])+:.*?##/ { printf " \033[36m%-35s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: super-linter
super-linter: ## Runs super linter locally
rm -rf .mypy_cache
podman run -e RUN_LOCAL=true -e USE_FIND_ALGORITHM=true \
-e VALIDATE_ANSIBLE=false \
-e VALIDATE_BASH=false \
-e VALIDATE_CHECKOV=false \
-e VALIDATE_DOCKERFILE_HADOLINT=false \
-e VALIDATE_JSCPD=false \
-e VALIDATE_KUBERNETES_KUBECONFORM=false \
-e VALIDATE_MARKDOWN_PRETTIER=false \
-e VALIDATE_NATURAL_LANGUAGE=false \
-e VALIDATE_PYTHON_BLACK=false \
-e VALIDATE_PYTHON_FLAKE8=false \
-e VALIDATE_PYTHON_ISORT=false \
-e VALIDATE_PYTHON_MYPY=false \
-e VALIDATE_PYTHON_PYINK=false \
-e VALIDATE_PYTHON_PYLINT=false \
-e VALIDATE_PYTHON_RUFF=false \
-e VALIDATE_SHELL_SHFMT=false \
-e VALIDATE_YAML=false \
-e VALIDATE_YAML_PRETTIER=false \
$(DISABLE_LINTERS) \
-v $(PWD):/tmp/lint:rw,z \
-w /tmp/lint \
ghcr.io/super-linter/super-linter:slim-v7
.PHONY: ansible-lint
ansible-lint: ## run ansible lint on ansible/ folder
podman run -it -v $(PWD):/workspace:rw,z --workdir /workspace \
--entrypoint "/usr/local/bin/ansible-lint" quay.io/ansible/creator-ee:latest "-vvv" "acm_import/"
##### HostedCluster Management tasks
REGISTRY ?= quay.io/hybridcloudpatterns
NAME ?= utility-container
TAG ?= latest
CONTAINER ?= $(NAME):$(TAG)
.PHONY: cluster-status
cluster-status: ## Checks the status of hostedcluster machines
@echo "Getting status of hosted-cluster nodes"
podman run --rm --net=host \
--security-opt label=disable \
-v ${HOME}:/pattern \
-v ${HOME}:${HOME} \
-v ${HOME}/.aws:/pattern-home/.aws \
"${REGISTRY}/${CONTAINER}" python3 /usr/local/bin/status-instances.py -f ${CLUSTER}
.PHONY: cluster-start
cluster-start: ## Starts the ostedcluster machines
@echo "Starting hosted-cluster nodes"
podman run --rm --net=host \
--security-opt label=disable \
-v ${HOME}:/pattern \
-v ${HOME}:${HOME} \
-v ${HOME}/.aws:/pattern-home/.aws \
"${REGISTRY}/${CONTAINER}" python3 /usr/local/bin/start-instances.py -f ${CLUSTER}
.PHONY: cluster-stop
cluster-stop: ## Checks the status of hostedcluster machines
@echo "Stopping hosted-cluster nodes"
podman run --rm --net=host \
--security-opt label=disable \
-v ${HOME}:/pattern \
-v ${HOME}:${HOME} \
-v ${HOME}/.aws:/pattern-home/.aws \
"${REGISTRY}/${CONTAINER}" python3 /usr/local/bin/stop-instances.py -f ${CLUSTER}