-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsync.sh
executable file
·58 lines (45 loc) · 1.18 KB
/
sync.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
#!/usr/bin/env bash
# Syncs the whole git repo in the correct way
# This is probably the file that you want to run..
# exit when any command fails
set -e
BASEDIR=$(cd `dirname "$0"` && pwd)
cd $BASEDIR
Help()
{
# Display Help
echo "Syntax: sync.sh [-h|u]"
echo "options:"
echo "u Composer update, as well as Composer install"
echo "h Print this Help."
echo
echo "Examples:"
echo " sync.sh"
echo " sync.sh -u"
}
# Set variable defaults
ALSO_COMPOSER_UPDATE=""
# Get the options
while getopts ":uh" option; do
case $option in
u)
ALSO_COMPOSER_UPDATE="1";;
h) # display Help
Help
exit;;
esac
done
# Export vars for other scripts
export ALSO_COMPOSER_UPDATE=${ALSO_COMPOSER_UPDATE}
# includes filenames beginning with a '.' in the results of filename expansion (/*)
shopt -s dotglob
# Clears everything in the repo
echo "Delete the contents of the dist folder"
rm -rf ./dist/*
# Fetches things from the web
$BASEDIR/sync/pacman/pacman $BASEDIR
./sync_dist-persist.sh
# Does a composer install
$BASEDIR/sync/04-docker-composer.sh
# Adds shim to .php entrypoints
$BASEDIR/sync/05-docker-entrypoint-overrides.sh