ctools.drush.sh

#!/bin/bash

# Run this from the terminal inside a drupal root folder
# i.e. DRUPAL_ROOT_DIR/sites/all/modules/contrib/ctools/tests/ctools.drush.sh

function stamp {
  echo ==============
  echo timestamp : `date`
  echo ==============
}

DRUPAL_ROOT=`drush dd`
MODULE_DIR="$DRUPAL_ROOT/sites/all/modules"
MODULE_NAME="ctools_drush_test"

stamp

echo 'Enabling ctools, views, and bulk_export modules.'
drush en ctools views bulk_export --yes

stamp
echo 'Reading all export info'
drush ctools-export-info

stamp
echo 'Reading all export info with format'
drush ctools-export-info --format=json

stamp
echo 'Reading tables only from export info'
drush ctools-export-info --tables-only

stamp
echo 'Reading tables only from export info with format'
drush ctools-export-info --tables-only --format=json

stamp
echo 'Reading all disabled exportables'
drush ctools-export-info --filter=disabled

stamp
echo 'Enabling all default views'
drush ctools-export-enable views_view --yes

stamp
echo 'Reading all enabled exportables'
drush ctools-export-info --filter=enabled

stamp
echo 'Reading all overridden exportables'
drush ctools-export-info --filter=overridden

stamp
echo 'Reading all database only exportables'
drush ctools-export-info --filter=database

stamp
echo 'View all default views export data'
drush ctools-export-view views_view --yes

stamp
echo 'View default "archive" view export data'
drush ctools-export-view views_view archive

stamp
echo 'Disable default "archive" view'
drush ctools-export-disable views_view archive

stamp
echo 'Enable default "archive" view'
drush ctools-export-enable views_view archive

stamp
echo 'Reading all enabled exportables (archive disabled)'
drush ctools-export-info

stamp
echo 'Disabling all default views'
drush ctools-export-disable views_view --yes

stamp
echo 'Revert all default views'
drush ctools-export-revert views_view --yes

stamp
echo 'Enable all node views'
drush ctools-export-enable views_view --module=node --yes

stamp
echo 'Disable all node views'
drush ctools-export-disable views_view --module=node --yes

stamp
echo 'Revert all node views'
drush ctools-export-revert views_view --module=node --yes

stamp
echo 'Revert all exportables'
drush ctools-export-revert --all --yes

stamp
echo 'Enable all exportables'
drush ctools-export-enable --all --yes

stamp
echo 'Disable all exportables'
drush ctools-export-disable --all --yes

stamp
echo 'Bulk export all objects'
drush ctools-export $MODULE_NAME --subdir='tests' --choice=1

stamp
echo 'Show all files in created folder'
ls -lAR "$MODULE_DIR/tests/$MODULE_NAME"

stamp
echo 'Removing exported object files'
rm -Rf $MODULE_DIR/tests

File

tests/ctools.drush.sh

View source
  1. #!/bin/bash
  2. # Run this from the terminal inside a drupal root folder
  3. # i.e. DRUPAL_ROOT_DIR/sites/all/modules/contrib/ctools/tests/ctools.drush.sh
  4. function stamp {
  5. echo ==============
  6. echo timestamp : `date`
  7. echo ==============
  8. }
  9. DRUPAL_ROOT=`drush dd`
  10. MODULE_DIR="$DRUPAL_ROOT/sites/all/modules"
  11. MODULE_NAME="ctools_drush_test"
  12. stamp
  13. echo 'Enabling ctools, views, and bulk_export modules.'
  14. drush en ctools views bulk_export --yes
  15. stamp
  16. echo 'Reading all export info'
  17. drush ctools-export-info
  18. stamp
  19. echo 'Reading all export info with format'
  20. drush ctools-export-info --format=json
  21. stamp
  22. echo 'Reading tables only from export info'
  23. drush ctools-export-info --tables-only
  24. stamp
  25. echo 'Reading tables only from export info with format'
  26. drush ctools-export-info --tables-only --format=json
  27. stamp
  28. echo 'Reading all disabled exportables'
  29. drush ctools-export-info --filter=disabled
  30. stamp
  31. echo 'Enabling all default views'
  32. drush ctools-export-enable views_view --yes
  33. stamp
  34. echo 'Reading all enabled exportables'
  35. drush ctools-export-info --filter=enabled
  36. stamp
  37. echo 'Reading all overridden exportables'
  38. drush ctools-export-info --filter=overridden
  39. stamp
  40. echo 'Reading all database only exportables'
  41. drush ctools-export-info --filter=database
  42. stamp
  43. echo 'View all default views export data'
  44. drush ctools-export-view views_view --yes
  45. stamp
  46. echo 'View default "archive" view export data'
  47. drush ctools-export-view views_view archive
  48. stamp
  49. echo 'Disable default "archive" view'
  50. drush ctools-export-disable views_view archive
  51. stamp
  52. echo 'Enable default "archive" view'
  53. drush ctools-export-enable views_view archive
  54. stamp
  55. echo 'Reading all enabled exportables (archive disabled)'
  56. drush ctools-export-info
  57. stamp
  58. echo 'Disabling all default views'
  59. drush ctools-export-disable views_view --yes
  60. stamp
  61. echo 'Revert all default views'
  62. drush ctools-export-revert views_view --yes
  63. stamp
  64. echo 'Enable all node views'
  65. drush ctools-export-enable views_view --module=node --yes
  66. stamp
  67. echo 'Disable all node views'
  68. drush ctools-export-disable views_view --module=node --yes
  69. stamp
  70. echo 'Revert all node views'
  71. drush ctools-export-revert views_view --module=node --yes
  72. stamp
  73. echo 'Revert all exportables'
  74. drush ctools-export-revert --all --yes
  75. stamp
  76. echo 'Enable all exportables'
  77. drush ctools-export-enable --all --yes
  78. stamp
  79. echo 'Disable all exportables'
  80. drush ctools-export-disable --all --yes
  81. stamp
  82. echo 'Bulk export all objects'
  83. drush ctools-export $MODULE_NAME --subdir='tests' --choice=1
  84. stamp
  85. echo 'Show all files in created folder'
  86. ls -lAR "$MODULE_DIR/tests/$MODULE_NAME"
  87. stamp
  88. echo 'Removing exported object files'
  89. rm -Rf $MODULE_DIR/tests