Skip to content

Instantly share code, notes, and snippets.

@KyleAMathews
Created June 24, 2010 05:09
Show Gist options
  • Save KyleAMathews/451005 to your computer and use it in GitHub Desktop.
Save KyleAMathews/451005 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# This command expects to be run within the Open Atrium profile directory. To
# generate a full distribution you it must be a CVS checkout.
#
# To use this command you must have `drush make`, `cvs` and `git` installed.
#
if [ -f openatrium.make ]; then
echo "\nThis command can be used to run openatrium.make in place, or to generate"
echo "a complete distribution of Open Atrium.\n\nWhich would you like?"
echo " [1] Rebuild Open Atrium in place."
echo " [2] Build a full Open Atrium distribution"
echo "Selection: \c"
read SELECTION
if [ $SELECTION = "1" ]; then
# Run openatrium.make only.
echo "Building Open Atrium install profile..."
drush make --working-copy --no-core --contrib-destination=. openatrium.make
elif [ $SELECTION = "2" ]; then
# Generate a complete tar.gz of Drupal + Open Atrium.
echo "Building Open Atrium distribution..."
MAKE=$(cat <<EOF
core = "6.x"\n
projects[drupal][version] = "6.17"\n
projects[openatrium][type] = "profile"\n
projects[openatrium][download][type] = "cvs"\n
projects[openatrium][download][module] = "contributions/profiles/openatrium"\n
projects[openatrium][download][revision] =
EOF
)
TAG=`cvs status openatrium.make | grep "Sticky Tag:" | awk '{print $3}'`
if [ -n $TAG ]; then
if [ $TAG = "(none)" ]; then
TAG="HEAD"
fi
MAKE="$MAKE $TAG\n"
NAME=`echo "openatrium-$TAG" | tr '[:upper:]' '[:lower:]'`
echo $MAKE | drush make --yes --tar - $NAME
else
echo 'Could not determine CVS tag. Is openatium.make a CVS checkout?'
fi
else
echo "Invalid selection."
fi
else
echo 'Could not locate file "openatrium.make'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment