This is based on the main OSU Drupal Distribution.
- Get the latest code
git pull - Enter the container
docker compose exec apache bash - Check for Drupal library & modules updates
composer outdated drupal/\* - If you want to only check for packages that have minor version updates
composer outdated -m drupal/\*- To check for only updates that are required by this distribution's composer.json
composer outdated -D drupal/\*- Get updates:
- To update a specific package only
composer update vendor/package- eg
composer update drupal/my_module
- Update only core and it's dependencies
composer update drupal/core-composer-scaffold drupal/core-recommended drupal/core-dev --with-all-dependencies
- Get all updates
composer update
- To update a specific package only
- Commit the changed composer.json and composer.lock and push
Requirements:
- Local
composerinstall - Github Personal Access Token for composer to access custom repositories.
- Composer auth tokens in default install location:
~/.composer/auth.json. Otherwise updatedocker-compose.yml
Process:
- Run
dev/update.sh - You will several update options:
- Dry-run: run
compose update -o --dry-runto see which modules that needs updates - Dev: run
compose update -o --devto install updates for the development environment - Prod: run
compose update -o --no-devto install updates for the production environment
- Dry-run: run
- Your
composer.lockfile will update according to yourcomposer.jsonfile and selection - Then you can commit the changed
composer.jsonandcomposer.lockand push
docker compose build
- For the development version of the container:
docker build --target=development --tag=osuwams/drupal:9-apache-dev .
- For the Production version
docker build --target=production --tag=osuwams/drupal:9-apache .
docker compose up -d
docker compose logs -f apache
docker compose down
docker compose down -v
- Copy
docker-compose.override.example.ymltodocker-compose.override.yml - Replace
volumesdefinitions with overrides in the format of:/path/to/local/folder:/path/to/container/folder. The first definition has the correct path to the theme already set. - Remove any other example definitions
- 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.
- DRUPAL_DBHOST
- The Host name that the Database Server is running on
- Default: localhost
- The Host name that the Database Server is running on
- DRUPAL_DBPORT
- The Port the Database Server is running on
- Default: 3306
- The Port the Database Server is running on
- PRIVATE_FILE_PATH
- The absolute file path to where private files are stored. This should NOT be in webroot
- Default: '' (undefined & unused in drupal)
- The absolute file path to where private files are stored. This should NOT be in webroot
- DRUPAL_MEMCACHE
- The use of Memcache is enabled/disabled
- DRUPAL_MEMCACHEHOST
- The host location for the memcache server. Default port will be used (11211)
- 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
- DRUPAL_MIGRATE_DBHOST
- The Host name that the Database Server is running on
- Default: localhost
- The Host name that the Database Server is running on
- DRUPAL_MIGRATE_DBPORT
- The Port the Database Server is running on
- Default: 3306
- The Port the Database Server is running on
- Rename the existing default database (
dev/mariadb-init/default.sql) such that it's not a sql file (default.sql.tmp) - Run the
dev/db-pull.shscript to dump and pull the live database intodev/mariadb-init/live_dump.sql - Delete the existing
mariadbdatabase:docker compose down -v(This will also delete the Solr index) - Stop and start all containers
- Wait for
mariadbto finish importing the database (docker compose logs -f mariadb) - Visit local site and confirm import
- You will be missing all public & private files from production. This can later be fixed with a new scipt or the
stage_file_proxymodule