forked from jayjanssen/vagrant-percona-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 1
/
create-new-env.sh
executable file
·69 lines (55 loc) · 1.16 KB
/
create-new-env.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/sh
set -e
type=$1
destdir=$2
pwd=`pwd`
infofile=$destdir/vagrant-percona-info
types="ec2_provisioned_iops|ms|mysql57|pxc|ps_sysbench|pxc_playground|perconaserver"
if [ $# -ne 2 ]; then
echo "Usage $0 ($types) destinationdirectory"
echo ""
exit 1
fi
if [ -e $destdir ]; then
echo "ERROR: the destination directory $destdir already exists, exiting..."
echo ""
exit 1
fi
case $type in
ec2_provisioned_iops|ms|mysql57|pxc|ps_sysbench|pxc_playground|perconaserver)
echo "Creating '$type' Environment"
;;
*)
echo "ERROR: Invalid type $type given, exiting..."
echo ""
exit 1
;;
esac
mkdir -p $destdir
# For every type, we need these
cp Vagrantfile.$type.rb $destdir/Vagrantfile
cp -R $pwd $destdir/vagrant-percona/
ln -s vagrant-percona/lib $destdir/
ln -s vagrant-percona/modules $destdir/
ln -s vagrant-percona/manifests $destdir/
cat << EOF > $infofile
SRCDIR=$pwd
TYPE=$type
GITVERSION=`git log --pretty=format:'%h' -n 1`
EOF
case $type in
ebs_custom)
;;
ms)
ln -s $pwd/ms-setup.pl $destdir/
;;
pxc)
ln -s $pwd/pxc-bootstrap.sh $destdir/
;;
pxc_multi_region)
ln -s $pwd/pxc-bootstrap.sh $destdir/
;;
single_node)
;;
esac
cd $destdir