-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprovision.sh
More file actions
38 lines (33 loc) · 1.07 KB
/
provision.sh
File metadata and controls
38 lines (33 loc) · 1.07 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
34
35
36
37
38
#!/usr/bin/env bash
# Directory in which librarian-puppet should manage its modules directory
PUPPET_DIR=/vagrant/puppet
# NB: librarian-puppet might need git installed. If it is not already installed
# in your basebox, this will manually install it at this point using apt or yum
$(which git > /dev/null 2>&1)
FOUND_GIT=$?
if [ "$FOUND_GIT" -ne '0' ]; then
echo 'Attempting to install git.'
$(which apt-get > /dev/null 2>&1)
FOUND_APT=$?
$(which yum > /dev/null 2>&1)
FOUND_YUM=$?
if [ "${FOUND_YUM}" -eq '0' ]; then
yum -q -y makecache
yum -q -y install git
echo 'git installed.'
elif [ "${FOUND_APT}" -eq '0' ]; then
apt-get -q -y update
apt-get -q -y install git
echo 'git installed.'
else
echo 'No package installer available. You may need to install git manually.'
fi
else
echo 'git found.'
fi
if [ "$(gem search -i librarian-puppet)" = "false" ]; then
gem install librarian-puppet -v 1.0.3
cd $PUPPET_DIR && librarian-puppet install --path modules-contrib
else
cd $PUPPET_DIR && librarian-puppet install --path modules-contrib
fi