-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall-ttools.sh
executable file
·142 lines (109 loc) · 3.62 KB
/
install-ttools.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#! /bin/bash
echo ''
echo "Title Web Solution's"
echo ' ______ _ __ ______ __ '
echo ' /_ __/__ _________ ___ (_)___ ____ _/ / /_ __/___ ____ / /____'
echo ' / / / _ \/ ___/ __ `__ \/ / __ \/ __ `/ / / / / __ \/ __ \/ / ___/'
echo ' / / / __/ / / / / / / / / / / / /_/ / / / / / /_/ / /_/ / (__ ) '
echo '/_/ \___/_/ /_/ /_/ /_/_/_/ /_/\__,_/_/ /_/ \____/\____/_/____/ '
echo ''
echo 'for SilverStripe: Installer'
echo ''
echo "";
echo "Please enter the project name:"
read PROJECTNAME
echo "Please enter the host name of your server (can be left blank):"
read HOST
echo ""
echo "* Now creating project configuration for $PROJECTNAME"
echo "
##############################################################
# Terminal Tools Configuration for \"$PROJECTNAME\"
# Add environments under \"Environments\"
# Adjust the menu under \"Menu\" to your needs
##############################################################
Projectname: \"$PROJECTNAME\"
Environments:
Live:
#required
Host: \"$HOST\"
Sshuser: \"SSHUSER\"
Repodir: \"REPODIR\"
#additional settings
Domain: \"$HOST\"
Sshport: \"\"
Composerpath: \"\"
PhpPath: \"\"
Dev:
#add dev site info here
Menu:
Heading1:
Title: Local
Item1:
Title: Pull code changes
Command: \"ttools/silverstripe/local/deploy.sh\"
Item2:
Title: Back up content
Command: \"ttools/sitesync-core/local/backup.sh\"
Item3:
Title: Update content from Dev Site
Command: \"ttools/sitesync-core/local/sync-environments.sh Dev Local\"
Item4:
Title: Update content from Live Site
Command: \"ttools/sitesync-core/local/sync-environments.sh Live Local\"
Item5:
Title: Revert content from backup
Command: \"ttools/sitesync-core/local/revert-from-backup.sh\"
Heading2:
Title: Dev Site
Item1:
Title: SSH
Command: \"ttools/core/local/ssh.sh Dev\"
Item2:
Title: Deploy
Command: \"ttools/silverstripe/local/deploy.sh Dev\"
Item3:
Title: Push Local content
Command: \"ttools/sitesync-core/local/sync-environments.sh Local Dev\"
Item4:
Title: Push Live content
Command: \"ttools/sitesync-core/local/sync-environments.sh Live Dev\"
Heading3:
Title: Live Site
Item1:
Title: SSH
Command: \"ttools/core/local/ssh.sh Live\"
Item2:
Title: Deploy
Command: \"ttools/silverstripe/local/deploy.sh Live\"
Sitesync:
FrameworkModule: 'ttools/sitesync-silverstripe'
" > ttools/config.yml
echo ""
echo "* Now installing ttools libraries"
#core
git submodule add git://github.com/titledk/ttools-core.git ttools/core;
#git helpers
git submodule add https://github.com/titledk/ttools-githelpers.git ttools/githelpers
#sitesync core
git submodule add https://github.com/titledk/ttools-sitesync-core.git ttools/sitesync-core
#sitesync silverstripe
git submodule add https://github.com/titledk/ttools-sitesync-silverstripe.git ttools/sitesync-silverstripe
git submodule add https://github.com/silverstripe/sspak.git ttools/thirdparty/sspak
echo ""
echo "* Now installing the ttools binary"
##the ttools binary
echo "#!/bin/sh
./ttools/core/lib/ttools.sh \"\$@\"" > tt;
chmod u+x tt;
echo "";
echo "Installation is done. You can now run Terminal Tools by running \"./tt\"";
echo "Remember to commit the changes to your repository."
echo ""
read -p "Do you want to go ahead installing SilverStripe now? <y/N> " prompt
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
then
./ttools/silverstripe/install/install-silverstripe.sh;
else
exit 0
fi