Skip to content

The next generation of the CWRC (Canadian Writing Research Collaboratory) extending the LEAF base. The CI/CD builds a container image based on LEAF and extending with the customization included within this repository.

License

Notifications You must be signed in to change notification settings

cwrc/cwrc_leaf_build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CWRC LEAF Build

The next generation of the CWRC (Canadian Writing Research Collaboratory) building upon and extending LEAF.

The OCI image built by the workflow includes the CWRC customizations in this repository layered on top of LEAF via CI/CD build workflow.

CWRC customizations of LEAF

The CWRC Repository customizations include Drupal modules and configurations that are not relevant to other LEAF partner sites. This includes the core.extension.yml config plus the Composer files. The second commit to the repository is the LEAF base at tab 3.0.4 with subsequent commits indicating how the CWRC customizations alter the base.

Preservation

# ------------
# Preservation
# ------------

# For details: see https://github.com/cwrc/leaf-isle-bagger/

# Chain docker-compose.yml files
#COMPOSE_PATH_SEPARATOR=:
#COMPOSE_FILE=docker-compose.yml:docker-compose.bagger.yml

# Environment for the Islandora Bagger container
#BAGGER_REPOSITORY=ghcr.io/cwrc
#BAGGER_TAG=v0.0.3
#BAGGER_DEFAULT_PER_BAG_REGISTER_BAGS_WITH_ISLANDORA=false

Update

  • update repository versions

  • Check if local files have changed in https://gitlab.com/calincs/cwrc/leaf/leaf-base-i8 since that last local update

    • check docker/drupal/rootfs (the known files as of August 2024 are included in the following bullet points)
  • core.extension.yml merge changes

    • example using sdiff in interactive mode with l and r signifying how to manually merge the local CWRC customizations with the leaf-base changes
      • ToDo: investigate using yq to automatically update the yaml like the json later in this process
    • If not done then expect Drupal errors regarding missing modules
    $ sdiff -s -o /tmp/z ../leaf-base-i8/docker/drupal/rootfs/var/www/drupal/config/sync/core.extension.yml docker/drupal/rootfs/var/www/drupal/config/sync/core.extension.yml
      config_translation: 0                                       <
    %l
                                                                  >   getjwtonlogin: 0
    %r
                                                                  >   islandora_bagger_integration: 0
    %r
      locale: 0                                                   <
    %l
      message: 0                                                  <
      message_notify: 0                                           <
    %l
      page_manager: 0                                             <
      page_manager_ui: 0                                          <
    %l
      private_message: 0                                          <
      private_message_notify: 0                                   <
    %l
      user_csv_import: 0                                          <
    %l
    
    $ diff /tmp/z docker/drupal/rootfs/var/www/drupal/config/sync/core.extension.yml
    $ mv /tmp/z docker/drupal/rootfs/var/www/drupal/config/sync/core.extension.yml
  • composer.json & composer.lock

    • copy from leaf-base

      cp ../leaf-base-i8/docker/drupal/rootfs/var/www/drupal/composer.json docker/drupal/rootfs/var/www/drupal/
      cp ../leaf-base-i8/docker/drupal/rootfs/var/www/drupal/composer.lock docker/drupal/rootfs/var/www/drupal/
    • add back CWRC customizations

      • The next step automatically adds the following via jq command

        • updates composer.json
        • updates composer.lock
        • execute the helper to build the updated composer.json and composer.lock files
        docker buildx bake drupal-composer-helper  --set "drupal.tags=ghcr.io/cwrc/drupal:local"
        id=$(docker create "ghcr.io/cwrc/drupal:local")
        docker cp $id:/var/www/drupal/composer.json docker/drupal/rootfs/var/www/drupal/
        docker cp $id:/var/www/drupal/composer.lock /docker/drupal/rootfs/var/www/drupal/
        docker rm -v $id
      • review changes

Notes

  • tried using sdiff on the composer.json/lock file but

    • composer.lock doesn't like manual editing - content-hash is outdated

    • if only change the composer.json then composer install flags the differences between the composer.json and composer.lock hence the composer require commands in docker/drupal/Dockerfile-composer-helper

      $ sdiff -s -o /tmp/z ../leaf-base-i8/docker/drupal/rootfs/var/www/drupal/composer.json docker/drupal/rootfs/var/www/drupal/composer.json
      $ mv  /tmp/z docker/drupal/rootfs/var/www/drupal/composer.json
  • tried using the composer tools to update composer.json and add CWRC custom Git repository in the repositories section of composer.json

    • the composer CLI function has drawbacks: https://jmichaelward.com/managing-composer-repositories-via-the-command-line/

      • composer config -d docker/drupal/rootfs/var/www/drupal/ repositories.0 '{"type": "git","url": "https://github.com/cwrc/islandora_bagger_integration.git","no-api": true}'
    • the following needs to be added to the composer.json

          {
            "type": "git",
            "url": "https://github.com/cwrc/islandora_bagger_integration.git",
            "no-api": true
          },

Building a local image

  • docker buildx bake --set "drupal.tags=ghcr.io/cwrc/drupal:local"

About

The next generation of the CWRC (Canadian Writing Research Collaboratory) extending the LEAF base. The CI/CD builds a container image based on LEAF and extending with the customization included within this repository.

Resources

License

Stars

Watchers

Forks

Packages