Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Commit 31ae823

Browse files
committed
Merge pull request #872 from desmondmorris/aliases-staging
drush aliases, ssh configs and ds binary update commands
2 parents ebc8819 + e41c250 commit 31ae823

File tree

7 files changed

+69
-0
lines changed

7 files changed

+69
-0
lines changed

bin/ds

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,23 @@ if [[ $1 == "grunt" ]]
348348
then
349349
grunt $2
350350
fi
351+
352+
#----------------------------------------------------------------------
353+
# update-files
354+
#----------------------------------------------------------------------
355+
if [[ $1 == "update-files" ]]
356+
then
357+
echo "Pulling down files from staging"
358+
cd $WEB_PATH
359+
drush rsync @ds.staging @self -y
360+
fi
361+
362+
#----------------------------------------------------------------------
363+
# update-db
364+
#----------------------------------------------------------------------
365+
if [[ $1 == "update-db" ]]
366+
then
367+
echo "Pulling down db from staging"
368+
cd $WEB_PATH
369+
drush sql-sync @ds.staging @self -y
370+
fi
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% if grains['os'] == 'Ubuntu' %}
2+
3+
drush-aliases:
4+
file.managed:
5+
- name: /home/vagrant/.drush/ds.aliases.drushrc.php
6+
- source: salt://dosomething/ds.aliases.drushrc.php
7+
8+
drush-policy:
9+
file.managed:
10+
- name: /home/vagrant/.drush/policy.drush.inc
11+
- source: salt://dosomething/policy.drush.inc
12+
13+
ssh-host-access:
14+
file.managed:
15+
- name: /home/vagrant/.ssh/config
16+
- source: salt://ssh/config
17+
- user: vagrant
18+
- group: vagrant
19+
20+
{% endif %}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
$aliases['staging'] = array(
4+
'uri' => 'staging.beta.dosomething.org',
5+
'root' => '/var/www/beta.dosomething.org/current/html',
6+
'remote-host' => 'staging.beta.dosomething.org',
7+
'remote-user' => 'dosomething',
8+
'path-aliases' => array(
9+
'%files' => '/var/www/beta.dosomething.org/shared/files',
10+
),
11+
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {
4+
if ($destination == '@ds.staging') {
5+
return drush_set_error('POLICY_DENY', dt('You cannot overwrite the staging db from here'));
6+
}
7+
}
8+
9+
function drush_policy_core_rsync_validate($source, $destination, $additional_options = array()) {
10+
if ($destination == '@ds.staging') {
11+
return drush_set_error('POLICY_DENY', dt('You cannot overwrite the staging files from here'));
12+
}
13+
}

provision/salt/roots/salt/install.sls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ github-access:
44
file.managed:
55
- name: /home/vagrant/.ssh/known_hosts
66
- source: salt://ssh/known_hosts
7+
- user: vagrant
8+
- group: vagrant
79
- require:
810
- pkg: apache2
911

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Host *.dosomething.org
2+
StrictHostKeyChecking no

provision/salt/roots/salt/top.sls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ base:
77
- install
88
- composer
99
- node
10+
- dosomething
1011
- drush-ext

0 commit comments

Comments
 (0)