See SDSS Development Requirements
This document will walk through provisioning a new site on the SDSS Acquia application. A few quick notes:
- BLT/Acquia use "test" as the name for the "stage" environment in code.
- Placeholders in example code are in
ALL_CAPSand meant to be replaced with the relevant data.URL_ALIASrefers to the name of the site in the URL and is used in URLs and domain names (e.g.,my-site).MACHINE_NAMErefers to the name of the site in the code and is used in code and database naming (e.g.,my_site).- This is expanded on in the next section.
Determine the machine name for directories and databases based on the URL alias.
Format:
- One underscore becomes a dash (
_ = -). - Two underscores become a dot (
__ = .).
For example: my-site.stanford.edu
- The
URL_ALIASismy-site - The
MACHINE_NAMEismy_site
💡 Note: If the full URL has an additional subdomain with a dot (E.g.,
my-site.sws.stanford) the configuration becomes a bit more complicated. TheMACHINE_NAMEwould bemy_site__swsand theURL_ALIASwould vary depend on where it's being entered.
Create the NetDB URL aliases for all 3 environments in NetDB.
- The
-devand-testURL aliases go on these3-dev.stanford.eduNetDB node. - The
-prodURL alias goes on theAcquia-52-36-131-229.NoDomain"Super Node" under thesustainability-prodSub-Node.
URL Aliases:
URL_ALIAS-dev
URL_ALIAS-test
URL_ALIAS-prod
Example:
sustainability-dev
sustainability-test
sustainability-prod
💡 Note: The live domain will be added at launch – stick to dev, test and prod.
- Click the Modify link on the node.
- Enter the number of URL aliases to add in the "Count" Field (if in a "Super Node" make sure this is added under the correct "Sub-node").
- Click "Add Alias".
- Enter the URL aliases in the new empty fields.
- Click "Save".
- DNS changes push out every 30 minutes on the :05 and :35 of the hour.
- Ping the site domain to check if it’s resolved (e.g.,
ping -c 4 MACHINE_NAME.stanford.edu).
Get the latest default branch code. This is important because BLT uses the local repo multi-site definition to run its commands. If you don’t have the latest code with all of the current multi-site definitions, the BLT steps may fail.
- E.g.,
git checkout 4.x && git fetch && git pull
composer install
git checkout -b TICKET(S)--provision-SITE(S)
- E.g.,
git checkout -b SDSS-123--provision-mysite. - E.g.,
git checkout -b SDSS-123-124--provision-mysite-yoursite - E.g.,
git checkout -b SDSS-123-124-125--provision-3-sites
💡 Note: The following blt commands are issued locally but are running remote actions on ACQUIA to setup the hosting/server.
blt gryphon:add-domain dev URL_ALIAS-dev.stanford.edu
blt gryphon:add-domain test URL_ALIAS-test.stanford.edu
blt gryphon:add-domain prod URL_ALIAS-prod.stanford.edu
💡 Note: If provisioning multiple sites at the same time you can add multiple domains to an environment in one command: E.g.,
blt gryphon:add-domain dev URL_ALIAS-dev.stanford.edu, URL_ALIAS2-dev.stanford.edu
If the blt command does not work you can add the domains to each environment using the Acquia dashboard and the steps below.
- Click the relevant environment (dev, test or prod) to open it.
- Click the "Domain Management" navigation item.
- Click the "Add Domain" button.
- Add the full applicable domain for the relevant environment and save.
- E.g.,
URL_ALIAS-dev.stanford.eduon the dev environment.
- E.g.,
- Repeat for each environment and domain.
Create a new database in the Acquia dashboard using the machine name.
- Select any environment (dev/test/prod).
- Click the "Databases" navigation item.
- Click the Add Database button.
- Use the machine name as the database name and save.
- The database will be created for all 3 environments automatically -- only need to do this once on any environment.
Run blt recipes:multisite:init
Enter the following when prompted:
- Site machine name (e.g. 'example'): The machine name (with underscores)
- E.g.,
my_site
- E.g.,
- Local domain name: Use default (leave blank / hit enter)
- Would you like to configure the local database credentials? (y/n): n
- Default remote drush alias: The machine name (with underscores) followed by .prod (not .remote!)
- E.g.,
my_site.prod
- E.g.,
- Default local drush alias: Use default (leave blank / hit enter)
- Would you like to create the database on Acquia now? (y/n): n
Check the multisites array in the blt/blt.yml file for the new site(s).
- The new site should be there under
multisites:. Check the drush aliases files for the new site(s) indrush/sites.
- Commit changes, push the code up to the origin and make a Pull Request.
- Set the base branch (branch to be merged into) to the current development branch (should be the default).
- Assign the PR for review.
You are done for now. The last step cannot be completed until the site provision code has been merged and deployed to production.
These steps cannot be completed until the provision code has been merged and deployed to production.
⚠️ Warning: Be careful with this command! If it is executed on the wrong site it will completely wipe out the site with a fresh install.
To install a new site with default profile:
drush @MACHINE_NAME.prod si sdss_profile -y
Make sure the correct workgroups have the appropriate access to the site.
Go to: /admin/config/people/stanford-saml
- For SWS this workgroup is:
uit:sws(mapped to Administrator role) - For SDSS this workgroup is:
sdss:webdev(mapped to Site Manager or Administrator role)