This repository was archived by the owner on May 21, 2021. It is now read-only.
forked from RHsyseng/sturdy-chainsaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (56 loc) · 2.17 KB
/
Makefile
File metadata and controls
68 lines (56 loc) · 2.17 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
61
62
63
64
65
66
67
68
SHELL = /bin/sh
VERSION = v0.1
IMAGE_NAME = foreman
VOL_OPTS =
BUILD_OPTS =
RUN_OPTS =
EXEC_OPTS =
#User desired options for `docker run` \
# and `foreman-installer --scenario katello` \
# should be placed in file USER_OPTS
-include USER_OPTS
ifndef VOL_OPTS
#Default volume options for persisting if no user override defined
### If changing destination location ( :/var/...:Z ), should \
### edit relocate-foreman.sh to reflect changes
VOL_OPTS = -v foreman_vol:/var/foreman-vol:Z \
-v foreman_pulp_vol:/var/lib/pulp:Z
endif
ifndef RUN_OPTS
#Default options to pass `docker run` if no user override defined
RUN_OPTS = --hostname="localhost.localdomain" \
-p 443:443 \
-p 8443:8443 \
-p 8140:8140
endif
ifndef EXEC_OPTS
#Default options to pass `foreman-installer --scenario katello` if no user override defined
EXEC_OPTS = --enable-foreman-plugin-discovery \
--foreman-plugin-discovery-source-url=http://downloads.theforeman.org/discovery/releases/3.0/ \
--foreman-plugin-discovery-install-images=true \
--enable-foreman-plugin-remote-execution \
--enable-foreman-proxy-plugin-remote-execution-ssh
endif
all: build
build:
docker build --pull -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME} .
docker run -tdi --name ${IMAGE_NAME} ${RUN_OPTS} ${IMAGE_NAME}
docker exec ${IMAGE_NAME} foreman-installer --scenario katello ${EXEC_OPTS}
@if docker images ${IMAGE_NAME}:${VERSION}; then touch build; fi
persist:
docker build --pull -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME} .
docker run -tdi --name ${IMAGE_NAME} ${RUN_OPTS} ${VOL_OPTS} ${IMAGE_NAME}
docker exec ${IMAGE_NAME} foreman-installer --scenario katello ${EXEC_OPTS}
docker exec ${IMAGE_NAME} /root/relocate-foreman.sh
@if docker images ${IMAGE_NAME}:${VERSION}; then touch build; fi
lint:
dockerfile_lint -f Dockerfile
test:
docker build --pull -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME} .
docker run -tdi --name ${IMAGE_NAME} --hostname="localhost.localdomain" ${IMAGE_NAME}
@sleep 5
@docker exec ${IMAGE_NAME} foreman-installer --list-scenarios
@docker exec ${IMAGE_NAME} foreman-installer --scenario katello --help
@docker rm -f ${IMAGE_NAME}
clean:
rm -f build