ctools.drush.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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