Commit d83f0925 authored by Chris Shantz's avatar Chris Shantz
Browse files

Moving composer-varient to become the 8.x-3.x branch.

parents a7c3183a f4b1e8f3
......@@ -9,58 +9,12 @@ Built from [Drupal 8 core](https://drupal.org) and [Gesso](https://www.drupal.or
2. [Gulp](http://gulpjs.com/)
- currently version 4.0.2
3. [Composer](https://getcomposer.org/)
- currently version 1.10.1
- currently version 1.10.19
## Notes on theming
UW has taken the approach to use a component based design and has chosen [Forum One's](https://www.forumone.com/) pattern-lab instance of [Gesso](https://www.drupal.org/project/gesso) from the [git hub repository](https://github.com/forumone/gesso).
When installing the base profile for the FIRST time you must install both the
profile and gesso. On subsequent installs you may chose to bypass installing
gesso, however, if there are updates to gesso, those will be missed.
## Installing the profile and/or gesso
UW FDSU responsive theme comes with a script that will handling building the
theme and/or gesso.
## Rebuild script
./rebuild.sh will accept the following switches:
1, 2 or 3 (like build-option, can use either or)
1 = rebuild profile only
2 = rebuild profile and gesso
3 = rebuild gesso only
--build-option [#] (required)
1 = rebuild profile only
2 = rebuild profile and gesso
3 = rebuild gesso only
--gesso-branch-tag [branch/tag] (optional)
Provide a Git branch or tag name for uw_wcms_gesso.
Defaults to 8.x-3.x branch.
## Usage with parameters
./rebuild.sh --build-option=2 --gesso-branch-tag=8.x-3.x
./rebuild.sh 2 --gesso-branch-tag=8.x-3.x
## Usage without parameters
If you simply use ./rebuild.sh then interactivity will begin and ask questions
about the build options and gesso branch/tag. If you use at least one switch
then there is no interactivity. Example with interactivity:
What would you like to do?
1 = Rebuild profile only.
2 = Rebuild profile and gesso.
3 = Rebuild gesso only.
[x] Exit and do nothing
Build option [1]: 2
Gesso branch/tag: [8.x-3.x]:
Gesso is now installed with Composer as the [uw_wcms_gesso](https://git.uwaterloo.ca/wcms/uw_wcms_gesso) module in the composer.json.
## Using Pattern-Lab
......
{
"name": "uw_base_profile/uw_base_profile",
"name": "wcms/uw_base_profile",
"description": "Testing",
"type": "drupal-profile",
"license": "GPL-2.0-or-later",
"repositories": {
"0": {
"repositories": [
{
"type": "composer",
"url": "https://git.uwaterloo.ca/wcms/wcms-packages/raw/8.x-1.x/packages.json"
}
},
"conflict": {
"drupal/drupal": "*",
"wcms/wcms": "*",
"libraries/libraries": "*"
},
"config": {
"drupal-info-rewrite--additional-packageTypes": [
"wcms-module",
"wcms-theme"
],
"discard-changes": true,
"secure-http": false,
"sort-packages": true,
"vendor-dir": "../../vendor"
},
"minimum-stability": "stable",
],
"require": {
"commerceguys/addressing": "1.0.8",
"composer/installers": "^1.7",
......@@ -42,10 +27,10 @@
"drupal/conditional_fields": "dev-8.x-1.x#92aa786",
"drupal/config_update": "1.7",
"drupal/config_views": "dev-2.0.0-beta1-uw_wcms1",
"drupal/core": "8.9.13",
"drupal/crop": "2.1",
"drupal/ctools": "3.4",
"drupal/dashboards": "1.0-beta8",
"drupal/diff": "1.0",
"drupal/entity_browser": "2.5",
"drupal/entity_browser_block": "1.1",
"drupal/entity_browser_block_layout": "dev-8.x-1.x",
......@@ -58,7 +43,7 @@
"drupal/field_group": "3.1",
"drupal/field_validation": "1.0-beta3",
"drupal/file_mdm": "2.1",
"drupal/filefield_sources": "dev-8.x-1.x#ee23c9a",
"drupal/filefield_sources": "dev-8.x-1.x-mnshantz-ee23c9a-uw-wcms",
"drupal/geofield": "1.15",
"drupal/geofield_map": "2.67",
"drupal/hcaptcha": "1.1",
......@@ -91,8 +76,8 @@
"drupal/media_library_edit": "1.0-alpha1",
"drupal/media_library_form_element": "2.0.0",
"drupal/menu_admin_per_menu": "1.3",
"drupal/metatag": "1.15",
"drupal/module_filter": "dev-8.x-3.x#0ff8b83",
"drupal/metatag": "1.16",
"drupal/module_filter": "3.2",
"drupal/node_revision_delete": "1.0-rc3",
"drupal/paragraphs": "dev-1.12-uw_wcms1",
"drupal/pathauto": "1.8",
......@@ -104,9 +89,9 @@
"drupal/role_expire": "1.7",
"drupal/roleassign": "1.0-beta1",
"drupal/samlauth": "dev-3.0-alpha1-uw_wcms3",
"drupal/schema_metatag": "dev-8.x-2.x#7d5df4a",
"drupal/schema_metatag": "1.8",
"drupal/simplesamlphp_auth": "3.2",
"drupal/simplesamlphp_custom_attributes": "dev-8.x-1.x#7f2738e",
"drupal/simplesamlphp_custom_attributes": "dev-8.x-1.x-mnshantz-ef9d6a4-uw-wcms",
"drupal/simplify_menu": "2.0",
"drupal/smart_date": "3.1.1",
"drupal/sophron": "1.0",
......@@ -124,8 +109,8 @@
"drupal/views_block_placement_exposed_form_defaults": "dev-1.0-rc3-uw_wcms1",
"drupal/views_contextual_filters_or": "1.2",
"drupal/views_exposed_filter_blocks": "1.1",
"drupal/webform": "5.25",
"drupal/views_taxonomy_term_name_into_id": "dev-1.0-alpha3-uw_wcms1",
"drupal/webform": "5.25",
"drupal/workbench_access": "1.0-beta4",
"fileeye/mimemap": "^1.1",
"libraries/ckeditor-clipboard": "4.15.1",
......@@ -133,7 +118,7 @@
"libraries/ckeditor-lineutils": "4.15.1",
"libraries/ckeditor-mathjax": "4.15.1",
"libraries/ckeditor-widget": "4.15.1",
"libraries/drupal-composer-info-rewrite": "dev-master#9f13a21",
"libraries/drupal-composer-info-rewrite": "dev-8.x-1.x-9f13a21_uw_wcms",
"libraries/jquery-ui-touch-punch": "dev-master",
"onelogin/php-saml": "3.2.1",
"oomphinc/composer-installers-extender": "v1.1.2",
......@@ -160,60 +145,11 @@
"wcms/uw_dashboard": "dev-8.x-1.x",
"wcms/uw_fdsu_theme_resp": "dev-8.x-1.x",
"wcms/uw_media": "dev-8.x-1.x",
"wcms/uw_migrate": "dev-8.x-1.x",
"wcms/uw_sites_all": "dev-8.x-1.x",
"wcms/uw_theme_admin": "dev-8.x-1.x",
"wcms/uw_wcms_gesso": "dev-8.x-3.x",
"wikimedia/composer-merge-plugin": "^1.4"
},
"extra": {
"merge-plugin": {
"include": [
"composer.webform.libraries.json"
]
},
"installer-types": [
"wcms-module",
"wcms-theme",
"wcms-lib",
"drupal-library"
],
"installer-paths": {
"../../core": ["type:drupal-core"],
"libraries/{$name}": ["type:wcms-lib", "type:drupal-library"],
"modules/features/{$name}": ["type:wcms-module"],
"modules/contrib/{$name}": ["type:drupal-module"],
"themes/{$name}": ["type:wcms-theme"]
},
"enable-patching": true,
"composer-exit-on-patch-failure": true,
"patches": {
"drupal/core": {
"Fix Layout Builder rendering issues in Safari and Firefox": "patches/off-canvas-style-resets-2958588-13.patch",
"Fix drupal media undefined index error": "https://www.drupal.org/files/issues/2021-02-02/3196146-media-undefined-error-1.patch"
}
}
},
"require-dev": {
"behat/mink": "v1.7.1",
"behat/mink-goutte-driver": "v1.2.1",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"drupal/coder": "3.7",
"drupal/coffee": "1.0-beta2",
"drupal/devel": "4.0.1",
"drupal/diff": "1.0",
"drupal/maillog": "dev-8.x-1.x",
"drupal/search_kint": "1.0-patch.1",
"drupal/twig_vardumper": "2.2",
"drupal/vardumper": "1.5",
"hirak/prestissimo": "0.3.9",
"jcalderonzumba/gastonjs": "v1.2.0",
"jcalderonzumba/mink-phantomjs-driver": "0.3.3",
"kint-php/kint": "^3.3",
"mikey179/vfsstream": "v1.6.7",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^7",
"squizlabs/php_codesniffer": "^3.5",
"symfony/phpunit-bridge": "*",
"wcms/uw_site_dev": "dev-8.x-1.x"
}
}
#!/bin/bash
phpversion="$(php --version | head -n 1 | cut -d ' ' -f 2 | cut -c 1,3)"
if (( phpversion < 70 )); then
echo 'PHP is too old to continue. If in Vagrant, run "defaultphp71" to change versions.'
exit 1
fi
for i in "$@"
do
case $i in
1|2|3 )
build_option="${i#*=}"
shift # past argument=value
;;
-h|--help)
use_help="1"
shift
;;
--build-option=*)
build_option="${i#*=}"
shift # past argument=value
;;
--build-type=*)
build_type="${i#*=}"
shift # past argument=value
;;
--gesso-branch-tag=*)
gesso_branch_tag="${i#*=}"
shift # past argument=value
;;
--gesso-root-dir=*)
gesso_root_dir="${i#*=}"
shift # past argument=value
;;
--drupal-root-dir=*)
drupal_root_dir="${i#*=}"
shift # past argument=value
;;
*)
# unknown option
;;
esac
done
if [[ ! -z $use_help ]]; then
printf "./rebuild.sh will accept the following switches:\n"
printf "\n --build-option [#] (required)"
printf "\n 1 = rebuild profile only (for non-theme development)"
printf "\n 2 = rebuild profile and gesso (for theme development)"
printf "\n 3 = rebuild gesso only (for theme development)"
printf "\n 4 = rebuild profile only (for theme development)"
printf "\n"
printf "\n --build-type [#] (defaulted)"
printf "\n Provide a build before the script runs."
printf "\n If none given as a parameter, defaulted to vagrant, no options are given."
printf "\n"
printf "\n --gesso-branch-tag [branch/tag] (optional)"
printf "\n Provide a Git branch or tag name for uw_wcms_gesso."
printf "\n Defaults to 8.x-3.x branch."
printf "\n"
printf "\n --gesso-root-dir [directory] (optional)"
printf "\n Provide the directory where gesso is to be installed."
printf "\n Defaults to /var/www/html unless build-type is lando in which case it defaults to /app."
printf "\n"
printf "\n --drupal-root-dir [directory] (optional)"
printf "\n Provide the directory where Drupal is installed."
printf "\n Defaults to /var/www/drupal8."
printf "\n"
printf "\n Example usage:"
printf "\n ./rebuild.sh --build-option=2 --gesso-branch-tag=8.x-3.x --gesso-root-dir=/var/www/html --drupal-root-dir=/var/www/drupal8"
printf "\n"
printf "\n If there are no switches used then interactivity will being asking questions to get inputs but also allowing for the defaults."
printf "\n"
exit 1
fi
if [[ -z $build_option ]] && [[ -z $drupal_root_dir ]] && [[ -z $gesso_branch_tag ]] && [[ -z $gesso_root_dir ]]; then
interactivity=1
elif [ ${build_option} = null ] && [[ ${drupal_root_dir} = null ]] && [ ${gesso_branch_tag} = null ]; then
interactivity=1
else
interactivity=0
fi
if [ ${interactivity} == 1 ]; then
# Set up defaults.
script_path=`pwd`
gesso_root_default='/var/www/html'
if [[ "$script_path" == *"app"* ]]; then
drupal_root_default='/app/wcms'
gesso_root_default='/app/wcms'
elif [[ "$script_path" == *"alt"* ]]; then
drupal_root_default='/var/www/drupal8alt'
else
drupal_root_default='/var/www/drupal8'
fi
# Ask install questions.
echo "What would you like to do?"
echo "1 = Rebuild profile only (for non-theme development)."
echo "2 = Rebuild profile and gesso (for theme development)."
echo "3 = Rebuild gesso only (for theme development)."
echo "4 = Rebuild profile only (for theme development)."
echo "[x] Exit and do nothing"
while ! [[ "$build_option" =~ ^(1|2|3|4|x)$ ]]
do
printf "\nBuild option [1]: "
read -r build_option
if [[ -z $build_option ]]; then
build_option=1
fi
done
if [ ${build_option} == "x" ]; then
exit 1;
fi
if [[ -z $build_type ]]; then
build_type='vagrant'
fi
printf "\nDrupal root directory: [$drupal_root_default]: "
read -r drupal_root_dir
if [ ${build_option} == "2" ] || [ ${build_option} == "3" ]; then
printf "\nGesso branch/tag: [8.x-3.x]: "
read -r gesso_branch_tag
fi
if [ ${build_option} == "2" ] || [ ${build_option} == "3" ] || [ ${build_option} == "4" ]; then
printf "\nGesso root directory: [$gesso_root_default]: "
read -r gesso_root_dir
fi
fi
if [[ -z $build_option ]]; then
printf "You must specify a build option, it is a required switch.\n"
exit 1;
fi
if [[ -z $gesso_branch_tag ]]; then
gesso_branch_tag=8.x-3.x
fi
if [[ -z $drupal_root_dir ]]; then
drupal_root_dir="$drupal_root_default"
fi
if [[ -z $gesso_root_dir ]]; then
gesso_root_dir="$gesso_root_default"
fi
if [ ${build_option} == "1" ]; then
printf "Using gesso profile branch/tag: $gesso_branch_tag\n"
else
printf "Using gesso profile branch/tag: $gesso_branch_tag in directory $gesso_root_dir.\n"
printf "Building in Drupal root directory: $drupal_root_dir.\n"
fi
case $build_option in
1 )
echo ""
echo "You have chosen to rebuild profile only (for non-theme development).";
echo ""
if [[ $? -ne 0 ]] ; then
exit 1
else
sh ./scripts/rebuild_profile.sh $build_option $drupal_root_dir $gesso_tag_branch
fi
;;
2 )
echo ""
echo "You have chosen to rebuild profile and gesso (for theme development).";
echo ""
if [[ $? -ne 0 ]] ; then
exit 1
else
sh ./scripts/rebuild_profile.sh $build_option $drupal_root_dir $gesso_branch_tag $gesso_root_dir
fi
;;
3 )
echo ""
echo "You have chosen to rebuild gesso only (for theme development)."
echo ""
if [[ $? -ne 0 ]] ; then
exit 1
else
sh ./scripts/build_gesso_devel.sh $drupal_root_dir $gesso_branch_tag $gesso_root_dir
fi
;;
4 )
echo ""
echo "You have chosen to rebuild profile only (for theme development).";
echo ""
if [[ $? -ne 0 ]] ; then
exit 1
else
sh ./scripts/rebuild_profile.sh $build_option $drupal_root_dir $gesso_branch_tag $gesso_root_dir
fi
;;
esac
echo "Done all tasks."
echo "You should be running the rebuild script from the artifact folder..."
echo "You will now be redirected and the script will run..."
cd ../../../
pwd
./rebuild.sh
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment