Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Set of scripts for preparing a Drupal core release.
- `manual_merge.sh` and `conclude_merge.sh`: Create a security release that requires a manual merge (e.g., for dependency updates)
- `branch.sh`: Creates a new core branch for a new minor version

Setup
=====

If using DDEV the composer and yarn commands can be executed inside the container. To do this set
the environment variable `DRUPAL_ENVIRONMENT` to `ddev`. This is currently only available for the
scripts `branch.sh` and `tag.sh`.

Usage
=====

Expand Down
14 changes: 10 additions & 4 deletions branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ function portable_sed() {
fi
}

# Allow composer and yarn to run inside a container.
if [ "${DRUPAL_ENVIRONMENT}" == "ddev" ]
then
CONTAINER_CMD='ddev exec'
fi

echo -e "Enter the new branch name (e.g. 10.2.x):"
read b
echo -e "Enter the original branch name (e.g. 10.1.x):"
Expand All @@ -27,8 +33,8 @@ git pull
rm -rf vendor

echo -e "Composer installing.\n"
composer install --no-progress --no-suggest -n -q
(cd core; rm -rf node_modules; yarn install)
${CONTAINER_CMD} composer install --no-progress --no-suggest -n -q
(cd core; rm -rf node_modules; ${CONTAINER_CMD} yarn install)
git checkout -b "$b"

# @todo Make it fail if the following don't make changes.
Expand All @@ -42,6 +48,6 @@ do
done

echo -e "\nUpdating metapackages.\n"
COMPOSER_ROOT_VERSION="$b-dev" composer update drupal/core* --no-progress --no-suggest -n -q
(cd core; rm -rf node_modules; yarn install)
${CONTAINER_CMD} COMPOSER_ROOT_VERSION="$b-dev" composer update drupal/core* --no-progress --no-suggest -n -q
(cd core; rm -rf node_modules; ${CONTAINER_CMD} yarn install)
git commit -am "Drupal $b-dev"
13 changes: 10 additions & 3 deletions tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ function portable_sed() {
fi
}

# Allow composer and yarn to run inside a container.
if [ "${DRUPAL_ENVIRONMENT}" == "ddev" ]
then
CONTAINER_CMD='ddev'
CONTAINER_EXEC_CMD='ddev exec'
fi

# @param $1
# The Drupal version to set.
# @param $2
Expand All @@ -52,7 +59,7 @@ function portable_sed() {
function set_version() {
if [[ $2 -ge 10 ]] || [[ $2 -eq 9 && $3 -gt 0 ]] ; then
echo -e "\n\n Setting version with Composer for 9.1+ \n"
php -r "include 'vendor/autoload.php'; \Drupal\Composer\Composer::setDrupalVersion('.', '$1');"
${CONTAINER_CMD} php -r "include 'vendor/autoload.php'; \Drupal\Composer\Composer::setDrupalVersion('.', '$1');"
else
grep -q "[0-9\.]*-dev" core/lib/Drupal.php
if [ ! $? -eq 0 ] ; then
Expand Down Expand Up @@ -100,15 +107,15 @@ fi

echo "Composer installing."
rm -rf vendor
composer install --no-progress --no-suggest -n -q
${CONTAINER_CMD} composer install --no-progress --no-suggest -n -q

set_version "$v" "$major" "$minor"

# Update the version strings in the metapackages
echo "Updating metapackage versions to ${v} and tagging."

# Update the path repository versions in the lock file
COMPOSER_ROOT_VERSION="$v" composer update drupal/core*
${CONTAINER_EXEC_CMD} COMPOSER_ROOT_VERSION="$v" composer update drupal/core*

git commit -am "Drupal $v" --no-verify
git tag -a "$v" -m "Drupal $v"
Expand Down