Skip to content

Commit

Permalink
Merge pull request #13 from SU-SWS/release-1.0.0
Browse files Browse the repository at this point in the history
1.0.0
  • Loading branch information
joegl authored Aug 30, 2022
2 parents 09dd626 + 7b3dde6 commit 07945e4
Show file tree
Hide file tree
Showing 124 changed files with 36,034 additions and 7,138 deletions.
90 changes: 62 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ add_ssh: &add_ssh
fingerprints:
- "6f:84:bf:38:2c:c5:fe:25:46:14:94:54:f3:22:42:f5"

## Add Known Hosts
add_known_hosts: &add_known_hosts
run:
name: Add SSH Known Hosts
command: |
ssh-keyscan svn-23450.prod.hosting.acquia.com >> ~/.ssh/known_hosts
ssh-keyscan stanfordgryphondev.ssh.prod.acquia-sites.com >> ~/.ssh/known_hosts
ssh-keyscan stanfordgryphonstg.ssh.prod.acquia-sites.com >> ~/.ssh/known_hosts
ssh-keyscan stanfordgryphon.ssh.prod.acquia-sites.com >> ~/.ssh/known_hosts
ssh-keyscan -t rsa,dsa github.com >> ~/.ssh/known_hosts
## Defines the cache restoring mechanism.
restore_caches: &restore_caches
restore_cache:
Expand Down Expand Up @@ -47,7 +36,7 @@ save_caches: &save_caches
## Defines images and working directory.
defaults: &defaults
docker:
- image: pookmish/drupal8ci:latest
- image: pookmish/drupal8ci:php8
- image: selenium/standalone-chrome:latest
- image: circleci/mysql:5.7
environment:
Expand All @@ -57,21 +46,56 @@ defaults: &defaults
MYSQL_ALLOW_EMPTY_PASSWORD: 1
working_directory: /var/www/html

sdssgryphon_codeception_acceptance: &sdssgryphon_codeception_acceptance
sdss_profile_prep: &sdss_profile_prep
<<: *defaults
steps:
- checkout
- *restore_caches
- run:
name: Run Codeception Acceptance Tests
name: Site Prep
command: |
composer install --no-interaction
vendor/bin/blt blt:telemetry:disable --no-interaction
blt blt:telemetry:disable --no-interaction
mkdir -p artifacts/_data
vendor/bin/blt circleci:drupal:install --profile=sdss_profile --no-interaction
vendor/bin/blt drupal:toggle:modules --no-interaction
vendor/bin/drush xmlsitemap-regenerate
vendor/bin/blt tests:codeception --test=sdss --no-interaction
blt circleci:drupal:install --profile=sdss_profile --no-interaction
drush xmlsitemap-regenerate
drush pm:uninstall simplesamlphp_auth
drush sql-dump > sdss.sql
- persist_to_workspace:
root: .
paths:
- .

sdss_profile_codeception_acceptance: &sdss_profile_codeception_acceptance
<<: *defaults
steps:
- attach_workspace:
at: .
- run:
name: Run Codeception Acceptance Tests
command: |
dockerize -wait tcp://localhost:3306 -timeout 1m
apachectl stop && apachectl start
drush sql-cli < sdss.sql
blt tests:codeception --test=sdss --suite=acceptance --no-interaction
- *save_caches
- store_test_results:
path: artifacts
- store_artifacts:
path: artifacts

sdss_profile_codeception_functional: &sdss_profile_codeception_functional
<<: *defaults
steps:
- attach_workspace:
at: .
- run:
name: Run Codeception Acceptance Tests
command: |
dockerize -wait tcp://localhost:3306 -timeout 1m
apachectl stop && apachectl start
drush sql-cli < sdss.sql
blt tests:codeception --test=sdss --suite=functional --no-interaction
- *save_caches
- store_test_results:
path: artifacts
Expand All @@ -87,26 +111,36 @@ phpunit_coverage: &phpunit_coverage
name: Run PHPUnit Coverage Tests
command: |
composer install --no-interaction
vendor/bin/blt blt:telemetry:disable --no-interaction
vendor/bin/blt circleci:drupal:setup --no-interaction
vendor/bin/blt tests:phpunit:coverage --no-interaction
blt blt:telemetry:disable --no-interaction
blt circleci:drupal:setup --no-interaction
blt tests:phpunit:coverage --no-interaction
- *save_caches
- store_test_results:
path: artifacts/phpunit
- store_artifacts:
path: artifacts/phpunit

# Declare all of the jobs we should run.
# Declare all jobs we should run.
jobs:
run-sdss-codeception-acceptance:
<<: *sdss_codeception_acceptance
run-phpunit-coverage:
'Setup SDSS':
<<: *sdss_profile_prep
'Codeception Acceptance Tests':
<<: *sdss_profile_codeception_acceptance
'Codeception Functional Tests':
<<: *sdss_profile_codeception_functional
'PHP Unit Coverage Tests':
<<: *phpunit_coverage

# Declare a workflow that runs all of our jobs in parallel.
workflows:
version: 2
tests:
jobs:
- run-sdss-codeception-acceptance
- run-phpunit-coverage
- 'Setup SDSS'
- 'Codeception Acceptance Tests':
requires:
- 'Setup SDSS'
- 'Codeception Functional Tests':
requires:
- 'Setup SDSS'
- 'PHP Unit Coverage Tests'
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# ACE SDSSGryphon

1.0.0
--------------------------------------------------------------------------------
_Release Date: 2022-08-30_

- First official release for ace-sdssgryphon.
14 changes: 14 additions & 0 deletions blt/blt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,21 @@ cm:
strategy: config-split
allow-overrides: true
multisites:
- climate
- default
- energy
- environment_ecosystems
- environmentalbehavior
- environmentalpolicy
- geophysics
- gs
- hopkinsmarinestation
- naturalcapitalproject
- oceans
- planetary
- sustainability
- water
- woods
tests:
reports:
localDir: '${repo.root}/artifacts'
Expand Down
19 changes: 9 additions & 10 deletions blt/src/Blt/Plugin/Commands/GryphonAcquiaApiCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,21 @@ public function createDatabase() {
}

/**
* Add a new domain to the site Acqioa emvorpm,emt.
* Add a domain to Acquia environment.
*
* @param string $environment
* Environment: dev, test, or prod.
* @param string $domains
* Comma separated new domain to add.
*
* @command gryphon:add-domain
* @aliases grad
*
* @param string $environment
* Acquia environment name: `dev`, `test`, or `prod`.
* @param string $new_domain
* New stanford.edu domain.
*/
public function addDomain($environment, $new_domain = '') {
public function humsciAddDomain($environment, $domains) {
$this->connectAcquiaApi();
if (empty($new_domain)) {
$new_domain = $this->getNewDomain('What is the new url (without the protocol)?');
foreach (explode(',', $domains) as $domain) {
$this->say($this->acquiaDomains->create($this->getEnvironmentUuid($environment), $domain)->message);
}
$this->say($this->acquiaDomains->create($this->getEnvironmentUuid($environment), $new_domain)->message);
}

/**
Expand Down
27 changes: 26 additions & 1 deletion blt/src/Blt/Plugin/Commands/GryphonHooksCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function postMultiSiteInit() {
$multisites[] = $site_name;
if (count($alias) != count($default_alias)) {
foreach ($default_alias as $environment => $env_alias) {
$env_alias['uri'] = "$site_name.sites-pro.stanford.edu";
$env_alias['uri'] = $this->getAliasUrl($site_name, $environment);
$alias[$environment] = $env_alias;
}
}
Expand Down Expand Up @@ -138,4 +138,29 @@ public function postDrupalSync(){
->run();
}

/**
* Get the url for the drush alias.
*
* @param string $site_name
* Site machine name, same as the directory.
* @param string $environment
* Acquia environment.
*
* @return string
* Url that can be used in drush.
*/
protected function getAliasUrl($site_name, $environment): string {
$site_name = str_replace('_', '-', str_replace('__', '.', $site_name));
if ($environment == 'local') {
return $site_name;
}

$site_url = explode('.', $site_name, 2);
if (count($site_url) >= 2) {
[$site, $subdomain] = $site_url;
return "$site-$environment.$subdomain.stanford.edu";
}
return "$site_name-$environment.stanford.edu";
}

}
16 changes: 10 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@
}
],
"require": {
"acquia/blt": "^12",
"acquia/blt-simplesamlphp": "dev-master",
"php": ">=8.0",
"acquia/blt": "^13.5",
"acquia/blt-simplesamlphp": "^1.0",
"composer/installers": "^1.9",
"cweagans/composer-patches": "^1.6",
"drupal/acquia_connector": "^3.0",
Expand All @@ -111,11 +112,13 @@
"drupal/menu_block": "dev-1.x#17bc5a2094dec85a921fdac6aff0030bfe004744",
"drupal/mysql56": "^1.1",
"drupal/paranoia": "^1.9",
"drush/drush": "^10.3",
"su-sws/sdss_profile": "^8.3"
"drush/drush": "^11.1",
"simplesamlphp/simplesamlphp": "^1.19",
"su-sws/sdss_profile": "^1.0"
},
"require-dev": {
"acquia/blt-drupal-test": "^1.0",
"acquia/blt-multisite": "^1.0",
"phpspec/prophecy-phpunit": "^2.0",
"su-sws/blt-sws": "dev-main",
"su-sws/drupal-dev": "^8.2"
Expand All @@ -124,7 +127,8 @@
"drupal/coder": "*"
},
"conflict": {
"drupal/drupal": "*"
"drupal/drupal": "*",
"symfony/string": ">=6.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down Expand Up @@ -223,7 +227,7 @@
},
"autoload": {
"psr-4": {
"SdssGryphon\\": "blt/src/"
"Gryphon\\": "blt/src/"
}
}
}
Loading

0 comments on commit 07945e4

Please sign in to comment.