-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall-kitchen.sh
executable file
·64 lines (45 loc) · 1.34 KB
/
install-kitchen.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
#!/bin/bash
yum install -y patch
echo -n "Detecting Ruby Version: "
ruby=`which ruby`
if [[ $? != 0 ]]; then
echo -e "You don't have any Ruby install in your system!"
exit 1
fi
ruby_version=`ruby -v | sed 's/^.* \([0-9]\{1,\}.[0-9]\{1,\}\.[0-9]*\).*$/\1/g'`
if [[ ${ruby_version%.*.*} == "2" ]]; then
echo -e $ruby_version
else
echo -e "You are currently using ruby $ruby_version\n"
echo -e "We are only currently supported only Ruby 2.x.x\n"
exit 1
fi
echo -e "Installing kitchen.ci using Bundler\n"
bundle install --local
if [[ $? == 0 ]]; then
echo "Successfully installed test-kitchen with bundler"
else
echo -e "Failed to install test-kitchen"
exit 1
fi
CWD=$(pwd)
BERKS=$(gem path berkshelf)
RIDLEY=$(gem path ridley)
KITCHEN=$(gem path kitchen)
echo "Start patching files ..."
cd $BERKS
echo "Patching berkshelf ..."
echo "Using patch file $CWD/berkshelf-v4.3.5_0.patch"
patch -p0 < $CWD/berkshelf-v4.3.5_0.patch
cd $RIDLEY
echo "Patching ridley ..."
echo "Using patch file $CWD/ridley-v4.6.1_0.patch"
patch -p0 < $CWD/ridley-v4.6.1_0.patch
echo "Patching test-kitchen ..."
cd $KITCHEN
echo "Using patch file $CWD/test-kitchen-v1.16.0_0.patch"
patch -p0 < $CWD/test-kitchen-v1.16.0_0.patch
echo "Using patch file $CWD/test-kitchen-v1.16.0_1.patch"
patch -p0 < $CWD/test-kitchen-v1.16.0_1.patch
cd $CWD
echo -e "All done!\n"