-
Notifications
You must be signed in to change notification settings - Fork 0
/
_manage-site.sh
executable file
·60 lines (46 loc) · 1.54 KB
/
_manage-site.sh
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
#! /bin/bash
#
# helper, so you don't need to remember docker-compose syntax...
# what's the site?
site="status.arc42.org"
# some colors to highlight certain output
GREEN=`tput setaf 2`
RED=`tput setaf 5`
BLUE=`tput setaf 6`
RESET=`tput sgr0`
clear
echo
echo "Docker container to develop or build the ${BLUE}$site ${RESET}website:"
echo "============================================================"
echo
echo "Please select wether to ${GREEN}develop ${RESET} or ${RED} build ${RESET} the site:"
echo
echo "${GREEN}(d)evelop ${RESET} starts a jekyll server on port 0.0.0.0:4000,"
echo "which performs incremental builds and listens for file changes."
echo
echo "${GREEN}(b)build ${RESET} build the required docker image."
echo
echo "${GREEN}(r)emove ${RESET} the running docker container."
echo
echo "=================================================="
echo
read -p "Enter your selection (default: develop, d) : " choice
if [[ -z $choice ]]; then
choice='develop'
fi
case "$choice" in
b|B|build) echo "build Docker image"
docker-compose --file docker-compose.yml build --force-rm
;;
d|D|dev|develop) echo "develop, incremental build"
docker-compose --file docker-compose.yml up
;;
r|R|remove) echo "remove running docker container"
docker-compose --file docker-compose.yml down
;;
# catchall: abort
*) echo "${RED} unknown option $choice ${RESET}, aborted."
exit 1
;;
esac
echo "Thanx."