Skip to content
Snippets Groups Projects
Commit dcf245bb authored by Jonathan Smith's avatar Jonathan Smith Committed by Fran Garcia-Linares
Browse files

Issue #3414505 by jonathan1055, fjgarlin, cmlara, FeyP, Berdir: Allow all...

Issue #3414505 by jonathan1055, fjgarlin, cmlara, FeyP, Berdir: Allow all sub-modules to be compatible with next_major
parent d700bfbb
Branches
Tags
1 merge request!240#3414505 Set next major core_version_requirement in sub-modules
Pipeline #247565 failed
......@@ -108,10 +108,20 @@
# If the module already supports Drupal 11, do nothing, otherwise, claim Drupal 11 support for testing purposes.
.amend-core-requirements-drupal-11: &amend-core-requirements-drupal-11
- SAVED_PWD=$PWD;
# Change directory to restrict finding info.yml to just those in the project.
- cd $CI_PROJECT_DIR/$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME && pwd
# Need the -L parameter to be able to detect the symlinked files.
- INFO_FILES=$(find -L . -name "*.info.yml") || true
# Return to top level to make the file changes.
- cd $CI_PROJECT_DIR
- |
printf ">>> Existing value of " && cat *.info.yml | grep core_version_requirement
grep -q "\^11" *.info.yml || (sed -i "s/core_version_requirement.*/core_version_requirement: \^11/" *.info.yml)
printf ">>> Updated value of " && cat *.info.yml | grep core_version_requirement
# Add || ^11 to the end of every core_version_requirement if it does not already contain 11
echo "$INFO_FILES" | xargs -I % sed -i "/11/! s/\(core_version_requirement.*\)/\1 || \^11/" % || true
printf "$DIVIDER\nThese files have been changed to allow testing for Next Major compatibility:\n"
# Show all changes but exclude any composer.json file as these will already have other changes.
- git diff $CI_PROJECT_DIR ':!:*composer*.json' || true
- cd $SAVED_PWD && pwd
# These reusable / chainable rules should be defined using conditions that end in 'when: never'.
# This is the same as checking the conditions when not to run. This pattern allows for rules to be chained.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment