-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.extend-docker.template
More file actions
60 lines (50 loc) · 1.88 KB
/
Makefile.extend-docker.template
File metadata and controls
60 lines (50 loc) · 1.88 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
53
54
55
56
57
58
59
60
#
# Copyright (c) 2023 unSkript.com
# All rights reserved.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE
#
#
.PHONY: bulid
# ACTIONS DIRECTORY
ACTION_DIRECTORY = actions
# RUNBOOKS DIRECTORY
RUNBOOK_DIRECTORY = runbooks
# RUNBOOKS DIRECTORY
AWESOME_DIRECTORY = Awesome-CloudOps-Automation
# CUSTOM DIRECTORY
CUSTOM_DIRECTORY = custom
# Set Default values
CUSTOM_DOCKER_NAME ?= my-awesome-docker
CUSTOM_DOCKER_VERSION ?= 0.1.0
copy:
@echo "Copying Docker file"
@cp $(AWESOME_DIRECTORY)/build/templates/Dockerfile.template Dockerfile
pre-build:
@echo "Preparing To create custom Docker build"
if [ ! -d "$(ACTION_DIRECTORY)" ]; then\
echo "Actions Directory does not exist, It is needed to build the custom docker image"; \
exit 1; \
fi
if [ ! -d "$(RUNBOOK_DIRECTORY)" ]; then\
echo "Runbooks Directory does not exist, It is needed to build the custom docker image"; \
exit 1; \
fi
if [ ! -d "$(AWESOME_DIRECTORY)" ]; then\
echo "Awesome-CloudOps-Automation Directory does not exist, It is needed to build the custom docker image"; \
exit 1; \
fi
@echo "Verified all pre-requisites are met, proceeding to build custom docker image"
@mkdir -p $(CUSTOM_DIRECTORY)
@cp -Rf $(ACTION_DIRECTORY) $(CUSTOM_DIRECTORY)
@cp -Rf $(RUNBOOK_DIRECTORY) $(CUSTOM_DIRECTORY)
build: pre-build
@echo "Using \n Custom Docker Name: $(CUSTOM_DOCKER_NAME) Custom Docker Version: $(CUSTOM_DOCKER_VERSION)"
#@docker buildx --no-cache -t $(CUSTOM_DOCKER_NAME):$(CUSTOM_DOCKER_VERSION) -f Dockerfile .
@docker buildx build --platform linux/amd64 --push -t unskript/awesome-runbooks:$(CUSTOM_DOCKER_VERSION) .
#@docker buildx --t $(CUSTOM_DOCKER_NAME):$(CUSTOM_DOCKER_VERSION) -f Dockerfile .
clean:
@echo "Cleaning up the directories"
@rm -rf $(CUSTOM_DIRECTORY)