-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathstart.sh
executable file
·65 lines (45 loc) · 1.55 KB
/
start.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
61
62
63
64
65
#!/bin/bash
# Prevent script from running as root (root-related actions will prompt for the needed credentials)
[[ $EUID -eq 0 ]] && echo "Do not run with sudo / as root." && exit 1
if ! [[ -f './config/php.ini' ]]; then
echo '[!] Warning: config file(s) not found. Please run ./setup.sh first.'
exit 1
fi
source .env
source ./config/functions.sh
### for upgrade from make.sh to setup.sh
if [[ ! -f .env ]] ; then
echo "setup was has not yet finisched, running it now"
./setup.sh
fi
if [[ -z "$@" ]]; then
CONTAINERS=basic-wordpress
else
CONTAINERS="$@"
fi
check_if_container_is_known
echo "Building containers: $CONTAINERS"
#define constants
URL_basic_wordpress="https://${BASIC_HOST:-basic.wordpress.test}"
URL_woocommerce_wordpress="https://${WOOCOMMERCE_HOST:-woocommerce.wordpress.test}"
URL_multisite_wordpress="https://${MULTISITE_HOST:-multisite.wordpress.test}"
URL_standalone_wordpress="https://${STANDALONE_HOST:-standalone.wordpress.test}"
URL_multisitedomain_wordpress="https://${MULTISITEDOMIAN_HOST:-multisitedomain.wordpress.test}"
URL_nightly_wordpress="https://${NIGHTLY_HOST:-nightly.wordpress.test}"
# Get environment variable for the Wordpress DB Table Prefix
STOPPING=false
trap stop_docker INT
trap stop_docker INT
build_containers
boot_containers
await_install_wordpress
await_containers
echo "Containers have booted! Happy developing!"
sleep 2
echo "Outputting logs now:"
docker compose logs -f &
PROCESS=$!
#run platform specific maintenance tasks every 5 seconds
while [ "$STOPPING" != 'true' ]; do
sleep 5
done