-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple_deploy.sh
executable file
·68 lines (56 loc) · 1.76 KB
/
simple_deploy.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
#!/bin/bash
# By Carles Mateo
# http://blog.carlesmateo.com
# Dir inside cassandra-universal-driver
s_dir_origin="cgi-bin/"
s_dir_destination="/usr/lib/cgi-bin/"
s_dir_origin_cassandra="cassandra"
s_dir_origin_php_samples="client_samples/php/"
s_dir_destination_www="/var/www/"
s_rsync_params="--verbose --recursive --perms --executability --acls --xattrs --times --compress --human-readable --progress --ignore-errors --safe-links"
s_cud_file="$s_dir_origin/cud.py"
s_cassandra_file="$s_dir_origin_cassandra/cluster.py"
echo "Simple deploy"
echo "============="
echo
echo "by Carles Mateo http://blog.carlesmateo.com"
echo "Manual at http://cassandradriver.com/manual"
echo
echo "If you installed all the requirements, this script does a fast deploy"
echo
echo "Checking for basic files..."
echo
# Checking that Carles Mateo's cud.py exists
if [ -f $s_cud_file ];
then
echo "$s_cud_file exists. Ok"
else
echo "$s_cud_file does not exists!. Cancelling"
exit
fi
# Checking that the python driver from Datastax exists
# We check only one file and trust the rest of the files are there
if [ -f $s_cassandra_file ];
then
echo "$s_cassandra_file exists. Ok"
else
echo "$s_cassandra_file does not exists!. Cancelling"
exit
fi
echo
echo "Copying Cassandra Universal Driver to $s_dir_destination"
echo
echo "1.- Copying cgi to $s_dir_destination"
echo
sudo rsync $s_rsync_params $s_dir_origin $s_dir_destination
echo
echo "2.- Copying cassandra original drivers to $s_dir_destination"
echo
sudo rsync $s_rsync_params $s_dir_origin_cassandra $s_dir_destination
echo
echo "3.- Copying PHP samples to $s_dir_destination_www"
echo
sudo rsync $s_rsync_params $s_dir_origin_php_samples $s_dir_destination_www
echo
echo "Finished. Test it with http://127.0.0.1/sample_www_form.php"
echo