Skip to content

Commit a5f16b2

Browse files
author
Alexander Paliarush
committed
Install varnish if it is not installed automatically on vagrant reload
1 parent f7ef41c commit a5f16b2

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

scripts/provision/configure_environment_recurring.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ else
6767
fi
6868

6969
# Configure Varnish FPC, if enabled
70-
configure_varnish -f
70+
bash "${vagrant_dir}/scripts/guest/configure_varnish" -f
7171

7272
# Setup PHP
7373
php_ini_paths=( /etc/php/7.0/cli/php.ini /etc/php/5.6/cli/php.ini )

scripts/provision/upgrade_environment_recurring.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/usr/bin/env bash
22

3+
function isServiceAvailable() {
4+
if service --status-all | grep -Fq ${1}; then
5+
echo 1
6+
else
7+
echo 0
8+
fi
9+
}
10+
311
# Enable trace printing and exit on the first error
412
set -ex
513

@@ -31,4 +39,11 @@ if [[ ${use_php7} -eq 1 ]]; then
3139
# Restart Apache
3240
service apache2 restart
3341
fi
42+
fi
43+
44+
# Install varnish if not installed
45+
is_varnish_installed="$(isServiceAvailable varnish)"
46+
if [[ ${is_varnish_installed} -eq 0 ]]; then
47+
apt-get update
48+
apt-get install -y varnish
3449
fi

0 commit comments

Comments
 (0)