-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
53 lines (44 loc) · 1.54 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
.DEFAULT_GOAL := help
az-docker-run = docker run \
--rm \
-v $(shell pwd)/bin:/data \
-e AZURE_SERVICE_PRINCIPAL=$(AZURE_SERVICE_PRINCIPAL) \
-e AZURE_CLIENT_SECRET=$(AZURE_CLIENT_SECRET) \
-e AZURE_TENANT_ID=$(AZURE_TENANT_ID) \
azure-tools
.PHONY: export-vm-images
export-vm-images: setup ## List information about the vm images
@$(az-docker-run) \
AzureVmImage.sh
.PHONY: export-vm-public-ips
export-vm-public-ips: setup ## List information about the vm public ips
@$(az-docker-run) \
AzureVmPublicIP.sh
.PHONY: export-vm-sizes
export-vm-sizes: setup ## List information about the vm sizes
@$(az-docker-run) \
AzureVmSize.sh
.PHONY: export-public-ips
export-public-ips: setup ## List information about the public ips
@$(az-docker-run) \
AzurePublicIP.sh
.PHONY: export-role-assignment
export-role-assignmet: setup ## List information about the role assignments
@$(az-docker-run) \
AzureRoleAssignment.sh
.PHONY: help
help: ## Show help
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'`); \
printf "%-30s %s\n" Target "Help message" ; \
printf "%-30s %s\n" ------ ------------ ; \
for help_line in $${help_lines[@]}; do \
IFS=$$'#' ; \
help_split=($$help_line) ; \
help_command=`echo $${help_split[0]} | echo $${help_split[0]} | cut -d: -f1` ; \
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
printf "%-30s %s\n" $$help_command $$help_info ; \
done
.PHONY: setup
setup: ## Build docker image with Azure CLI
@docker build . -t azure-tools 1>/dev/null