Last active
December 16, 2015 18:19
-
-
Save NetzwergX/5476496 to your computer and use it in GitHub Desktop.
Build script for WoltLab Community Framework (WCF) packages Automagically builds packages that obey the standard package structure.
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 | |
# | |
# Build script for WoltLab Community Framework (WCF) packages | |
# by Sebastian Teumert (http://www.teumert.net, http://github.com/NetzwergX) | |
# clear | |
if ls *.tar > /dev/null 2>&1 | |
then | |
rm *.tar | |
fi | |
packageDir=`pwd` | |
package=`basename ${packageDir}` | |
# pack xml files | |
tar cvf ${package}.tar *.xml | |
# pack language files | |
if ls language > /dev/null 2>&1 | |
then | |
tar -rvf ${package}.tar language/ --exclude-vcs --exclude-backups | |
fi | |
# pack sql files | |
if ls *.sql > /dev/null 2>&1 | |
then | |
tar -rvf ${package}.tar *.sql --exclude-vcs --exclude-backups | |
fi | |
# pack php files | |
if ls *.php > /dev/null 2>&1 | |
then | |
tar -rvf ${package}.tar *.php --exclude-vcs --exclude-backups | |
fi | |
# pack optionals | |
if ls optionals > /dev/null 2>&1 | |
then | |
tar -rvf ${package}.tar optionals/ --exclude-vcs --exclude-backups | |
fi | |
# pack requirements | |
if ls requirements > /dev/null 2>&1 | |
then | |
tar -rvf ${package}.tar requirements/ --exclude-vcs --exclude-backups | |
fi | |
# build file-based PIPs | |
for dir in */; | |
do | |
if [ "${dir}" = 'language/' ] || [ "${dir}" = 'optionals/' ] || [ "${dir}" = 'requirements/' ]; | |
then | |
continue | |
else | |
cd ${dir} && tar cvf ../`basename ${dir}`.tar * --exclude-vcs --exclude-backups > /dev/null 2>&1 && cd .. | |
tar -rvf ${package}.tar `basename ${dir}`.tar --exclude-vcs --exclude-backups | |
rm `basename ${dir}`.tar | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment