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