Created
March 28, 2014 23:51
-
-
Save brendo/9845412 to your computer and use it in GitHub Desktop.
Symphony Build Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DOZIP=false | |
DODELETE=false | |
DODOCS=false | |
while getopts "v:zrd" opt; do | |
case $opt in | |
v) | |
VERSION=$OPTARG | |
;; | |
z) | |
DOZIP=true | |
;; | |
r) | |
DODELETE=true | |
;; | |
d) | |
DOCS=true | |
;; | |
\?) | |
echo "Invalid option: -$OPTARG" >&2 | |
exit 1 | |
;; | |
:) | |
echo "Option -$OPTARG requires an argument." >&2 | |
exit 1 | |
;; | |
esac | |
done | |
# Clone repository | |
git clone git://github.com/symphonycms/symphony-2.git symphony-$VERSION | |
# Checkout desired version | |
cd symphony-$VERSION | |
git checkout $VERSION | |
# Initialize submodules | |
git submodule update --init | |
# Clone Workspace | |
git clone git://github.com/symphonycms/workspace.git | |
# Checkout latest version of workspace | |
cd workspace | |
git checkout master | |
cd ../ | |
# Remove Git cruft | |
for i in `find . -name '.git*'`; do | |
rm -rf $i | |
done | |
cd ../ | |
# Zip it | |
if [ $DOZIP == true ]; then | |
zip -r symphony$VERSION.zip symphony-$VERSION | |
fi | |
# Generate Docs | |
if [ $DODOCS == true ]; then | |
# PHP | |
git clone [email protected]:symphonycms/symphony-phpdoc.git | |
cd symphony-phpdoc | |
php phpdoc.php symphony.ini | |
cd ../ | |
# JS | |
git clone [email protected]:symphonycms/symphony-jsdoc.git | |
cd symphony-jsdoc | |
java -jar jsrun.jar app/run.js -c=conf/symphony.conf | |
cd ../ | |
fi | |
# Delete folder | |
if [ $DODELETE == true ]; then | |
rm -rf symphony-$VERSION/ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment