GithubHelp home page GithubHelp logo

isabella232 / cern-drupal-distribution Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cern/cern-drupal-distribution

0.0 0.0 0.0 73.61 MB

A Composer package that defines the CERN Drupal Distribution

License: Apache License 2.0

Shell 56.51% JavaScript 5.79% PHP 26.13% Roff 11.57%

cern-drupal-distribution's Introduction

CERN Drupal Distribution

A Composer package that defines the CERN Drupal Distribution: Drupal and a set of core modules, that are the common denominator of all websites deployed in the CERN Drupal service.

This composer project relies on an upstream recommended setup for Drupal sites. More info in cern-drupal-distribution-composer-project.md.

Customizing the composer project of my website

First refer to the DrupalSite docs.

Extra composer packages can be injected to a website by linking the DrupalSite to a git repo with a composer.json. The injection happens with a source-to-image mechanism, triggered when the DrupalSite is deployed.

Sitebuilder/nginx images

This composer project is deployed through a sitebuilder image. Each DrupalSite instantiated at the CERN Drupal service deploys a sitebuilder and an nginx container.

The rest of the images directory includes configuration to build the images. The image tags depend on the release process

Development / updating environment

A specific version of composer is ideal to work with this repo. We have seen cases where different composer versions produce incompatible composer.lock In order to standardize development, we produce an intermediate composer-builder image, from which the sitebuilder derives. Since it is the base of the sitebuilder, this image should be also used as a development environment. The image tag that is used by the sitebuilder is listed in software versions as composerBuilderTag.

To create a local development environment with the same composer version the following can be used, replacing the tag as needed:

$ docker run -it -v .:/project:z gitlab-registry.cern.ch/drupal/paas/cern-drupal-distribution/composer-builder:v9.3-1-RELEASE-2022.03.10T15-05-23Z
# composer -n require ...
# COMPOSER_MEMORY_LIMIT=-1 composer -n update -v --optimize-autoloader --with-all-dependencies

Note that composer needs a lot of memory to run updates, so it's recommended to remove the memory limit by setting the environment variable COMPOSER_MEMORY_LIMIT=-1.

To see the changes to the actual versions after updating, run:

git diff composer.lock | egrep -B1 '(\+|-)            "version":'

Versioning and Release

The precise contents of the images currently running a Drupal site can be linked to this repo. Each branch in this repo starting with the letter v* is a stable version branch. The branch's name corresponds to the spec.version.name field in the DrupalSite.

For a standard user, this is all that is needed to instantiate the Drupal site: the latest release (commit) of the specified branch will be deployed automatically. The resolved/currently running release (version + releaseSpec) can be found in DrupalSite.status.releaseID.current.

The following section gives a detailed description of the GitOps workflow of this repo.

GitOps (details)

The tip of the repo's history is the master branch. At each point in time we also have some supported version branches (v8.9-1, v8.9-2 in this example):

master   v8.9-2 v8.9-1
|
|        |              dev8.9-1-secfix3
                |<----- |
|
                        |
|        |      | ----->|
| ------>|
|               | (backported security fix)
|
|
| ------------->|
|
|     dev-myfeature
|<--- |
|     |
| --->|
|

For each commit in a version branch the corresponding image tag is: <branch>-RELEASE.<date>

Development

Development happens on the master branch using feature branches (dev-myfeature in the example above). Backporting happens in feature branches (dev8.9-1-secfix3) that branch out from the version branches. Each non-version branch produces image tags with each commit of the format <branch>-<commit-sha>.

Testing

Eventually, CI should run a test suite for every commit against the drupal-stg cluster. CI should be a normal user that creates a DrupalSite with this version/release and runs tests against it.

โš ๏ธ Important Note: Currently our Nginx image is merged into sitebuilder, as such a few points to take into consideration. One, our image implementation is inspired by https://github.com/bkuhl/fpm-nginx (That does not differ from Nginx supported image). Two, Nginx might break CI if stable upstream changes, to fix CI please update the local DockerFile according to upstream.

Upgrade version constraints of included Composer packages

Occasionally we would like to try upgrading all the bundled packages to the latest version that doesn't break the CERN Drupal Distribution. This will become easier with more thorough CI testing.

Workflow:

  1. Update all version constraints in composer.json to the newest available.
  2. Let CI tests confirm that the generated websites aren't breaking. Test thoroughly in coordination with the Web team all the bundled functionality.
  3. As we iterate on the changes, it is likely that some of the upgrades may have to be rolled back.

To update all version constraints to the newest:

jq -r '.require | keys[]' composer.json | xargs composer require

cern-drupal-distribution's People

Contributors

oblynx avatar rajula96reddy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.