You are here

rebuild.sh in Open Atrium 6

#!/bin/bash
#
# This command expects to be run within the Open Atrium profile directory. To
# generate a full distribution you must be in a git checkout.
#
# To use this command you must have `drush make` and `git` installed.
#

if [ -f drupal-org.make ]; then
  echo -e "\nThis command can be used to run drupal-org.make in place, or to generate"
  echo -e "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 -e "Selection: \c"
  read SELECTION

  if [ $SELECTION = "1" ]; then

    # Run openatrium.make only.
    echo "Building Open Atrium install profile..."
    drush make --download-mechanism='drush_make' --working-copy --no-core --contrib-destination=. drupal-org.make

  elif [ $SELECTION = "2" ]; then

    # Generate a complete tar.gz of Drupal + Open Atrium.
    echo "Building Open Atrium distribution..."

    MAKE=$(cat build-openatrium.make)

    TAG=`git describe --tags --abbrev=0`
    if [ -n $TAG ]; then
      if [ $TAG = "fatal: No names found, cannot describe anything." ]; then
        MAKETAG=""
        VERSION="head"
      else
        MAKETAG="projects[openatrium][download][tag] = $TAG"
        VERSION="${TAG:4}"
      fi
      MAKE="$MAKE\n$MAKETAG\n"
      echo -e "$MAKE"
      NAME=`echo "atrium-$VERSION" | tr '[:upper:]' '[:lower:]'`
      echo -e "$MAKE" | drush make --download-mechanism='drush_make' --yes --tar - $NAME
    else
      echo 'Could not determine git tag. Is openatium git clone checkout?'
    fi
  else
   echo "Invalid selection."
  fi
else
  echo 'Could not locate file "openatrium.make"'
fi

File

rebuild.sh
View source
  1. #!/bin/bash
  2. #
  3. # This command expects to be run within the Open Atrium profile directory. To
  4. # generate a full distribution you must be in a git checkout.
  5. #
  6. # To use this command you must have `drush make` and `git` installed.
  7. #
  8. if [ -f drupal-org.make ]; then
  9. echo -e "\nThis command can be used to run drupal-org.make in place, or to generate"
  10. echo -e "a complete distribution of Open Atrium.\n\nWhich would you like?"
  11. echo " [1] Rebuild Open Atrium in place."
  12. echo " [2] Build a full Open Atrium distribution"
  13. echo -e "Selection: \c"
  14. read SELECTION
  15. if [ $SELECTION = "1" ]; then
  16. # Run openatrium.make only.
  17. echo "Building Open Atrium install profile..."
  18. drush make --download-mechanism='drush_make' --working-copy --no-core --contrib-destination=. drupal-org.make
  19. elif [ $SELECTION = "2" ]; then
  20. # Generate a complete tar.gz of Drupal + Open Atrium.
  21. echo "Building Open Atrium distribution..."
  22. MAKE=$(cat build-openatrium.make)
  23. TAG=`git describe --tags --abbrev=0`
  24. if [ -n $TAG ]; then
  25. if [ $TAG = "fatal: No names found, cannot describe anything." ]; then
  26. MAKETAG=""
  27. VERSION="head"
  28. else
  29. MAKETAG="projects[openatrium][download][tag] = $TAG"
  30. VERSION="${TAG:4}"
  31. fi
  32. MAKE="$MAKE\n$MAKETAG\n"
  33. echo -e "$MAKE"
  34. NAME=`echo "atrium-$VERSION" | tr '[:upper:]' '[:lower:]'`
  35. echo -e "$MAKE" | drush make --download-mechanism='drush_make' --yes --tar - $NAME
  36. else
  37. echo 'Could not determine git tag. Is openatium git clone checkout?'
  38. fi
  39. else
  40. echo "Invalid selection."
  41. fi
  42. else
  43. echo 'Could not locate file "openatrium.make"'
  44. fi