-
Notifications
You must be signed in to change notification settings - Fork 2
/
drushrc.php
106 lines (105 loc) · 3.87 KB
/
drushrc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
// The first example "statusss" is just a simple test
// to make sure your environment is reading this file
// To test, run `drush @yoursite.instance statusss`
$options['shell-aliases'] = array(
'statusss' =>
'!echo "\nChecking the status of {{@target}}"
drush {{@target}} status
echo "\nChecking the status of {{@target}} again"
drush {{@target}} status
echo "Finished checking the status of {{@target}} twice"',
'data-stage' =>
'!echo "\nReplacing the {{@target}} database with the one from {{#stage}}"
drush sql-sync -y {{#stage}} {{@target}} --create-db --sanitize',
'data-live' =>
'!echo "\nReplacing the {{@target}} database with the one from {{#live}}"
drush sql-sync -y {{#live}} {{@target}} --create-db --sanitize',
'files-stage' =>
'!echo "\nSyncing files from {{#stage}} to {{@target}}"
drush rsync -y {{#stage}}:%files {{@target}}:%files',
'files-live' =>
'!echo "\nSyncing files from {{#live}} to {{@target}}"
drush rsync -y {{#live}}:%files {{@target}}:%files',
'confex' =>
"!echo '\nDisabling development modules'
drush {{@target}} pmu -y $(cat ../mods_enabled.local | tr '\n' ' ')
echo '\nExporting configuration'
drush {{@target}} cex -y
echo '\nRe-enabling development modules'
drush {{@target}} en -y $(cat ../mods_enabled.local | tr '\n' ' ')",
'confim' =>
"!echo '\nImporting configuration'
drush {{@target}} cim -y
echo '\nEnabling development modules'
drush {{@target}} en -y $(cat ../mods_enabled.local | tr '\n' ' ')
echo '\nUpdating database'
drush {{@target}} updb -y
echo '\nClearing caches'
drush {{@target}} cr",
'rebuild' =>
"!echo '\nRunning composer install from the project root'
cd ..
composer install
drush {{@target}} data-live
drush {{@target}} confim
echo '\nLogging into {{@target}} as uid1'
drush {{@target}} uli uid=1",
'confim-no-dev' =>
'!echo "\nImporting configuration"
drush {{@target}} cim -y
echo "\nUpdating database"
drush {{@target}} updb -y
echo "\nClearing caches"
drush {{@target}} cr',
'stage-rebuild' =>
"!echo '\Pulling latest staging branch'
git checkout staging
git pull
echo '\nRunning composer install from the project root'
cd ..
composer install --no-dev
drush {{@target}} confim-no-dev
echo '\nUse the following link to log into {{@target}} as uid1'
drush {{@target}} uli uid=1 --no-browser",
'live-rebuild' =>
"!echo '\Pulling latest master branch'
git checkout master
git pull
echo '\nRunning composer install from the project root'
cd ..
composer install --no-dev
drush {{@target}} confim-no-dev
echo '\nUse the following link to log into {{@target}} as uid1'
drush {{@target}} uli uid=1 --no-browser",
'deploy-stage' =>
"!echo '\nDeploying the latest state of the develop branch to staging'
echo 'Pulling the latest develop branch'
git checkout develop
git pull
echo '\nMerging develop into staging'
git checkout staging
git merge develop
echo '\nCreating a release tag with the current date and time'
echo 'Then pushing everything (including tags) to staging'
git tag REL-STAGING-$(date +'%Y%m%d-%H%M%S')
git push --tags
git push origin staging
echo '\nChecking out the develop branch'
git checkout develop",
'deploy-live' =>
"!echo '\nDeploying the latest state of the staging branch to master'
echo 'Pulling the latest staging branch'
git checkout staging
git pull
echo '\nMerging staging into master'
git checkout master
git merge staging
echo '\nCreating a release tag with the current date and time'
echo 'Then pushing everything (including tags) to master'
git tag REL-LIVE-$(date +'%Y%m%d-%H%M%S')
git push --tags
git push origin master
echo '\nChecking out the develop branch'
git checkout develop",
);