-
Notifications
You must be signed in to change notification settings - Fork 3
/
make-project.sh
executable file
·65 lines (44 loc) · 1.74 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
#!/bin/sh
WHOAMI=`python -c 'import os, sys; print os.path.realpath(sys.argv[1])' $0`
WHEREAMI=`dirname $WHOAMI`
TOOLS=`dirname $WHEREAMI`
PROJECT=$1
PROJET_NAME=`basename ${PROJECT}`
echo "cloning dependencies"
echo "------------------------------";
git clone https://github.com/straup/flamework.git ${PROJECT}/
mkdir -p ${PROJECT}/apache
echo "*~" >> ${PROJECT}/.gitignore
echo "*.conf" >> ${PROJECT}/apache/.gitignore
rm -rf ${PROJECT}/.git
rm -f ${PROJECT}/.gitattributes
echo "setting up README files"
echo "------------------------------";
mv ${PROJECT}/README.md ${PROJECT}/README.FLAMEWORK.md
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
# TODO: figure out if sudo is necessary
# sudo chown -R www-data ${PROJECT}/www/templates_c
echo "setting up apache files"
echo "------------------------------";
cp ${TOOLS}/apache/example.conf ${PROJECT}/apache/${PROJECT_NAME}.conf.example
cp ${TOOLS}/apache/example.conf ${PROJECT}/apache/README.md
echo "setting up .htaccess files"
echo "------------------------------";
cp ${TOOLS}/apache/.htaccess-deny ${PROJECT}/apache/.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
echo "*~" >> ${PROJECT}/www/.gitignore
${TOOLS}/bin/configure-secrets.sh ${PROJECT}
echo "all done";
echo "------------------------------";
echo ""