Skip to content

Instantly share code, notes, and snippets.

@brendo
Created February 22, 2015 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendo/4b315ce5a1f55d4e9675 to your computer and use it in GitHub Desktop.
Save brendo/4b315ce5a1f55d4e9675 to your computer and use it in GitHub Desktop.
#!/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)
DODOCS=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 bundle
# 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 git@github.com:symphonycms/symphony-phpdoc.git
cd symphony-phpdoc
php phpdoc.php symphony.ini
cd ../
# JS
git clone git@github.com: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