Skip to content

Commit 5ce47b2

Browse files
authored
Merge pull request #32 from keymanapp/feat/list-sites
feat: list sites when starting
2 parents 82d5071 + 02b2df5 commit 5ce47b2

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

build.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,29 @@ builder_describe \
3131
build \
3232
start \
3333
stop \
34+
list \
3435

3536
builder_parse "$@"
3637

38+
function list_sites() {
39+
builder_echo "The following sites may be proxied:"
40+
local item items
41+
# read -a items= <()
42+
items=($(grep server_name resources/nginx.conf))
43+
items=($(printf -- '%s\n' "${items[@]}" | grep localhost))
44+
for item in "${items[@]}"; do
45+
builder_echo " http://${item}"
46+
done
47+
}
48+
49+
function do_start() {
50+
start_docker_container $PROXY_IMAGE_NAME $PROXY_CONTAINER_NAME $PROXY_CONTAINER_DESC $HOST_PROXY 80 $BUILDER_CONFIGURATION
51+
list_sites
52+
}
53+
3754
builder_run_action configure bootstrap_configure
3855
builder_run_action clean clean_docker_container $PROXY_IMAGE_NAME $PROXY_CONTAINER_NAME
3956
builder_run_action stop stop_docker_container $PROXY_IMAGE_NAME $PROXY_CONTAINER_NAME
4057
builder_run_action build build_docker_container $PROXY_IMAGE_NAME $PROXY_CONTAINER_NAME $BUILDER_CONFIGURATION
41-
builder_run_action start start_docker_container $PROXY_IMAGE_NAME $PROXY_CONTAINER_NAME $PROXY_CONTAINER_DESC $HOST_PROXY 80 $BUILDER_CONFIGURATION
58+
builder_run_action start do_start
59+
builder_run_action list list_sites

0 commit comments

Comments
 (0)