-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbusser-serverspec-install-script.sh
More file actions
33 lines (30 loc) · 1.04 KB
/
busser-serverspec-install-script.sh
File metadata and controls
33 lines (30 loc) · 1.04 KB
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
TEST_KITCHEN="1"; export TEST_KITCHEN
BUSSER_ROOT="/tmp/verifier"; export BUSSER_ROOT
GEM_HOME="/tmp/verifier/gems"; export GEM_HOME
GEM_PATH="/tmp/verifier/gems"; export GEM_PATH
GEM_CACHE="/tmp/verifier/gems/cache"; export GEM_CACHE
ruby="/opt/chef/embedded/bin/ruby"
gem="/opt/chef/embedded/bin/gem"
version="busser"
gem_install_args="busser --no-document --no-format-executable -n /tmp/verifier/bin --no-user-install"
busser="sudo -E /tmp/verifier/bin/busser"
plugins="busser-serverspec"
$gem list --no-versions | grep--no-versions | grep "^busser" 2>&1 >/dev/null
if test $? -ne 0; then
echo "-----> Installing Busser ($version)"
$gem install $gem_install_args
else
echo "-----> Busser installation detected ($version)"
fi
if test ! -f "$BUSSER_ROOT/bin/busser"; then
$busser setup
fi
for plugin in $plugins; do
$gem list --no-versions | grep "^$plugin$" 2>&1 >/dev/null
if test $? -ne 0; then
echo "-----> Installing Busser plugin: $plugin"
$busser plugin install $plugin
else
echo "-----> Busser plugin detected: $plugin"
fi
done