Skip to content

osu-wams/cwsd8

Repository files navigation

Oregon State University Drupal

This is the main OSU Drupal Distribution.

Update and deploy to Acquia

Acquia Pipelines will watch, build, and deploy versions when changes are detected.

  • The develop branch will build and deploy to Acquia Cloud Development environment
  • The master branch will build and deploy the Acquia Cloud Stage environment.
  • For Acquia Cloud Production an Acquia Cloud administrator will need to manually deploy code from the Stage environment to Production.

Update workflow

  1. Start in the development branch
  2. git pull && composer install
  3. Check for updates composer outdated drupal/\*
  4. If you want to only check for packages that have minor version updates
  5. composer outdated -m drupal/\*
  6. To check for only updates that are required by this distribution's composer.json
  7. composer outdated -D drupal/\*
  8. Get updates
  9. To update a specific package only
  10. composer update vendor/package
  11. eg composer update drupal/my_module
  12. Update only core and it's dependencies
  13. composer update drupal/core-composer-scaffold drupal/core-recommended drupal/core-dev --with-all-dependencies
  14. Get all updates
  15. composer update
  16. Commit the changed composer.json and composer.lock and push
  17. Checkout the master branch
  18. git pull && composer install
  19. Merge the development branch in
  20. Commit and push
  21. Log into Acquia Cloud
  22. Navigate to the Acquia Cloud Application and deploy the latest changes to prod from the Stage environment.

Create New Acquia Cloud Site

  1. To create a new site in OSU Drupal for Acquia Cloud run composer generate-site
  2. This will ask you for the Production FQDN of the site to use and will create the sites' directory, populate the settings.php and the memcache file for acquia cloud.
  3. Follow the Post Install steps to Create the Database and Domains.

Recipe

Drupal Recipes automate module installation & configuration by creating scripts that can install modules and themes and set up configuration on an existing Drupal installation.

To Use a Recipe navigate to the docroot folder for Drupal and run:

drush recipe ../recipes/<name of recipe folder>

for examle, adding the OSU Tours Recipe:

drush recipe ../recipes/osu_tours

Recipes can be chained together in the recipe.yaml.

Local Development

You can build the container locally or pull form the registry.

Building Container

We have a multi-stage Docker file to build. Most of the time the Development version will be used.

  • For the development version of the container:
    • docker build --secret id=composer_auth,src=$HOME/.config/composer/auth.json --target=development --tag=osuwams/drupal:10-apache-dev .
  • For the Production version
    • docker build --secret id=composer_auth,src=$HOME/.config/composer/auth.json --target=production --tag=osuwams/drupal:10-apache .

Environment Variables that can be set

The Main variable for the Drupal Site.

  • DRUPAL_DBNAME
    • The Database Name to use
  • DRUPAL_DBUSER
    • The Database User with permissions to that Database.
  • DRUPAL_DBPASS
    • The Password to the Database User.

Optional Parameters

  • DRUPAL_DBHOST
    • The Host name that the Database Server is running on
      • Default: localhost
  • DRUPAL_DBPORT
    • The Port the Database Server is running on
      • Default: 3306

Environment Variables For Migrations

  • DRUPAL_MIGRATE_DBNAME
    • The Database Name that contains the Source Data for the Migration
  • DRUPAL_MIGRATE_DBUSER
    • The Database user with permissions to that Database
  • DRUPAL_MIGRATE_DBPASS
    • The Password for the Database User

Optional Parameters

  • DRUPAL_MIGRATE_DBHOST
    • The Host name that the Database Server is running on
      • Default: localhost
  • DRUPAL_MIGRATE_DBPORT
    • The Port the Database Server is running on
      • Default: 3306

Setting Up the Migration Database

If you are running migrations locally after copying Down the database and files from the servers. Exec into the Database Container and create a new database and assign the same user to have access You can set the database name to what you will use in your Docker Compose environment variables.

For this example lets assume we want to migrate from drupal.oregonstate.edu and our Database user we used when we set up our Database container is 'drupal'.

CREATE DATABASE drupal_oregonstate_edu CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON `drupal_oregonstate_edu`.* TO `drupal`@`%`;

Copy the Database file into the Drupal Container. This assumes the Drupal service is defined as drupal

docker compose cp drupal_oregonstate_edu.sql drupal:/var/www/

Import the Migrate source Database into the newly created Database. This assumes the Database service is defined as database

mysql -u drupal -p -h database drupal_oregonstate_edu < drupal_oregonstate_edu.sql

To place all files from the source drupal site for Files migration copy them to:

docker compose cp drupal.oregonstate.edu drupal:/var/www/html/docroot/sites/

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages