Skip to content

Commit

Permalink
Adjusted drush and settings for the Ace environment (#904)
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish authored Jun 25, 2021
1 parent 353c52b commit cb29c90
Show file tree
Hide file tree
Showing 83 changed files with 1,228 additions and 865 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ add_known_hosts: &add_known_hosts
run:
name: Add SSH Known Hosts
command: |
ssh-keyscan srv-7503.devcloud.hosting.acquia.com >> ~/.ssh/known_hosts
ssh-keyscan svn-4786.devcloud.hosting.acquia.com >> ~/.ssh/known_hosts
ssh-keyscan svn-23450.prod.hosting.acquia.com >> ~/.ssh/known_hosts
ssh-keyscan web-42199.prod.hosting.acquia.com >> ~/.ssh/known_hosts
ssh-keyscan staging-25390.prod.hosting.acquia.com >> ~/.ssh/known_hosts
ssh-keyscan -t rsa,dsa github.com >> ~/.ssh/known_hosts
## Defines images and working directory.
Expand Down
12 changes: 4 additions & 8 deletions blt/blt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ project:
git:
default_branch: develop-build
remotes:
- '[email protected]:swshumsci.git'
- '[email protected]:humscigryphon.git'
deploy:
tag_source: false
Expand Down Expand Up @@ -166,12 +165,9 @@ tests:
- functional
directory: '${docroot}/profiles/humsci/su_humsci_profile/tests/codeception'
keys_rsync:
ssh: swshumsci.prod@srv-7503.devcloud.hosting.acquia.com
ssh: humscigryphon.prod@web-42199.prod.hosting.acquia.com
files:
- /mnt/gfs/swshumsci.prod/nobackup/apikeys/
- /mnt/gfs/swshumsci.prod/secrets.settings.php
- /mnt/gfs/humscigryphon.prod/nobackup/apikeys/
- /mnt/gfs/humscigryphon.prod/secrets.settings.php
cloud:
appId: 23a85077-2967-41a4-be22-a84c24e0f81a
dev: 265866-23a85077-2967-41a4-be22-a84c24e0f81a
test: 265867-23a85077-2967-41a4-be22-a84c24e0f81a
prod: 265865-23a85077-2967-41a4-be22-a84c24e0f81a
appId: 60ee2ebb-94f3-415d-a289-c23889ecec18
29 changes: 25 additions & 4 deletions blt/src/Blt/Plugin/Commands/HsCertCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,36 @@ public function humsciLetsEncryptAdd($environment, $options = [

$primary_domain = array_shift($domains);
asort($domains);
$domains = "-d $primary_domain -d " . implode(' -d ', $domains);
if ($domains) {
$domains = "-d $primary_domain -d " . implode(' -d ', $domains);
}
else {
$domains = "-d $primary_domain";
}

$directory = "/mnt/gfs/swshumsci.$environment/files/";
$directory = "/mnt/gfs/humscigryphon.$environment/tmp";

$ssh_url = sprintf('swshumsci.%[email protected]', $environment);
$ssh_url = $this->getSshUrl($environment);
$command = sprintf('ssh %s "~/.acme.sh/acme.sh --issue %s -w %s --force --debug"', $ssh_url, $domains, $directory);
return $this->taskExec($command)->run();
}

/**
* Get the ssh url based on the environment name.
*
* @param string $environment
* Environment name: prod, test, dev.
*
* @return string
* Ssh location.
*/
protected function getSshUrl($environment) {
if ($environment == 'prod') {
return '[email protected]';
}
return '[email protected]';
}

/**
* List the LetsEncrypt certificates for the environment.
*
Expand Down Expand Up @@ -150,7 +171,7 @@ public function updateCert($environment) {
$cert_name = $environment == 'test' ? 'swshumsci-stage.stanford.edu' : "swshumsci-$environment.stanford.edu";
$this->taskDeleteDir($this->getConfigValue('repo.root') . '/certs')->run();
$this->taskDrush()
->drush("rsync --mode=rltDkz @default.prod:/home/swshumsci/.acme.sh/$cert_name/ @self:../certs")
->drush("rsync --mode=rltDkz @default.prod:/home/humscigryphon/.acme.sh/$cert_name/ @self:../certs")
->run();

$cert = file_get_contents($this->getConfigValue('repo.root') . "/certs/$cert_name.cer");
Expand Down
4 changes: 2 additions & 2 deletions blt/src/Blt/Plugin/Commands/HsCircleCiCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ protected function syncAcquia($site = 'swshumsci') {
$tasks[] = $this->taskDrush()
->alias("$site.prod")
->drush('sql-dump')
->option('result-file', "/mnt/tmp/swshumsci/$site.sql", '=');
->option('result-file', "/mnt/tmp/humscigryphon/$site.sql", '=');
$tasks[] = $this->taskDrush()
->drush('rsync')
->rawArg("@$site.prod:/mnt/tmp/swshumsci/$site.sql /tmp/$site.sql")
->rawArg("@$site.prod:/mnt/tmp/humscigryphon/$site.sql /tmp/$site.sql")
->option('mode', 'rultz', '=');

$tasks[] = $this->taskDrush()->drush('sql-drop')->option('yes');
Expand Down
30 changes: 0 additions & 30 deletions blt/src/Blt/Plugin/Commands/HsCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,6 @@ public function localSetup() {
$this->invokeCommands(['sws:keys', 'sbsc', 'settings']);
}

/**
* Get encryption keys from acquia.
*
* @command humsci:keys
* @description stuff
*/
public function humsciKeys() {
$this->taskDrush()
->drush("rsync --mode=rltDkz @default.prod:/mnt/gfs/swshumsci.prod/nobackup/apikeys/ @self:../keys")
->run();
}

/**
* Send encryption keys to acquia.
*
* @param string $env
* Acquia environment to send the keys.
*
* @command humsci:keys:send
*/
public function humsciKeysSend($env = 'prod') {
$send = $this->confirm('Are you sure you want to copy over existing keys with keys in the "keys" directory?');
$key_dir = $this->getConfigValue("key-dir.$env");
if ($send) {
$this->taskDrush()
->drush("rsync @self:../keys/ @default.$env:$key_dir")
->run();
}
}

/**
* Disables a list of modules for all sites in an environment.
*
Expand Down
4 changes: 2 additions & 2 deletions config/default/stanford_ssp.settings.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
saml_attribute: eduPersonEnttitlement
use_workgroup_api: false
hide_local_login: true
workgroup_api_cert: /mnt/gfs/swshumsci.prod/nobackup/apikeys/saml/workgroup_api.cert
workgroup_api_key: /mnt/gfs/swshumsci.prod/nobackup/apikeys/saml/workgroup_api.key
workgroup_api_cert: /mnt/gfs/humscigryphon.prod/nobackup/apikeys/saml/workgroup_api.cert
workgroup_api_key: /mnt/gfs/humscigryphon.prod/nobackup/apikeys/saml/workgroup_api.key
restriction: all
_core:
default_config_hash: Xm4MNDvuD7BJ089bXHgqkS7_mOjVgGxnekzaeYLwW7k
Expand Down
5 changes: 3 additions & 2 deletions docroot/sites/settings/acquia.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
$group = EnvironmentDetector::getAhGroup();
$environment = EnvironmentDetector::getAhEnv();

$settings['file_temp_path'] = "/mnt/tmp/$group.$environment";
// Set the temp directory as per https://docs.acquia.com/acquia-cloud/manage/files/broken/
$settings['file_temp_path'] = '/mnt/gfs/' . EnvironmentDetector::getAhGroup() . '.' . EnvironmentDetector::getAhEnv() . '/tmp';
$settings['letsencrypt_challenge_directory'] = $settings['file_temp_path'];

if (!EnvironmentDetector::isProdEnv()) {
// Disables domain redirect on all environments except production.
$config['domain_301_redirect.settings']['enabled'] = FALSE;
}

$settings['letsencrypt_challenge_directory'] = "/mnt/gfs/$group.$environment/files/";
27 changes: 16 additions & 11 deletions drush/sites/africanstudies.site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ local:
uri: africanstudies
root: '${env.cwd}/docroot'
dev:
root: /var/www/html/swshumsci.dev/docroot
root: /var/www/html/humscigryphon.dev/docroot
uri: africanstudies-dev.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.dev
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.dev
stage:
root: /var/www/html/swshumsci.test/docroot
root: /var/www/html/humscigryphon.test/docroot
uri: africanstudies-stage.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.test
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.test
prod:
root: /var/www/html/swshumsci.prod/docroot
root: /var/www/html/humscigryphon.prod/docroot
uri: africanstudies-prod.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.prod
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.prod
ra:
root: /var/www/html/swshumsci.ra/docroot
root: /var/www/html/humscigryphon.ra/docroot
uri: africanstudies-ra.stanford.edu
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.ra
acp:
root: /var/www/html/swshumsci.prod/docroot
uri: africanstudies-prod.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.ra
user: swshumsci.prod
27 changes: 16 additions & 11 deletions drush/sites/amstudies.site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ local:
uri: amstudies
root: '${env.cwd}/docroot'
dev:
root: /var/www/html/swshumsci.dev/docroot
root: /var/www/html/humscigryphon.dev/docroot
uri: amstudies-dev.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.dev
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.dev
stage:
root: /var/www/html/swshumsci.test/docroot
root: /var/www/html/humscigryphon.test/docroot
uri: amstudies-stage.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.test
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.test
prod:
root: /var/www/html/swshumsci.prod/docroot
root: /var/www/html/humscigryphon.prod/docroot
uri: amstudies-prod.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.prod
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.prod
ra:
root: /var/www/html/swshumsci.ra/docroot
root: /var/www/html/humscigryphon.ra/docroot
uri: amstudies-ra.stanford.edu
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.ra
acp:
root: /var/www/html/swshumsci.prod/docroot
uri: amstudies-prod.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.ra
user: swshumsci.prod
23 changes: 14 additions & 9 deletions drush/sites/archaeology.site.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
local:
uri: archaeology
dev:
root: /var/www/html/swshumsci.dev/docroot
root: /var/www/html/humscigryphon.dev/docroot
uri: archaeology-dev.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.dev
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.dev
livedev:
root: /home/swshumsci/dev/livedev/docroot
root: /home/humscigrypon/dev/livedev/docroot
uri: archaeology-dev.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.dev
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.dev
stage:
root: /var/www/html/swshumsci.test/docroot
root: /var/www/html/humscigryphon.test/docroot
uri: archaeology-stage.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.test
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.test
prod:
root: /var/www/html/humscigryphon.prod/docroot
uri: archaeology.stanford.edu
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.prod
acp:
root: /var/www/html/swshumsci.prod/docroot
uri: archaeology.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
Expand Down
27 changes: 16 additions & 11 deletions drush/sites/artexhibitions.site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ local:
uri: artexhibitions
root: '${env.cwd}/docroot'
dev:
root: /var/www/html/swshumsci.dev/docroot
root: /var/www/html/humscigryphon.dev/docroot
uri: artexhibitions-dev.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.dev
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.dev
stage:
root: /var/www/html/swshumsci.test/docroot
root: /var/www/html/humscigryphon.test/docroot
uri: artexhibitions-stage.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.test
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.test
prod:
root: /var/www/html/swshumsci.prod/docroot
root: /var/www/html/humscigryphon.prod/docroot
uri: artexhibitions-prod.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.prod
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.prod
ra:
root: /var/www/html/swshumsci.ra/docroot
root: /var/www/html/humscigryphon.ra/docroot
uri: artexhibitions-ra.stanford.edu
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.ra
acp:
root: /var/www/html/swshumsci.prod/docroot
uri: artexhibitions-prod.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.ra
user: swshumsci.prod
27 changes: 16 additions & 11 deletions drush/sites/bingschool.site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ local:
uri: bingschool
root: '${env.cwd}/docroot'
dev:
root: /var/www/html/swshumsci.dev/docroot
root: /var/www/html/humscigryphon.dev/docroot
uri: bingschool-dev.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.dev
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.dev
stage:
root: /var/www/html/swshumsci.test/docroot
root: /var/www/html/humscigryphon.test/docroot
uri: bingschool-stage.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.test
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.test
prod:
root: /var/www/html/swshumsci.prod/docroot
root: /var/www/html/humscigryphon.prod/docroot
uri: bingschool-prod.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.prod
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.prod
ra:
root: /var/www/html/swshumsci.ra/docroot
root: /var/www/html/humscigryphon.ra/docroot
uri: bingschool-ra.stanford.edu
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.ra
acp:
root: /var/www/html/swshumsci.prod/docroot
uri: bingschool-prod.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.ra
user: swshumsci.prod
27 changes: 16 additions & 11 deletions drush/sites/biology.site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ local:
uri: biology
root: '${env.cwd}/docroot'
dev:
root: /var/www/html/swshumsci.dev/docroot
root: /var/www/html/humscigryphon.dev/docroot
uri: biology-dev.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.dev
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.dev
stage:
root: /var/www/html/swshumsci.test/docroot
root: /var/www/html/humscigryphon.test/docroot
uri: biology-stage.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.test
host: staging-25390.prod.hosting.acquia.com
user: humscigryphon.test
prod:
root: /var/www/html/swshumsci.prod/docroot
root: /var/www/html/humscigryphon.prod/docroot
uri: biology-prod.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.prod
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.prod
ra:
root: /var/www/html/swshumsci.ra/docroot
root: /var/www/html/humscigryphon.ra/docroot
uri: biology-ra.stanford.edu
host: web-42199.prod.hosting.acquia.com
user: humscigryphon.ra
acp:
root: /var/www/html/swshumsci.prod/docroot
uri: biology-prod.stanford.edu
host: srv-7503.devcloud.hosting.acquia.com
user: swshumsci.ra
user: swshumsci.prod
Loading

0 comments on commit cb29c90

Please sign in to comment.