forked from Kitware/CDash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
69 lines (54 loc) · 1.84 KB
/
install.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
66
67
68
69
#!/bin/bash
if [[ "$1" == "--dev" ]]; then
DEVELOPMENT=true
else
DEVELOPMENT=false
fi
echo "=================================================================================";
if $DEVELOPMENT; then
echo "Beginning development CDash installation..."
else
echo "Configuring production CDash installation..."
fi
error_handler() {
echo "
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* INSTALLATION FAILURE! *
* *
* An error occurred while installing CDash and CDash was not able to recover *
* automatically. If you believe that this is a problem with CDash, please *
* report the error here: *
* *
* -> https://github.com/Kitware/CDash/issues/new *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
"
exit 1
}
trap error_handler ERR
# Temporarily change to /cdash
pushd "/cdash" > /dev/null
echo "Enabling maintenance mode..."
php artisan down --render="maintenance" --refresh=5
echo "Updating vendor dependencies..."
if $DEVELOPMENT; then
npm install
composer install
else
npm install --omit=dev
composer install --no-dev --optimize-autoloader
fi
echo "Creating storage directories..."
php artisan storage:mkdirs
echo "Running migrations..."
php artisan migrate --force
echo "Clearing caches..."
php artisan route:cache
php artisan view:cache
php artisan lighthouse:cache
echo "Building the website..."
npm run prod --stats-children
echo "Bringing CDash back online..."
php artisan up
popd > /dev/null
echo "done."