-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.sh
executable file
·183 lines (152 loc) · 4.71 KB
/
dev.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#!/bin/bash
githubUser=emberfeather
projectPath=~/Projects
webrootPath=~/Servers/lucee/webapps/ROOT/
projects=(algid cf-compendium one20 mongo4cf postmark4cf)
plugins=(account admin api chart content cron documentation editor error google i18n mongodb parser plugins postmark scm search security survey tagger tracker user user-openid user-local widget wiki)
echo "================================"
echo " One20 Development Setup Script"
echo "================================"
echo "Using the $githubUser Github user for projects"
echo "Project path: $projectPath"
echo "Webroot path: $webrootPath"
echo "Projects: ${projects[*]}"
echo "Plugins: ${plugins[*]}"
echo "================================"
echo ""
# Verify that the server is already setup.
if [ ! -d $webrootPath ]
then
echo "Missing Lucee server: $webrootPath"
exit 1
fi
# Create a directory for the plugins in the webroot.
if [ ! -d $webrootPath/p ]
then
echo "Creating: $webrootPath/p"
mkdir $webrootPath/p
fi
# Create a directory for the projects
if [ ! -d $projectPath ]
then
echo "Creating: $projectPath"
mkdir $projectPath
fi
# Create a directory for the plugins
if [ ! -d $projectPath/plugins ]
then
echo "Creating: $projectPath/plugins"
mkdir $projectPath/plugins
fi
# Create a directory for the wikis
if [ ! -d $projectPath/wiki ]
then
echo "Creating: $projectPath/wiki"
mkdir $projectPath/wiki
fi
# Create a directory for the plugin wikis
if [ ! -d $projectPath/wiki/plugins ]
then
echo "Creating: $projectPath/wiki/plugins"
mkdir $projectPath/wiki/plugins
fi
# Checkout and initialize the projects
for project in ${projects[*]}
do
if [ ! -d $projectPath/$project ]
then
echo "Cloning to: $projectPath/$project"
git clone --recurse-submodules [email protected]:$githubUser/$project.git $projectPath/$project
cd $projectPath/$project
git submodule update --init
else
echo "Updating submodules: $projectPath/$project"
cd $projectPath/$project
git submodule update --init
fi
done
# Symbolic link the projects into the webroot
if [ ! -h $webrootPath/a ]
then
echo "Linking: Projects into webroot"
ln -s $projectPath/algid $webrootPath/a
ln -s $projectPath/algid/algid $webrootPath/algid
ln -s $projectPath/algid/server/lucee/context/templates/debugging/debugging-algid-12.cfm $webrootPath/WEB-INF/lucee/context/templates/debugging/debugging-algid-12.cfm
fi
if [ ! -h $webrootPath/c ]
then
ln -s $projectPath/cf-compendium $webrootPath/c
ln -s $projectPath/cf-compendium/cf-compendium $webrootPath/cf-compendium
fi
if [ ! -h $webrootPath/o ]
then
ln -s $projectPath/one20 $webrootPath/o
ln -s $projectPath/one20/one20 $webrootPath/one20
fi
if [ ! -h $webrootPath/m ]
then
ln -s $projectPath/mongo4cf $webrootPath/m
ln -s $projectPath/mongo4cf/mongo4cf $webrootPath/mongo4cf
fi
if [ ! -h $webrootPath/pm ]
then
ln -s $projectPath/postmark4cf $webrootPath/pm
ln -s $projectPath/postmark4cf/postmark4cf $webrootPath/postmark4cf
fi
# Create a plugins directory for the one20 application
if [ ! -d $projectPath/one20/one20/plugins ]
then
echo "Creating: $projectPath/one20/one20/plugins"
mkdir $projectPath/one20/one20/plugins
fi
# Checkout and initialize the plugins
for plugin in ${plugins[*]}
do
if [ ! -d $projectPath/plugins/$plugin ]
then
echo "Cloning to: $projectPath/plugins/$plugin"
git clone --recurse-submodules [email protected]:$githubUser/algid-$plugin.git $projectPath/plugins/$plugin
cd $projectPath/plugins/$plugin
# Setup tracking on the develop branch
git branch develop origin/develop
# Checkout the develop branch
git checkout develop
else
echo "Updating submodules: $projectPath/plugins/$plugin"
cd $projectPath/plugins/$plugin
fi
done
# Symbolic link the plugins into the webroot and application
for plugin in ${plugins[*]}
do
if [ ! -h $webrootPath/p/$plugin ]
then
echo "Linking: $plugin into webroot"
ln -s $projectPath/plugins/$plugin $webrootPath/p/$plugin
fi
if [ ! -h $projectPath/one20/one20/plugins/$plugin ]
then
echo "Linking: $plugin into one20"
ln -s $projectPath/plugins/$plugin/$plugin $projectPath/one20/one20/plugins/$plugin
fi
done
# Checkout and initialize the project wikis
for project in ${projects[*]}
do
if [ ! -d $projectPath/wiki/$project ]
then
echo "Cloning to: $projectPath/wiki/$project"
git clone --recurse-submodules [email protected]:$githubUser/$project.wiki.git $projectPath/wiki/$project
cd $projectPath/wiki/$project/$project
fi
done
# Checkout and initialize the plugin wikis
for plugin in ${plugins[*]}
do
if [ ! -d $projectPath/wiki/plugins/$plugin ]
then
echo "Cloning to: $projectPath/wiki/plugins/$plugin"
git clone --recurse-submodules [email protected]:$githubUser/algid-$plugin.wiki.git $projectPath/wiki/plugins/$plugin
cd $projectPath/wiki/plugins/$plugin
fi
done