-
Notifications
You must be signed in to change notification settings - Fork 3
/
make-project.sh
executable file
·100 lines (71 loc) · 2.53 KB
/
make-project.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
#!/bin/sh
WHOAMI=`python -c 'import os, sys; print os.path.realpath(sys.argv[1])' $0`
WHEREAMI=`dirname $WHOAMI`
TOOLS=`dirname $WHEREAMI`
PROJECT=$1
PROJECT_NAME=`basename ${PROJECT}`
TMP="/tmp/${PROJECT}"
echo "cloning dependencies"
echo "------------------------------";
# git clone https://github.com/whosonfirst/flamework.git ${PROJECT}/
git clone https://github.com/whosonfirst/flamework.git ${TMP}/
for WHAT in `ls -a ${TMP}`
do
if [ -z "${WHAT//[^.]/}" ]
then
cp -r ${TMP}/${WHAT} ${PROJECT}/${WHAT}
echo $WHAT
fi
done
rm -rf ${TMP}
exit 1
if [ ! -d ${PROJECT} ]
then
mkdir ${PROJECT}
fi
# echo "configuting git things"
# echo "------------------------------";
# echo "*~" >> ${PROJECT}/.gitignore
# rm -rf ${PROJECT}/.git
# rm -f ${PROJECT}/.gitattributes
echo "setting up README files"
echo "------------------------------";
echo ${PROJECT_NAME} > ${PROJECT}/README.md
echo "--" >> ${PROJECT}/README.md
echo "removing unnecessary files"
echo "------------------------------";
rm -rf ${PROJECT}/www/cron
rm -rf ${PROJECT}/docs
rm -rf ${PROJECT}/tests
rm -f ${PROJECT}/.travis.yml
rm -f ${PROJECT}/Vagrantfile
rm -f ${PROJECT}/LICENSE
rm -f ${PROJECT}/www/paging.php
rm -f ${PROJECT}/www/templates/page_paging.txt
# TODO: figure out if sudo is necessary
# sudo chown -R www-data ${PROJECT}/www/templates_c
echo "setting up apache files"
echo "------------------------------";
mkdir -p ${PROJECT}/apache
echo "*.conf" >> ${PROJECT}/apache/.gitignore
cp ${TOOLS}/apache/example.conf ${PROJECT}/apache/${PROJECT_NAME}.conf.example
cp ${TOOLS}/apache/example.conf ${PROJECT}/apache/${PROJECT_NAME}.conf
perl -p -i -e "s!__PROJECT_ROOT__!${PROJECT}!" ${PROJECT}/apache/${PROJECT_NAME}.conf
perl -p -i -e "s!__PROJECT_NAME__!${PROJECT_NAME}!" ${PROJECT}/apache/${PROJECT_NAME}.conf
echo "cloning ubuntu utilities"
echo "------------------------------";
cp -r ${TOOLS}/ubuntu ${PROJECT}/
echo "setting up .htaccess files"
echo "------------------------------";
cp ${TOOLS}/apache/.htaccess-deny ${PROJECT}/apache/.htaccess
cp ${TOOLS}/apache/.htaccess-deny ${PROJECT}/ubuntu/.htaccess
cp ${TOOLS}/apache/.htaccess-deny ${PROJECT}/schema/.htaccess
cp ${TOOLS}/apache/.htaccess-deny ${PROJECT}/bin/.htaccess
cp ${TOOLS}/apache/.htaccess-noindexes ${PROJECT}/.htaccess
echo "setting up (application) config files"
echo "------------------------------"
cp ${PROJECT}/www/include/secrets.php.example ${PROJECT}/www/include/secrets.php
# rm ${PROJECT}/www/include/secrets.php.example
echo "all done";
echo "------------------------------"
echo ""