-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
64 lines (44 loc) · 1.28 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
# Allow using a different docker binary
DOCKER ?= docker
# Force BuildKit mode for builds
# See https://docs.docker.com/buildx/working-with-buildx/
DOCKER_BUILDKIT=1
IMAGE ?= docksal/ssh-agent
BUILD_IMAGE_TAG ?= $(IMAGE):build
NAME = docksal-ssh-agent
# Make it possible to pass arguments to Makefile from command line
# https://stackoverflow.com/a/6273809/1826109
ARGS = $(filter-out $@,$(MAKECMDGOALS))
.EXPORT_ALL_VARIABLES:
.PHONY: build exec test push shell run start stop logs debug clean
default: build
build:
$(DOCKER) build -t $(BUILD_IMAGE_TAG) .
test:
IMAGE=$(BUILD_IMAGE_TAG) tests/test.bats
push:
$(DOCKER) push $(BUILD_IMAGE_TAG)
conf-vhosts:
make exec -e CMD='cat /etc/nginx/conf.d/vhosts.conf'
# This is the only place where fin is used/necessary
start: clean
IMAGE_SSH_AGENT=$(BUILD_IMAGE_TAG) fin system reset ssh-agent
exec:
$(DOCKER) exec $(NAME) bash -lc "$(CMD)"
exec-it:
@$(DOCKER) exec -it $(NAME) bash -lic "$(CMD)"
shell:
@make exec-it -e CMD=bash
stop:
$(DOCKER) stop $(NAME)
logs:
$(DOCKER) logs $(NAME)
logs-follow:
$(DOCKER) logs -f $(NAME)
debug: build start logs-follow
clean:
$(DOCKER) rm -vf $(NAME) &>/dev/null || true
# Make it possible to pass arguments to Makefile from command line
# https://stackoverflow.com/a/6273809/1826109
%:
@: