-
Notifications
You must be signed in to change notification settings - Fork 9
Convert Drush aliases to Drush 9 syntax (fixes #326). #332
base: master
Are you sure you want to change the base?
Changes from all commits
09cfa29
4a99882
bd15b04
f5ee4f1
8317d88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace Drush\Commands; | ||
|
||
use Consolidation\AnnotatedCommand\CommandData; | ||
|
||
/** | ||
* Edit this file to reflect your organization's needs. | ||
*/ | ||
class PolicyCommands extends DrushCommands { | ||
|
||
/** | ||
* Prevent catastrophic braino. Note that this file has to be local to the | ||
* machine that initiates the sql:sync command. | ||
* | ||
* @hook validate sql:sync | ||
* | ||
* @throws \Exception | ||
*/ | ||
public function sqlSyncValidate(CommandData $commandData) { | ||
if ($commandData->input()->getArgument('target') == '@prod') { | ||
throw new \Exception(dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__])); | ||
} | ||
} | ||
|
||
/** | ||
* Limit rsync operations to production site. | ||
* | ||
* @hook validate core:rsync | ||
* | ||
* @throws \Exception | ||
*/ | ||
public function rsyncValidate(CommandData $commandData) { | ||
if (preg_match("/^@prod/", $commandData->input()->getArgument('target'))) { | ||
throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__])); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This directory contains commands, configuration and site aliases for Drush. See https://packagist.org/search/?type=drupal-drush for a directory of Drush commands installable via Composer. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# A Drush configuration file | ||
# | ||
# Docs at https://github.com/drush-ops/drush/blob/master/examples/example.drush.yml | ||
# | ||
# Edit or remove this file as needed. |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Docs at https://github.com/drush-ops/drush/blob/master/examples/example.site.yml | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should there be Lando specific environment here as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this also work for running drush commands on remote servers? |
||
dev: | ||
host: dev.wundertools.com | ||
options: | ||
command-specific: | ||
sql-sync: | ||
no-cache: true | ||
paths: | ||
dump-dir: /home/www-admin | ||
root: /var/www/dev.wundertools.com/web | ||
uri: 'https://dev.wundertools.com' | ||
user: www-admin | ||
|
||
local: | ||
host: local.wundertools.com | ||
options: | ||
env: vagrant | ||
parent: '@parent' | ||
site: wundertools | ||
paths: | ||
files: /vagrant/drupal/files | ||
dump-dir: /home/vagrant | ||
root: /vagrant/drupal/web | ||
user: vagrant | ||
ssh: | ||
options: '-i ' | ||
|
||
prod: | ||
host: wundertools.com | ||
options: | ||
command-specific: | ||
sql-sync: | ||
no-cache: true | ||
paths: | ||
dump-dir: /home/www-admin | ||
root: /var/www/wundertools.com/web | ||
uri: 'https://wundertools.com' | ||
user: www-admin | ||
|
||
stage: | ||
host: stage.wundertools.com | ||
options: | ||
command-specific: | ||
sql-sync: | ||
no-cache: true | ||
paths: | ||
dump-dir: /home/www-admin | ||
root: /var/www/stage.wundertools.com/web | ||
uri: 'https://stage.wundertools.com' | ||
user: www-admin |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make more sense to keep the old PATH as well or is this not important? export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:$PATH |
||
set -ex | ||
|
||
rm -Rf ~/.drush | ||
mkdir -p ~/.drush/sites | ||
|
||
ln -s /app/drush/sites/self.site.yml ~/.drush/sites/self.site.yml | ||
drush cc drush |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alias filename should be unique across projects, otherwise only the first one will work as later projects are unable to create their alias file.