Skip to content
Snippets Groups Projects

Make a better way to tag

Merged Adam G-H requested to merge issue/drupal_cms-3493335:better-tagging into 1.x
Compare and
26 files
+ 86
68
Compare changes
  • Side-by-side
  • Inline
Files
26
+ 13
18
@@ -13,8 +13,12 @@ if [ -z "$VERSION" ]; then
exit 1
fi
# Find all `composer.json` files and change their `*` version constraints.
find . -maxdepth 3 -type f -name composer.json -exec sed --in-place "s/\"\*\"/\"~$VERSION\"/g" {} ';'
COMPONENTS=$(find $PWD -maxdepth 2 -type d -name 'drupal_cms_*' -or -name project_template)
# Change all components' version constraints.
for dir in $COMPONENTS; do
adjust-constraints $dir "~$VERSION"
done
# Generate pre-parsed versions of the recipes available to the installer,
# and store them in a serialized file format for one-time use. This greatly
@@ -23,24 +27,13 @@ cd $DDEV_DOCROOT
./profiles/drupal_cms_installer/build-cache.sh
cd -
# Bump the minimum stability of the project template and ensure it correctly
# conflicts with `drupal/drupal`.
cd project_template
composer config minimum-stability beta
jq --indent 4 '.conflict."drupal/drupal" = "*"' composer.json > tag.json
mv -f tag.json composer.json
cd -
# For visbility, output every line we're executing, as interpreted by the shell.
set -x
# Remove any untracked files.
git clean -d --force
# Bump the minimum stability of the project template.
composer config minimum-stability stable --working-dir=project_template
# Stage all changes, but if we're just testing this script, don't actually commit
# or tag anything.
git add .
if [[ "$VERSION" == "test" ]]; then
git add $COMPONENTS
if [[ $2 == "test" ]]; then
exit 0
fi
@@ -49,5 +42,7 @@ git commit --message=$VERSION
git tag $VERSION
# Make another commit that puts this branch back into its pre-tagged state.
find . -maxdepth 2 -type d -name 'drupal_cms_*' -or -name project_template -exec git checkout HEAD^1 {} ';'
for dir in $COMPONENTS; do
git checkout HEAD^1 $dir
done
git commit --all --message="Back to dev."
Loading