From 401c8458b81531f98e472080ae844decf749ba56 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 8 Aug 2016 11:36:46 -0400 Subject: [PATCH] Converting BLT to composer package. (#217) * Moving template/build to build. * Removing custom tasks dir. * Removing build/core. * Removing template dir. * Fixing incorrect paths in phpunit tests. * Fixing executables. * Removing unnecessary git fetch. * Making phpcs filesets configurable. * Working on upgrade path. * Updating install docs and process. * Making setup tasks more verbose. * Using fork of composer-patches. * Adding update instructions. * More improvements to verbosity. * debug * Fixing rsync issues. * updating instructions. * fixing upgrade script. * fixing travis. * Adding create-project target. * Adding blt-project instructions. * Installing alias as part of init. * fixing travis * more docs fixes. * Replace blt sh mentions with blt alias. (#263) * Allowing custom import. * Removing changes from rebase. --- .gitignore | 3 - .travis.yml | 43 ++- CONTRIBUTING.md | 45 +++ INSTALL.md | 170 ++++++---- README.md | 40 +-- bin/blt | 13 + bin/blt-console | 25 ++ blt-project/.gitignore | 2 + blt-project/README.md | 3 + blt-project/composer.json | 25 ++ blt.sh | 9 +- build/README.md | 17 - build/phing/build.xml | 180 ----------- build/phing/build.yml | 2 - composer.json | 26 +- composer.lock | 291 +++++++++--------- {template/build => phing}/README.md | 6 +- .../build/core/phing => phing}/build.xml | 44 ++- .../build/core/phing => phing}/build.yml | 9 +- .../phing => phing}/example.multisite.yml | 2 +- .../build/core => phing}/files/.gitignore | 0 .../build/core => phing}/files/README.md | 0 .../core => phing}/files/deploy-exclude.txt | 0 .../phing => phing}/phingcludes/BehatTask.php | 0 .../phing => phing}/phingcludes/DrushTask.php | 0 .../phingcludes/FileInFilesetCondition.php | 0 .../FilterFileListByFileSetTask.php | 0 .../phingcludes/PhpVariableTask.php | 0 .../build/core/phing => phing}/tasks/acsf.xml | 0 phing/tasks/blt.xml | 109 +++++++ .../build/core/phing => phing}/tasks/ci.xml | 4 +- .../core/phing => phing}/tasks/deploy.xml | 4 +- .../core/phing => phing}/tasks/filesets.xml | 0 .../core/phing => phing}/tasks/frontend.xml | 0 .../core/phing => phing}/tasks/local-sync.xml | 0 phing/tasks/properties.xml | 31 ++ .../core/phing => phing}/tasks/setup.xml | 96 ++++-- .../core/phing => phing}/tasks/tests.xml | 6 +- .../core/phing => phing}/tasks/validate.xml | 43 +-- .../build/core/phing => phing}/tasks/vm.xml | 6 +- {template/scripts => scripts}/README.md | 0 {template/scripts => scripts}/blt/alias | 4 +- scripts/blt/convert-to-composer.sh | 67 ++++ .../scripts => scripts}/blt/install-alias.sh | 9 +- .../blt/rsync-include-if-does-not-exist.txt | 3 + .../scripts => scripts}/blt/update-scaffold | 1 + .../scripts => scripts}/drupal-vm/Vagrantfile | 0 .../scripts => scripts}/drupal-vm/config.yml | 0 .../drupal-vm/drupal-vm.aliases.drushrc.php | 0 .../release-notes/README.md | 0 .../release-notes/generate-release-notes.md | 0 .../release-notes/generate-release-notes.php | 0 .../release-notes/pull-request.example.md | 0 .../release-notes/release.example.md | 0 .../scripts => scripts}/tugboat/Makefile | 0 .../scripts => scripts}/tugboat/README.md | 2 +- .../scripts => scripts}/tugboat/build.sh | 0 {template/scripts => scripts}/tugboat/init.sh | 0 .../tugboat/install-node.sh | 0 .../tugboat/tugboat.drushrc.aliases.php | 0 .../scripts => scripts}/tugboat/update.sh | 0 src/Console/Command/ComposerMungeCommand.php | 153 +++++++++ src/Console/Command/YamlMungeCommand.php | 66 ++++ template/.travis.yml | 15 +- template/blt.sh | 23 -- template/build/core/README.md | 8 - template/build/core/phing/tasks/blt.xml | 20 -- .../build/core/phing/tasks/properties.xml | 42 --- template/build/custom/README.md | 3 - template/build/custom/files/README.md | 1 - template/build/custom/phing/build.xml | 23 -- template/build/custom/phing/build.yml | 3 - template/build/custom/phing/tasks/README.md | 0 template/composer.json | 20 +- .../block.block.bartik_account_menu.yml | 23 -- .../install/block.block.bartik_branding.yml | 22 -- .../block.block.bartik_breadcrumbs.yml | 19 -- .../install/block.block.bartik_content.yml | 19 -- .../install/block.block.bartik_footer.yml | 23 -- .../install/block.block.bartik_help.yml | 19 -- .../block.block.bartik_local_actions.yml | 17 - .../block.block.bartik_local_tasks.yml | 19 -- .../install/block.block.bartik_main_menu.yml | 23 -- .../install/block.block.bartik_messages.yml | 19 -- .../install/block.block.bartik_page_title.yml | 17 - .../install/block.block.bartik_powered.yml | 19 -- .../install/block.block.seven_breadcrumbs.yml | 19 -- .../install/block.block.seven_content.yml | 19 -- .../config/install/block.block.seven_help.yml | 19 -- .../block.block.seven_local_actions.yml | 17 - .../install/block.block.seven_login.yml | 19 -- .../install/block.block.seven_messages.yml | 19 -- .../block.block.seven_primary_local_tasks.yml | 19 -- ...lock.block.seven_secondary_local_tasks.yml | 19 -- .../minimal/config/install/system.theme.yml | 2 - .../profiles/custom/minimal/minimal.info.yml | 14 - .../profiles/custom/minimal/minimal.install | 20 -- template/docroot/sites/default/settings.php | 50 +-- .../sites/default/settings/base.settings.php | 3 + .../sites/default/settings/blt.settings.php | 55 ++++ .../default/settings/includes.settings.php | 13 - .../docroot/sites/development.services.yml | 4 - .../docroot/sites/example.settings.local.php | 107 +++++++ .../pre-settings-php/includes.php | 2 +- template/project.yml | 13 +- template/readme/acsf-setup.md | 2 +- template/readme/deploy.md | 6 +- template/readme/local-development.md | 8 +- template/readme/onboarding.md | 8 +- template/readme/project-tasks.md | 29 +- template/readme/release-process.md | 2 +- template/readme/repo-architecture.md | 2 +- template/tests/README.md | 6 +- template/tests/behat/example.local.yml | 2 +- template/tests/phpunit/Bolt/DrushTest.php | 1 + template/tests/phpunit/Bolt/GitTest.php | 1 + tests/phpunit/BltTest.php | 33 +- tests/phpunit/DeployTest.php | 6 +- tests/phpunit/DrupalVmTest.php | 22 +- 119 files changed, 1277 insertions(+), 1240 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100755 bin/blt create mode 100755 bin/blt-console create mode 100644 blt-project/.gitignore create mode 100644 blt-project/README.md create mode 100644 blt-project/composer.json delete mode 100644 build/README.md delete mode 100644 build/phing/build.xml delete mode 100644 build/phing/build.yml rename {template/build => phing}/README.md (94%) rename {template/build/core/phing => phing}/build.xml (64%) rename {template/build/core/phing => phing}/build.yml (84%) rename {template/build/core/phing => phing}/example.multisite.yml (93%) rename {template/build/core => phing}/files/.gitignore (100%) rename {template/build/core => phing}/files/README.md (100%) rename {template/build/core => phing}/files/deploy-exclude.txt (100%) rename {template/build/core/phing => phing}/phingcludes/BehatTask.php (100%) rename {template/build/core/phing => phing}/phingcludes/DrushTask.php (100%) rename {template/build/core/phing => phing}/phingcludes/FileInFilesetCondition.php (100%) rename {template/build/core/phing => phing}/phingcludes/FilterFileListByFileSetTask.php (100%) rename {template/build/core/phing => phing}/phingcludes/PhpVariableTask.php (100%) rename {template/build/core/phing => phing}/tasks/acsf.xml (100%) create mode 100644 phing/tasks/blt.xml rename {template/build/core/phing => phing}/tasks/ci.xml (85%) rename {template/build/core/phing => phing}/tasks/deploy.xml (96%) rename {template/build/core/phing => phing}/tasks/filesets.xml (100%) rename {template/build/core/phing => phing}/tasks/frontend.xml (100%) rename {template/build/core/phing => phing}/tasks/local-sync.xml (100%) create mode 100644 phing/tasks/properties.xml rename {template/build/core/phing => phing}/tasks/setup.xml (58%) rename {template/build/core/phing => phing}/tasks/tests.xml (94%) rename {template/build/core/phing => phing}/tasks/validate.xml (72%) rename {template/build/core/phing => phing}/tasks/vm.xml (88%) rename {template/scripts => scripts}/README.md (100%) rename {template/scripts => scripts}/blt/alias (76%) create mode 100755 scripts/blt/convert-to-composer.sh rename {template/scripts => scripts}/blt/install-alias.sh (79%) create mode 100644 scripts/blt/rsync-include-if-does-not-exist.txt rename {template/scripts => scripts}/blt/update-scaffold (98%) rename {template/scripts => scripts}/drupal-vm/Vagrantfile (100%) rename {template/scripts => scripts}/drupal-vm/config.yml (100%) rename {template/scripts => scripts}/drupal-vm/drupal-vm.aliases.drushrc.php (100%) rename {template/scripts => scripts}/release-notes/README.md (100%) rename {template/scripts => scripts}/release-notes/generate-release-notes.md (100%) rename {template/scripts => scripts}/release-notes/generate-release-notes.php (100%) rename {template/scripts => scripts}/release-notes/pull-request.example.md (100%) rename {template/scripts => scripts}/release-notes/release.example.md (100%) rename {template/scripts => scripts}/tugboat/Makefile (100%) rename {template/scripts => scripts}/tugboat/README.md (98%) rename {template/scripts => scripts}/tugboat/build.sh (100%) rename {template/scripts => scripts}/tugboat/init.sh (100%) rename {template/scripts => scripts}/tugboat/install-node.sh (100%) rename {template/scripts => scripts}/tugboat/tugboat.drushrc.aliases.php (100%) rename {template/scripts => scripts}/tugboat/update.sh (100%) create mode 100644 src/Console/Command/ComposerMungeCommand.php create mode 100644 src/Console/Command/YamlMungeCommand.php delete mode 100755 template/blt.sh delete mode 100644 template/build/core/README.md delete mode 100644 template/build/core/phing/tasks/blt.xml delete mode 100644 template/build/core/phing/tasks/properties.xml delete mode 100644 template/build/custom/README.md delete mode 100644 template/build/custom/files/README.md delete mode 100644 template/build/custom/phing/build.xml delete mode 100644 template/build/custom/phing/build.yml delete mode 100644 template/build/custom/phing/tasks/README.md delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_account_menu.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_branding.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_breadcrumbs.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_content.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_footer.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_help.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_local_actions.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_local_tasks.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_main_menu.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_messages.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_page_title.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.bartik_powered.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.seven_breadcrumbs.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.seven_content.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.seven_help.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.seven_local_actions.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.seven_login.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.seven_messages.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.seven_primary_local_tasks.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/block.block.seven_secondary_local_tasks.yml delete mode 100644 template/docroot/profiles/custom/minimal/config/install/system.theme.yml delete mode 100644 template/docroot/profiles/custom/minimal/minimal.info.yml delete mode 100644 template/docroot/profiles/custom/minimal/minimal.install create mode 100644 template/docroot/sites/default/settings/blt.settings.php delete mode 100644 template/docroot/sites/default/settings/includes.settings.php create mode 100644 template/docroot/sites/example.settings.local.php diff --git a/.gitignore b/.gitignore index db909315b..7feca236a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,6 @@ /project.yml local.* -# Ignore build artifacts -bin/* - # OS X .DS_Store .AppleDouble diff --git a/.travis.yml b/.travis.yml index 296034431..db99de46d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ language: php php: - 5.6 + - 7 cache: bundler: true @@ -25,9 +26,8 @@ addons: before_install: # Decrypt private SSH key id_rsa_blt.enc, save as ~/.ssh/id_rsa_blt. - if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then openssl aes-256-cbc -K $encrypted_c0b166e924da_key -iv $encrypted_c0b166e924da_iv -in id_rsa_blt.enc -out ~/.ssh/id_rsa -d; chmod 600 ~/.ssh/id_rsa; ls -lash ~/.ssh; eval "$(ssh-agent -s)"; ssh-add ~/.ssh/id_rsa; fi - - nvm install 0.12 - - nvm use 0.12 - composer selfupdate + # Disable xdebug. - phpenv config-rm xdebug.ini # Enable $_ENV variables in PHP. - echo 'variables_order = "EGPCS"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini @@ -38,10 +38,16 @@ before_install: - mysql -e 'CREATE DATABASE drupal;' install: + # Load composer dependencies. - composer validate --no-check-all --ansi + # Remove acquia packages from cache before running `composer install`. + - rm -rf vendor/acquia - composer install - export PATH=$TRAVIS_BUILD_DIR/vendor/bin:$PATH - # Initialize drupal consile default configuration. + # Install proper version of node for front end tasks. + - nvm install 4.4.1 + - nvm use 4.4.1 + # Initialize drupal console default configuration. - drupal init before_script: @@ -53,27 +59,36 @@ before_script: script: # Ensure code quality of 'blt' itself. - phpcs --standard=./vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml tests - # Generate a new 'blted' project. - - ./blt.sh configure + # Generate a new 'blt-project' project. + - cp -R blt-project ../ + - cd ../blt-project + - git init + - git add -A + # Commit so that susbsequent git commit tests have something to ammend. + - git commit -m 'Initial commit.' + # BLT is the only dependency at this point. Install it. + - composer install + - export PATH=$TRAVIS_BUILD_DIR/../blt-project/vendor/bin:$PATH + - yes | blt init # The local.hostname must be set to 127.0.0.1:8888 because we are using drush runserver to run the site on Travis CI. - drupal yaml:update:value project.yml project.local.hostname '127.0.0.1:8888' - - ./blt.sh create - # Move to the target directory. - - cd ../blted8 - # Call targets in the new 'blted' project. - - ./blt.sh ci:build:validate:test -Dcreate_alias=false -Dbehat.run-server=true -Dbehat.launch-phantom=true + - blt configure + # Running `blt init` modified composer.json, so we must update. + - composer update + # Call targets in the new 'blt-project' project. + - blt ci:build:validate:test -Dcreate_alias=false -Dbehat.run-server=true -Dbehat.launch-phantom=true # Deploy build artifact. - - ./blt.sh deploy:build -Ddeploy.commitMsg="Automated commit by Travis CI for Build ${TRAVIS_BUILD_ID}" -Ddeploy.branch="8.x-build" + - blt deploy:build # Add Drupal VM config to repo. - - ./blt.sh vm:init - # Switch back to 'blt' directory + - blt vm:init + # Switch back to 'blt' directory. - cd ../blt # Run 'blt' phpunit tests, excluding deploy-push tests. - phpunit tests/phpunit --exclude-group deploy-push deploy: provider: script - script: ../blted8/blt.sh deploy -Ddeploy.commitMsg="Automated commit by Travis CI for Build ${TRAVIS_BUILD_ID}" -Ddeploy.branch="8.x-build" && phpunit tests/phpunit --group=deploy + script: cd blt-project && blt deploy -Ddeploy.commitMsg="Automated commit by Travis CI for Build ${TRAVIS_BUILD_ID}" -Ddeploy.branch="8.x-build" && phpunit tests/phpunit --group=deploy skip_cleanup: true on: branch: 8.x diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..8c1583f2a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,45 @@ +# Contributing to BLT + +Please feel free to contribute to the project or file issues via the GitHub issue queue. When doing so, please keep the following points in mind: + +* BLT is distributed under the GPLv2 license; WITHOUT ANY WARRANTY. +* The project maintainers make no commitment to respond to support requests, + feature requests, or pull requests. +* All contributions to BLT will be reviewed for compliance with Drupal Coding + Standards and best practices as defined by the project maintainer. +* Feature that are part of the [Road Map](https://github.com/acquia/blt/wiki/Road-Map) + will be prioritized for inclusion. + +BLT work is currently being tracked in the [BLT GitHub issue queue](https://github.com/acquia/blt/issues) and organized via a [Waffle.io Kanban Board](https://waffle.io/acquia/blt). + +## Developing BLT locally + +If you'd like to contribute by actively developing BLT, we suggest that you clone BLT and also created a BLT-ed project for testing your changes. + +Use the following commands to create a testable BLT-created project alongside BLT + +``` +git clone https://github.com/acquia/blt.git +cp -R blt/blt-project . +cd blt-project +composer install +./vendor/acquia/blt/blt.sh install-alias +blt init +blt configure +composer update +``` + +The new `blt-project` directory will have a composer dependency on your local clone of BLT via a `../blt` symlink. You can therefore make changes to files in `blt` and see them immediately reflected in `blt-project/vendor/acquia/blt`. + +## Development conventions + +### Phing targets vs. Symfony commands? + +While Phing and the Symfony Console can both accomplish some of the same tasks, they are different tools with different intended purposes. When developing functionality for BLT we are careful to choose the right tool for the right job. + +Phing is intended to be build tool. It is particularly good at stringing together multiple commands and tasks into a single target which can then be executed procedurally. We use Phing when are requirements are well suited to this strength. + +The commands that Phing executes can, of course, be provided by anything. Some are native linux commands, some are provided by tools like Composer and NPM, while others may be provided by the Symfony Console component. + +As a rule, we _use Symfony console to provide fixed-scope commands_. These commands should be flexible and have absolutely no intrinsic awareness of the greater build process. We _use Phing to call commands within the context of a build process_, executing them with specific argument values at the correct time. + diff --git a/INSTALL.md b/INSTALL.md index 3a03af39a..e49d8d5a2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,13 +1,11 @@ -## Creating a new project with BLT +# BLT installation and updates -The following high-level steps will be required to generate a new, fully functioning site using BLT: - -1. Ensure your native OS meets minimum requirements -1. Clone BLT to your local machine -1. Generate and modify configuration files for your new project -1. Use BLT’s “installer” to generate a new site -1. Setup a local *AMP stack -1. Build your new project’s dependencies and install locally +* System requirements +* [Creating a new project with BLT](#creating-new) +* [Adding BLT to an existing project](#existing-project) +* [Updating to the latest version of BLT](#updating) + * [Updating from a non-composer-managed version](#update-non-composered) + * [Updating a composer-managed version](#update-composered) ## System Requirements @@ -15,48 +13,109 @@ You should be able to use the following tools on the command line of your native * [Git](https://git-scm.com/) * [Composer](https://getcomposer.org/download/) -* PHP 5.6. PHP installation instructions: +* PHP 5.6+, PHP installation instructions: * [OSX](http://justinhileman.info/article/reinstalling-php-on-mac-os-x/) * [Windows](http://php.net/manual/en/install.windows.php) * [Linux](http://php.net/manual/en/install.unix.debian.php) - -## Prepare BLT installer - -* Clone BLT to your local machine on your native OS: - `git clone https://github.com/acquia/blt.git` - -# Generate and modify configuration files - -From the BLT repository’s root directory, run `./blt.sh configure`. This will create your project-specific configuration files. After running, the following files should exist in the BLT root directory: - -* project.yml -* local.settings.php - -You will need to open these files and modify their values with settings for your project. At a minimum, you must set the following configuration items: - -* Local site DB credentials: `$databases` in local.settings.php - -At this point, you likely have not configured your local *AMP stack for your new site. That’s ok. Simply enter the local URL and local DB credentials that you intend to use when your *AMP stack is up and running. - -## Create a new project - -BLT’s “installer” will do the following: -* Create new project directory (sibling of the BLT repository) -* Copies BLT template files to the new directory -* Replaces tokens in copied files with project-specific strings -* Removes installation artifacts - -Run `./blt.sh create` to do all the things! - -Once it’s completed, __change directories to your new project directory. All subsequent steps will happen inside your new project. You have left the BLT repository behind.__ - -## Modifying project files - -This is an optional step. Important files that you may want to modify include: - -* composer.json. Note that Drupal core, contrib, and third party dependencies are all managed here. -* Project’s root README.md. -* Other project documentation in the readme directory. +* [NPM](https://nodejs.org/en/download/) (for [Lightning](https://github.com/acquia/lightning) support) + +### Recommended tools and configuration + +* Globally install pretissimo for parallelized composer downloads: + + ``` + composer global require "hirak/prestissimo:^0.3" + ``` +* If you have xDebug enabled for your PHP CLI binary, it is highly recommended that you disable it to dramatically improve performance. + +## Creating a new project with BLT + +1. Create a new project using the [blt-project](https://github.com/acquia/blt-project) template: + + ``` + composer create-project acquia/blt-project:8.x-dev MY_PROJECT --no-interaction + cd MY_PROJECT + ``` +1. Install the `blt` alias and follow on-screen instructions: + + ``` + ./vendor/bin/blt install-alias + ``` +1. Customize BLT configuration files: + * `project.yml` + * `docroot/sites/default/settings/local.settings.php` + * Add your local DB credentials to `$databases` +1. Replace tokens in new BLT-generated files with your custom values in project.yml: + + ``` + blt configure + ``` +1. (optional) Modify project files. Important files that you may want to modify include: + * composer.json. Note that Drupal core, contrib, and third party dependencies are all managed here. + * Project’s root README.md. + * Other project documentation in the readme directory. +1. (optional) Follow instructions for installing Drupal locally. + +## Adding BLT to an existing project + +To add BLT to a pre-existing Drupal project, do the following: + +1. Ensure that your project directory structure is Acquia-cloud compatible by asserting that the Drupal root is in a top-level folder called `docroot`. +1. If you currently manage your dependencies via Composer, ensure that they are all up to date via `composer update`. Assert that these updates do not break your project. +1. `cd` into your existing project directory. +1. Add BLT via composer and initialize it: + ``` + composer require acquia/blt:~8 + ./vendor/acquia/blt/blt.sh init + ``` +1. (optional) Modify project files. Important files that you may want to modify include: + * composer.json. Note that Drupal core, contrib, and third party dependencies are all managed here. + * Project’s root README.md. + * Other project documentation in the readme directory. +1. (optional) Follow instructions for installing Drupal locally. + +## Updating BLT + +### Updating a composer-managed version + +If you are already using BLT via Composer, you can update to the latest version of BLT by running the following commands from your project's root directory: + +``` +composer update acquia/blt +blt update +``` + +### Updating from a non-Composer-managed version + +If you are using an older version of BLT that was not installed using Composer, you may update to the Composer-managed version by running the following commands: + +1. Remove any dependencies that may conflict with upstream acquia/blt. You may add these back later after the upgrade, if necessary. + + ``` + composer remove drush/drush drupal/console phing/phing phpunit/phpunit squizlabs/php_codesniffer symfony/yaml drupal/coder symfony/console --no-interaction --no-update + composer remove drush/drush drupal/console phing/phing phpunit/phpunit squizlabs/php_codesniffer symfony/yaml drupal/coder symfony/console --dev --no-interaction --no-update + composer config minimum-stability dev + ``` +1. (conditional) If you are using Lightning, verify that your version constraint allows it to be updated to the latest stable version: + + ``` + composer require drupal/lightning:~8 --no-update + ``` +1. Require acquia/blt as a dev dependency: + + ``` + composer require acquia/blt:~8 --dev --no-update + ``` +1. Update all dependencies: + + ``` + composer update + ``` +1. Execute update script: + + ``` + ./vendor/acquia/blt/scripts/blt/convert-to-composer.sh + ``` Note that all of the steps from this point forward are the same steps that would be used by a newly onboarded developer setting up your existing project on their local machine for the first time. @@ -65,7 +124,7 @@ Note that all of the steps from this point forward are the same steps that would Before building your project dependencies and installing Drupal, you must have a fully functional \*AMP stack on your local machine. BLT intentionally does not provide this local development environment--that is outside of the scope of BLT’s intended responsibilities. It does, however, make recommendations for which tools you should use to manage your stack. Please see [Local Development](template/readme/local-development.md) for more information on setting up your \*AMP stack: - * [Acquia Dev Desktop](template/readme/local-development.md#using-acquia-dev-desktop-for-blt-generated-projects) + * [Acquia Dev Desktop](template/readme/local-development.md#using-acquia-dev-desktop-for-blt-generated-projects) * [Drupal VM](template/readme/local-development.md#using-drupal-vm-for-blt-generated-projects) * [Other](https://github.com/acquia/blt/blob/8.x/template/readme/local-development.md#alternative-local-development-environments) @@ -74,9 +133,9 @@ When you have completed setting up your local \*AMP stack, double check that the * Local site DB credentials: `$databases` in docroot/sites/default/settings/local.settings.php * Local site URL: `$options[‘uri’]` in docroot/sites/default/local.drushrc.php -## Build your project’s dependencies and install Drupal +## Build your project’s local dependencies and install Drupal locally -Run the following command from the project root: `./blt.sh local:setup`. This will do a lot of things for you, including: +Run the following command from the project root: `blt local:setup`. This will do a lot of things for you, including: * Building dependencies * Installing local git hooks @@ -85,13 +144,8 @@ Run the following command from the project root: `./blt.sh local:setup`. This wi When this task is complete, you should have a fully functioning Drupal site on your local machine. You can login to the site by running `drush uli`. -Note that all common project tasks are executed through `blt.sh` in your project’s root directory. This file simply passes arguments through to Phing, which manages all task automation. For a full list of available tasks, run `./blt.sh -l`. +Note that all common project tasks are executed through `blt`. For a full list of available tasks, run `blt -l`. ## Next Steps -Now that your new project works locally, you’ll want to integrate with with your SAAS tools (GitHub, TravisCI, Jenkins, etc.) and your Acquia Cloud subscription. - -See the following documents for more detailed instructions on those tasks: - -* Configure your CI solution @todo link -* Deploy to Acquia Cloud @todo link +Now that your new project works locally, read through the new [README.md](https://github.com/acquia/blt/blob/8.x/template/README.md) file in your project to learn how to perform common project tasks and integrate with third party tools. diff --git a/README.md b/README.md index a21ddc94a..942227e37 100644 --- a/README.md +++ b/README.md @@ -58,40 +58,24 @@ Follow the instructions in [INSTALL.md](INSTALL.md) to generate a new project us ## Keeping BLT projects up-to-date -"How do I pull down upstream changes from BLT to my BLT-generated project?" +BLT has been converted into a Composer package. -This is a popular question, and it's difficult to answer. +If you are using a version BLT that was not installed using Composer, perform the following steps to upgrade to the newest version: -BLT is designed as a "starter kit" rather than a "distribution". It intentionally began with a "fork it and forget it" approach to updates. This is largely due to the fact that BLT generated files are templates that are meant to be customized, and pulling in upstream updates would wipe out those customizations. +``` +composer require acquia/blt:~8 +./vendor/acquia/blt/scripts/blt/convert-to-composer.sh +``` -That said, there are components of BLT that could be treated as dependencies that receive upstream updates. Those components include: +If your project is already using BLT via Composer, perform the following steps: -* Project tasks -* Scripts -* Acquia Cloud hooks - -The ideal approach would be to split each of these into a separate, versioned projects that could be treated as formal composer.json dependencies, but we don't currently have the resources to maintain all of those projects. - -As a stopgap, you can run the following command to pull in upstream updates to specific files and directories in your BLT generated project: - -`./blt.sh blt:update` - -After running, you can review changes via `git diff` and decide what should be committed. +``` +composer update acquia/blt +blt update +``` # License, support, and contribution BLT is provided as an open source tool in the hope that it will enabled developers to easily generate new Drupal projects that conform to Acquia Professional Services' best practices. -Please feel free to contribute to the project or file issues via the GitHub issue queue. When doing so, please keep the following points in mind: - -* BLT is distributed under the GPLv2 license; WITHOUT ANY WARRANTY. -* The project maintainers make no commitment to respond to support requests, - feature requests, or pull requests. -* All contributions to BLT will be reviewed for compliance with Drupal Coding - Standards and best practices as defined by the project maintainer. -* Feature that are part of the [Road Map](https://github.com/acquia/blt/wiki/Road-Map) - will be prioritized for inclusion. - -BLT work is currently being tracked in the [BLT GitHub issue queue] -(https://github.com/acquia/blt/issues) and organized via a -[Waffle.io Kanban Board](https://waffle.io/acquia/blt). +Please feel free to contribute to the project or file issues via the GitHub issue queue. See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines and instructions. diff --git a/bin/blt b/bin/blt new file mode 100755 index 000000000..80d102380 --- /dev/null +++ b/bin/blt @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +if [ "`git rev-parse --show-cdup 2> /dev/null`" != "" ]; then + GIT_ROOT=$(git rev-parse --show-cdup) +else + GIT_ROOT="." +fi + +if [ -f "$GIT_ROOT/vendor/acquia/blt/blt.sh" ]; then + $GIT_ROOT/vendor/acquia/blt/blt.sh "$@" +else + echo "You must run this command from within a BLT-generated project repository." +fi diff --git a/bin/blt-console b/bin/blt-console new file mode 100755 index 000000000..ca5219f91 --- /dev/null +++ b/bin/blt-console @@ -0,0 +1,25 @@ +#!/usr/bin/env php +add(new ComposerMungeCommand()); +$application->add(new YamlMungeCommand()); +$application->run(); diff --git a/blt-project/.gitignore b/blt-project/.gitignore new file mode 100644 index 000000000..987e2a253 --- /dev/null +++ b/blt-project/.gitignore @@ -0,0 +1,2 @@ +composer.lock +vendor diff --git a/blt-project/README.md b/blt-project/README.md new file mode 100644 index 000000000..fa7e0ac3c --- /dev/null +++ b/blt-project/README.md @@ -0,0 +1,3 @@ +This directory is used to aid in the development and testing of BLT. + +See CONTRIBUTING.md for instructions on how you can develop BLT locally. diff --git a/blt-project/composer.json b/blt-project/composer.json new file mode 100644 index 000000000..3bca4e50f --- /dev/null +++ b/blt-project/composer.json @@ -0,0 +1,25 @@ +{ + "name": "acquia/blt-project", + "description": "Example project used to create new projects with BLT.", + "license": "GPL-2.0", + "authors": [ + { + "name": "Matthew Grasmick", + "email": "matthew.grasmick@acquia.com" + } + ], + "repositories": [ + { + "type": "path", + "url": "../blt", + "options": { + "symlink": true + } + } + ], + "require-dev": { + "acquia/blt": "*@dev" + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/blt.sh b/blt.sh index 114ca832b..e98581a5f 100755 --- a/blt.sh +++ b/blt.sh @@ -12,12 +12,15 @@ if [[ $COMPOSER_IS_INSTALLED -ne 0 ]]; then exit 1 fi -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -if [ ! -f ${DIR}/vendor/bin/phing ]; then +SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +BIN=$(cd ${SCRIPT_DIR}/../../bin && pwd) +PHING=${BIN}/phing + +if [ ! -f ${PHING} ]; then echo "Phing was not found in this project's vendor/bin directory." echo "Attempting to run composer install. This takes a few minutes." composer install fi # This script simply passes all arguments to Phing. -${DIR}/vendor/bin/phing -f ${DIR}/build/phing/build.xml "$@" +${PHING} -f ${SCRIPT_DIR}/phing/build.xml "$@" diff --git a/build/README.md b/build/README.md deleted file mode 100644 index 3f8838a23..000000000 --- a/build/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# BLT Build Process - -Given that BLT generates child projects which must be tested, the CI flow is a little confusing. The CI configuration is detailed below. - -## CI Flow - -When a pull request is submitted a travis build is run against BLT. This tests BLT's ability to generate a new project. After a successful build, the new project will be deployed to Acquia Cloud and to a GitHub repository, where another child Travis build is subsequently executed. Here is the step-by-step breakdown: - -1. BLT 7.x Pull Request is submitted -2. Travis Build *against BLT* creates BLTed7 child project - * Tests are run to assert that project was created - * Tests are run against the child project (install, behat, phpunit, etc.) -3. Upon success, BLTed7 child project is pushed to ACE blted 7 subscription. - * Tests assert that deployment to remote(s) was successful -4. Travis Build *against BLTed7* begins. Sadly, failure of this build has no impact on the success of BLT's builds. Status of child builds should be checked periodically to verify that BLT is generating a working build process for child projects out of the box. - -Likewise, this process occurs for pull requests submitted to BLT 8.x with BLTed8 as a companion project. diff --git a/build/phing/build.xml b/build/phing/build.xml deleted file mode 100644 index d9e4e7012..000000000 --- a/build/phing/build.xml +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The following files have been generated: - ${blt.root}/project.yml - ${blt.root}/local.settings.php - - Modify these files and then run "./blt.sh create" to generate a new project. - - - - - - - - - Please run "./blt.sh configure" before running "./blt.sh create." - - - - - - - - - - - - - - Build aborted by user. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - New project was created in ${blt.new.dir} - Please change to the new project directory! - cd ${blt.new.dir} - - All subsequent steps should be performed in the new project: - 1. Configure the local *AMP stack of your choice. See readme/local-development.md for more information. - 2. Verify that $databases in docroot/sites/default/settings/local.settings.php contains correct credentials. - 3. Verify that $options[‘uri’] in docroot/sites/default/local.drushrc.php contains correct local URL. - 4. Run the following command from the new project root: - ./blt.sh local:setup - - Follow the documentation in ${blt.new.dir}/README.md for anything else. - - - - - - - - - - - - - - - - - - - diff --git a/build/phing/build.yml b/build/phing/build.yml deleted file mode 100644 index 8f546aaed..000000000 --- a/build/phing/build.yml +++ /dev/null @@ -1,2 +0,0 @@ -blt: - new.dir: ${blt.root}/../${project.machine_name} diff --git a/composer.json b/composer.json index 6428583bd..e2303829e 100644 --- a/composer.json +++ b/composer.json @@ -3,13 +3,25 @@ "description": "BLT", "license": "GPL-2.0", "require": { - "drupal/console": "~1.0", - "phing/phing": "2.*", - "phpunit/phpunit": "5.4.*", + "drupal/console": "~1", + "phing/phing": "2.*", + "phpunit/phpunit": "~5.4", "platinumpixs/phing-random-string": "dev-master", - "squizlabs/php_codesniffer": "^2.4", - "symfony/yaml": "~2.7", - "drupal/coder": "~8.2" + "squizlabs/php_codesniffer": "^2.4", + "symfony/yaml": "~2.7", + "drupal/coder": "~8.2", + "symfony/console": "~2" }, - "minimum-stability": "beta" + "autoload": { + "psr-4": {"Acquia\\Blt\\": "src/"} + }, + "bin": [ + "bin/blt", + "bin/blt-console" + ], + "minimum-stability": "beta", + "prefer-stable": true, + "scripts": { + "install-blt-alias": "./blt.sh install-alias" + } } diff --git a/composer.lock b/composer.lock index 6f3b851c7..029c73175 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "d663ae7317ba8295442a7d803c3dde97", - "content-hash": "e143e313c42e5ab12790286d00222a12", + "hash": "5b5f0b9363a4bb102abf5aacb3b3d2c4", + "content-hash": "61d202b45a369d069844d9cdaa1fa743", "packages": [ { "name": "alchemy/zippy", @@ -71,16 +71,16 @@ }, { "name": "composer/installers", - "version": "v1.0.25", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "36e5b5843203d7f1cf6ffb0305a97e014387bd8e" + "reference": "a3595c5272a6f247228abb20076ed27321e4aae9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/36e5b5843203d7f1cf6ffb0305a97e014387bd8e", - "reference": "36e5b5843203d7f1cf6ffb0305a97e014387bd8e", + "url": "https://api.github.com/repos/composer/installers/zipball/a3595c5272a6f247228abb20076ed27321e4aae9", + "reference": "a3595c5272a6f247228abb20076ed27321e4aae9", "shasum": "" }, "require": { @@ -127,6 +127,7 @@ "MODX Evo", "Mautic", "OXID", + "RadPHP", "SMF", "Thelia", "WolfCMS", @@ -142,6 +143,7 @@ "dokuwiki", "drupal", "elgg", + "expressionengine", "fuelphp", "grav", "installer", @@ -167,7 +169,7 @@ "zend", "zikula" ], - "time": "2016-04-13 19:46:30" + "time": "2016-07-05 06:18:20" }, { "name": "dflydev/placeholder-resolver", @@ -465,16 +467,16 @@ }, { "name": "drupal/coder", - "version": "8.2.7", + "version": "8.2.8", "source": { "type": "git", "url": "https://github.com/klausi/coder.git", - "reference": "a5b5f6b5769393a016da0d106a3b33f932c73331" + "reference": "6d717e1a5a5dd592ebbeaafad11746849fb52532" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/klausi/coder/zipball/a5b5f6b5769393a016da0d106a3b33f932c73331", - "reference": "a5b5f6b5769393a016da0d106a3b33f932c73331", + "url": "https://api.github.com/repos/klausi/coder/zipball/6d717e1a5a5dd592ebbeaafad11746849fb52532", + "reference": "6d717e1a5a5dd592ebbeaafad11746849fb52532", "shasum": "" }, "require": { @@ -497,7 +499,7 @@ "phpcs", "standards" ], - "time": "2016-03-27 09:53:21" + "time": "2016-07-05 20:48:03" }, { "name": "drupal/console", @@ -629,27 +631,27 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.2.0", + "version": "6.2.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "d094e337976dff9d8e2424e8485872194e768662" + "reference": "3f808fba627f2c5b69e2501217bf31af349c1427" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d094e337976dff9d8e2424e8485872194e768662", - "reference": "d094e337976dff9d8e2424e8485872194e768662", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/3f808fba627f2c5b69e2501217bf31af349c1427", + "reference": "3f808fba627f2c5b69e2501217bf31af349c1427", "shasum": "" }, "require": { - "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.5.0" + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.3.1", + "php": ">=5.5" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "~4.0", - "psr/log": "~1.0" + "phpunit/phpunit": "^4.0", + "psr/log": "^1.0" }, "type": "library", "extra": { @@ -687,7 +689,7 @@ "rest", "web service" ], - "time": "2016-03-21 20:02:09" + "time": "2016-07-15 17:22:37" }, { "name": "guzzlehttp/promises", @@ -742,16 +744,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "31382fef2889136415751badebbd1cb022a4ed72" + "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/31382fef2889136415751badebbd1cb022a4ed72", - "reference": "31382fef2889136415751badebbd1cb022a4ed72", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", + "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", "shasum": "" }, "require": { @@ -767,7 +769,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -796,7 +798,7 @@ "stream", "uri" ], - "time": "2016-04-13 19:56:01" + "time": "2016-06-24 23:00:38" }, { "name": "ircmaxell/password-compat", @@ -1138,22 +1140,22 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.0.2", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "45ada3e3fd09789fbfbd6d65b3f0901f0030dc61" + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/45ada3e3fd09789fbfbd6d65b3f0901f0030dc61", - "reference": "45ada3e3fd09789fbfbd6d65b3f0901f0030dc61", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", "shasum": "" }, "require": { "php": ">=5.5", "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.1.5", + "phpdocumentor/type-resolver": "^0.2.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -1179,20 +1181,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-06-06 06:44:13" + "time": "2016-06-10 09:48:41" }, { "name": "phpdocumentor/type-resolver", - "version": "0.1.8", + "version": "0.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9891754231e55d42f0d16988ffb799af39f31a12" + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9891754231e55d42f0d16988ffb799af39f31a12", - "reference": "9891754231e55d42f0d16988ffb799af39f31a12", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", "shasum": "" }, "require": { @@ -1201,7 +1203,7 @@ }, "require-dev": { "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2" + "phpunit/phpunit": "^5.2||^4.8.24" }, "type": "library", "extra": { @@ -1226,7 +1228,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-03-28 10:02:29" + "time": "2016-06-10 07:14:17" }, { "name": "phpseclib/phpseclib", @@ -1384,16 +1386,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "4.0.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9" + "reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/900370c81280cc0d942ffbc5912d80464eaee7e9", - "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5f3f7e736d6319d5f1fc402aff8b026da26709a3", + "reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3", "shasum": "" }, "require": { @@ -1402,7 +1404,7 @@ "phpunit/php-text-template": "~1.2", "phpunit/php-token-stream": "^1.4.2", "sebastian/code-unit-reverse-lookup": "~1.0", - "sebastian/environment": "^1.3.2", + "sebastian/environment": "^1.3.2 || ^2.0", "sebastian/version": "~1.0|~2.0" }, "require-dev": { @@ -1443,7 +1445,7 @@ "testing", "xunit" ], - "time": "2016-06-03 05:03:56" + "time": "2016-07-26 14:39:29" }, { "name": "phpunit/php-file-iterator", @@ -1628,16 +1630,16 @@ }, { "name": "phpunit/phpunit", - "version": "5.4.2", + "version": "5.5.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f5726a0262e5f74f8e9cf03128798b64160c441d" + "reference": "c7b3e1dcc1d183f26d5ba282881fe65c2cbb5b2b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f5726a0262e5f74f8e9cf03128798b64160c441d", - "reference": "f5726a0262e5f74f8e9cf03128798b64160c441d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c7b3e1dcc1d183f26d5ba282881fe65c2cbb5b2b", + "reference": "c7b3e1dcc1d183f26d5ba282881fe65c2cbb5b2b", "shasum": "" }, "require": { @@ -1649,14 +1651,14 @@ "myclabs/deep-copy": "~1.3", "php": "^5.6 || ^7.0", "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "^4.0", + "phpunit/php-code-coverage": "^4.0.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "^3.2", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", + "sebastian/environment": "^1.3 || ^2.0", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", "sebastian/object-enumerator": "~1.0", @@ -1664,6 +1666,9 @@ "sebastian/version": "~1.0|~2.0", "symfony/yaml": "~2.1|~3.0" }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, "suggest": { "phpunit/php-invoker": "~1.1" }, @@ -1673,7 +1678,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.4.x-dev" + "dev-master": "5.5.x-dev" } }, "autoload": { @@ -1699,20 +1704,20 @@ "testing", "xunit" ], - "time": "2016-06-03 09:59:50" + "time": "2016-08-05 04:49:02" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.2.1", + "version": "3.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "0dc8fd8e87e0366c22b6c25d1f43c4e2e66847b3" + "reference": "b13d0d9426ced06958bd32104653526a6c998a52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/0dc8fd8e87e0366c22b6c25d1f43c4e2e66847b3", - "reference": "0dc8fd8e87e0366c22b6c25d1f43c4e2e66847b3", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52", + "reference": "b13d0d9426ced06958bd32104653526a6c998a52", "shasum": "" }, "require": { @@ -1758,7 +1763,7 @@ "mock", "xunit" ], - "time": "2016-06-04 05:52:19" + "time": "2016-06-12 07:37:26" }, { "name": "platinumpixs/phing-random-string", @@ -1804,16 +1809,16 @@ }, { "name": "psr/http-message", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { @@ -1841,6 +1846,7 @@ } ], "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ "http", "http-message", @@ -1849,7 +1855,7 @@ "request", "response" ], - "time": "2015-05-04 20:22:00" + "time": "2016-08-06 14:39:51" }, { "name": "psr/log", @@ -2102,16 +2108,16 @@ }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -2119,12 +2125,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -2164,7 +2171,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", @@ -2403,16 +2410,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.6.1", + "version": "2.6.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "fb72ed32f8418db5e7770be1653e62e0d6f5dd3d" + "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/fb72ed32f8418db5e7770be1653e62e0d6f5dd3d", - "reference": "fb72ed32f8418db5e7770be1653e62e0d6f5dd3d", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4edb770cb853def6e60c93abb088ad5ac2010c83", + "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83", "shasum": "" }, "require": { @@ -2477,7 +2484,7 @@ "phpcs", "standards" ], - "time": "2016-05-30 22:24:32" + "time": "2016-07-13 23:29:13" }, { "name": "stecman/symfony-console-completion", @@ -2526,16 +2533,16 @@ }, { "name": "symfony/config", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "a2edd59c2163c65747fc3f35d132b5a39266bd05" + "reference": "4275ef5b59f18959df0eee3991e9ca0cc208ffd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/a2edd59c2163c65747fc3f35d132b5a39266bd05", - "reference": "a2edd59c2163c65747fc3f35d132b5a39266bd05", + "url": "https://api.github.com/repos/symfony/config/zipball/4275ef5b59f18959df0eee3991e9ca0cc208ffd4", + "reference": "4275ef5b59f18959df0eee3991e9ca0cc208ffd4", "shasum": "" }, "require": { @@ -2575,20 +2582,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-07-26 08:02:44" }, { "name": "symfony/console", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5ac8bc9aa77bb2edf06af3a1bb6bc1020d23acd3" + "reference": "36e62335caca8a6e909c5c5bac4a8128149911c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5ac8bc9aa77bb2edf06af3a1bb6bc1020d23acd3", - "reference": "5ac8bc9aa77bb2edf06af3a1bb6bc1020d23acd3", + "url": "https://api.github.com/repos/symfony/console/zipball/36e62335caca8a6e909c5c5bac4a8128149911c9", + "reference": "36e62335caca8a6e909c5c5bac4a8128149911c9", "shasum": "" }, "require": { @@ -2635,20 +2642,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-06-06 15:06:25" + "time": "2016-07-30 07:20:35" }, { "name": "symfony/css-selector", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "9a0b2649328297fb6acd0c823789d92efcbd36ad" + "reference": "9da4c615ba303850986e0480cc472bf704cfdb64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/9a0b2649328297fb6acd0c823789d92efcbd36ad", - "reference": "9a0b2649328297fb6acd0c823789d92efcbd36ad", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/9da4c615ba303850986e0480cc472bf704cfdb64", + "reference": "9da4c615ba303850986e0480cc472bf704cfdb64", "shasum": "" }, "require": { @@ -2688,20 +2695,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-06-29 05:31:50" }, { "name": "symfony/debug", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "c7d6d8a599e4609a1abc76351d6234a2997e16ed" + "reference": "f7c5256f43debdabec79146a5db226fd15aedbea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/c7d6d8a599e4609a1abc76351d6234a2997e16ed", - "reference": "c7d6d8a599e4609a1abc76351d6234a2997e16ed", + "url": "https://api.github.com/repos/symfony/debug/zipball/f7c5256f43debdabec79146a5db226fd15aedbea", + "reference": "f7c5256f43debdabec79146a5db226fd15aedbea", "shasum": "" }, "require": { @@ -2745,20 +2752,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-06-06 15:06:25" + "time": "2016-07-30 07:20:35" }, { "name": "symfony/dependency-injection", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "2d05009d890cf1139988ff059b5b2e0eb280ed13" + "reference": "f2b5a00d176f6a201dc430375c0ef37706ea3d12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2d05009d890cf1139988ff059b5b2e0eb280ed13", - "reference": "2d05009d890cf1139988ff059b5b2e0eb280ed13", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f2b5a00d176f6a201dc430375c0ef37706ea3d12", + "reference": "f2b5a00d176f6a201dc430375c0ef37706ea3d12", "shasum": "" }, "require": { @@ -2770,7 +2777,7 @@ "require-dev": { "symfony/config": "~2.2|~3.0.0", "symfony/expression-language": "~2.6|~3.0.0", - "symfony/yaml": "~2.1|~3.0.0" + "symfony/yaml": "~2.3.42|~2.7.14|~2.8.7|~3.0.7" }, "suggest": { "symfony/config": "", @@ -2808,20 +2815,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-07-30 07:20:35" }, { "name": "symfony/dom-crawler", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "f282b08f6bbbc72e7af2e9e0c2f896221053f791" + "reference": "aac03b7ea2a7adff10a3599d614e79e6101230ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/f282b08f6bbbc72e7af2e9e0c2f896221053f791", - "reference": "f282b08f6bbbc72e7af2e9e0c2f896221053f791", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/aac03b7ea2a7adff10a3599d614e79e6101230ab", + "reference": "aac03b7ea2a7adff10a3599d614e79e6101230ab", "shasum": "" }, "require": { @@ -2864,20 +2871,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2016-04-12 18:01:21" + "time": "2016-07-30 07:20:35" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "2a6b8713f8bdb582058cfda463527f195b066110" + "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2a6b8713f8bdb582058cfda463527f195b066110", - "reference": "2a6b8713f8bdb582058cfda463527f195b066110", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/889983a79a043dfda68f38c38b6dba092dd49cd8", + "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8", "shasum": "" }, "require": { @@ -2924,20 +2931,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-07-28 16:56:28" }, { "name": "symfony/filesystem", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "dee379131dceed90a429e951546b33edfe7dccbb" + "reference": "ab4c3f085c8f5a56536845bf985c4cef30bf75fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/dee379131dceed90a429e951546b33edfe7dccbb", - "reference": "dee379131dceed90a429e951546b33edfe7dccbb", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/ab4c3f085c8f5a56536845bf985c4cef30bf75fd", + "reference": "ab4c3f085c8f5a56536845bf985c4cef30bf75fd", "shasum": "" }, "require": { @@ -2973,20 +2980,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-04-12 18:01:21" + "time": "2016-07-20 05:41:28" }, { "name": "symfony/finder", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3ec095fab1800222732ca522a95dce8fa124007b" + "reference": "60804d88691e4a73bbbb3035eb1d9f075c5c2c10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3ec095fab1800222732ca522a95dce8fa124007b", - "reference": "3ec095fab1800222732ca522a95dce8fa124007b", + "url": "https://api.github.com/repos/symfony/finder/zipball/60804d88691e4a73bbbb3035eb1d9f075c5c2c10", + "reference": "60804d88691e4a73bbbb3035eb1d9f075c5c2c10", "shasum": "" }, "require": { @@ -3022,20 +3029,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-07-26 08:02:44" }, { "name": "symfony/http-foundation", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "744dae663ffcfa21d8a111fb63541954199acbb2" + "reference": "f20bea598906c990eebe3c70a63ca5ed18cdbc11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/744dae663ffcfa21d8a111fb63541954199acbb2", - "reference": "744dae663ffcfa21d8a111fb63541954199acbb2", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/f20bea598906c990eebe3c70a63ca5ed18cdbc11", + "reference": "f20bea598906c990eebe3c70a63ca5ed18cdbc11", "shasum": "" }, "require": { @@ -3077,7 +3084,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-07-30 07:20:35" }, { "name": "symfony/polyfill-mbstring", @@ -3254,16 +3261,16 @@ }, { "name": "symfony/process", - "version": "v3.1.0", + "version": "v3.1.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1574f3451b40fa9bbae518ef71d19a56f409cac0" + "reference": "04c2dfaae4ec56a5c677b0c69fac34637d815758" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1574f3451b40fa9bbae518ef71d19a56f409cac0", - "reference": "1574f3451b40fa9bbae518ef71d19a56f409cac0", + "url": "https://api.github.com/repos/symfony/process/zipball/04c2dfaae4ec56a5c677b0c69fac34637d815758", + "reference": "04c2dfaae4ec56a5c677b0c69fac34637d815758", "shasum": "" }, "require": { @@ -3299,20 +3306,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-04-12 19:11:33" + "time": "2016-07-28 11:13:48" }, { "name": "symfony/translation", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "8a1648d2e165ba87c759ba57d7f4c13d95fdf4a1" + "reference": "32b0c824da6df065f43b0c458dc505940e98a7f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/8a1648d2e165ba87c759ba57d7f4c13d95fdf4a1", - "reference": "8a1648d2e165ba87c759ba57d7f4c13d95fdf4a1", + "url": "https://api.github.com/repos/symfony/translation/zipball/32b0c824da6df065f43b0c458dc505940e98a7f1", + "reference": "32b0c824da6df065f43b0c458dc505940e98a7f1", "shasum": "" }, "require": { @@ -3363,20 +3370,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-07-30 07:20:35" }, { "name": "symfony/yaml", - "version": "v2.8.7", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "815fabf3f48c7d1df345a69d1ad1a88f59757b34" + "reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/815fabf3f48c7d1df345a69d1ad1a88f59757b34", - "reference": "815fabf3f48c7d1df345a69d1ad1a88f59757b34", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0ceab136f43ed9d3e97b3eea32a7855dc50c121d", + "reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d", "shasum": "" }, "require": { @@ -3412,7 +3419,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-07-17 09:06:15" }, { "name": "twig/twig", @@ -3531,7 +3538,7 @@ "stability-flags": { "platinumpixs/phing-random-string": 20 }, - "prefer-stable": false, + "prefer-stable": true, "prefer-lowest": false, "platform": [], "platform-dev": [] diff --git a/template/build/README.md b/phing/README.md similarity index 94% rename from template/build/README.md rename to phing/README.md index 68428d039..e3f3b6139 100644 --- a/template/build/README.md +++ b/phing/README.md @@ -8,12 +8,12 @@ This directory should not contain any test files. Those exist in the [/tests](/t A large number of common build tasks are provided via Phing targets. These include tasks for things like code sniffing, executing tests, building dependencies, installing Drupal, etc. -For a full list of available Phing tasks, run `./blt.sh -list` from the project's root directory. +For a full list of available Phing tasks, run `blt -list` from the project's root directory. ### Executing Tasks -* For a full list of the available Phing targets, run `./blt.sh -list` -* To manually test a Phing target, run the following command matching the the following pattern: `./blt.sh `. For example `./blt.sh validate:all` +* For a full list of the available Phing targets, run `blt -list` +* To manually test a Phing target, run the following command matching the the following pattern: `blt `. For example `blt validate:all` * To run Phing directly from the binary, simply run `./bin/phing -f build/phing/build.xml ` ## Continuous Integration diff --git a/template/build/core/phing/build.xml b/phing/build.xml similarity index 64% rename from template/build/core/phing/build.xml rename to phing/build.xml index 27ba83241..70fd2baf0 100644 --- a/template/build/core/phing/build.xml +++ b/phing/build.xml @@ -1,7 +1,7 @@ - + - + @@ -18,43 +18,55 @@ - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + Importing custom Phing file ${import}. + + + + No custom Phing file specified. + + @@ -65,6 +77,8 @@ + Executing command in ${target-hooks.${hook-name}.dir}: + ${target-hooks.${hook-name}.command} diff --git a/template/build/core/phing/build.yml b/phing/build.yml similarity index 84% rename from template/build/core/phing/build.yml rename to phing/build.yml index 749e67abb..4941f91a9 100644 --- a/template/build/core/phing/build.yml +++ b/phing/build.yml @@ -19,7 +19,8 @@ composer: deploy: dir: ${repo.root}/deploy - exclude_file: ${repo.root}/build/core/files/deploy-exclude.txt + exclude_file: ${blt.root}/phing/files/deploy-exclude.txt + gitignore_file: ${blt.root}/phing/files/.gitignore # File and Directory locations. docroot.relative: ${repo.root.relative}/docroot @@ -44,6 +45,12 @@ reports: localDir: ${repo.root}/reports remoteDir: reports +phpcs: + filesets: + - files.php.custom.modules + - files.php.tests + - files.frontend.custom.themes + project: local: uri: ${project.local.protocol}://${project.local.hostname} diff --git a/template/build/core/phing/example.multisite.yml b/phing/example.multisite.yml similarity index 93% rename from template/build/core/phing/example.multisite.yml rename to phing/example.multisite.yml index 8b0bb045c..0c9eee650 100644 --- a/template/build/core/phing/example.multisite.yml +++ b/phing/example.multisite.yml @@ -1,6 +1,6 @@ # Values in this file may override default values set elsewhere. You can pass # configuration from this file to Phing. E.g., -# ./blt.sh tests:behat -propertyfile build/custom/phing/example.multisite.yml +# blt tests:behat -propertyfile build/custom/phing/example.multisite.yml behat: # @see http://docs.behat.org/en/v2.5/guides/6.cli.html#gherkin-filters diff --git a/template/build/core/files/.gitignore b/phing/files/.gitignore similarity index 100% rename from template/build/core/files/.gitignore rename to phing/files/.gitignore diff --git a/template/build/core/files/README.md b/phing/files/README.md similarity index 100% rename from template/build/core/files/README.md rename to phing/files/README.md diff --git a/template/build/core/files/deploy-exclude.txt b/phing/files/deploy-exclude.txt similarity index 100% rename from template/build/core/files/deploy-exclude.txt rename to phing/files/deploy-exclude.txt diff --git a/template/build/core/phing/phingcludes/BehatTask.php b/phing/phingcludes/BehatTask.php similarity index 100% rename from template/build/core/phing/phingcludes/BehatTask.php rename to phing/phingcludes/BehatTask.php diff --git a/template/build/core/phing/phingcludes/DrushTask.php b/phing/phingcludes/DrushTask.php similarity index 100% rename from template/build/core/phing/phingcludes/DrushTask.php rename to phing/phingcludes/DrushTask.php diff --git a/template/build/core/phing/phingcludes/FileInFilesetCondition.php b/phing/phingcludes/FileInFilesetCondition.php similarity index 100% rename from template/build/core/phing/phingcludes/FileInFilesetCondition.php rename to phing/phingcludes/FileInFilesetCondition.php diff --git a/template/build/core/phing/phingcludes/FilterFileListByFileSetTask.php b/phing/phingcludes/FilterFileListByFileSetTask.php similarity index 100% rename from template/build/core/phing/phingcludes/FilterFileListByFileSetTask.php rename to phing/phingcludes/FilterFileListByFileSetTask.php diff --git a/template/build/core/phing/phingcludes/PhpVariableTask.php b/phing/phingcludes/PhpVariableTask.php similarity index 100% rename from template/build/core/phing/phingcludes/PhpVariableTask.php rename to phing/phingcludes/PhpVariableTask.php diff --git a/template/build/core/phing/tasks/acsf.xml b/phing/tasks/acsf.xml similarity index 100% rename from template/build/core/phing/tasks/acsf.xml rename to phing/tasks/acsf.xml diff --git a/phing/tasks/blt.xml b/phing/tasks/blt.xml new file mode 100644 index 000000000..144bd4674 --- /dev/null +++ b/phing/tasks/blt.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + BLT files have been copied to your project directory. + Some of your existing files may have been modified. + + Please customize ${repo.root}/project.yml and then run: + blt configure + + This will replace placeholders with your custom values in the new files created by BLT. + + + + Copying files from BLT's template into your project. + + + + + + + + Some of your customized files may have been modified. + Please review changes with "git diff". + If your composer.json was modified, you need to run "composer update". + Commit changes, or use "git add -p [filename]" to select which changes should be committed to each file. + + + + Merging BLT's composer.json template with your project's composer.json. + This MAY overwrite some existing values. + + + + + If your composer.json was modified, you need to run "composer update". + + + + Merging BLT's project.yml template with your project's project.yml + This WILL NOT overwrite existing values. + + + + + project.yml has been modified. + + + + + Making ${docroot}/sites/default/settings.php writable. + + + Expanding Phing properties in BLT files. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${property.name} + ${${property.name}} + + + + + + + + + + + + + + + diff --git a/template/build/core/phing/tasks/ci.xml b/phing/tasks/ci.xml similarity index 85% rename from template/build/core/phing/tasks/ci.xml rename to phing/tasks/ci.xml index 9d9b8964b..3d79fae73 100644 --- a/template/build/core/phing/tasks/ci.xml +++ b/phing/tasks/ci.xml @@ -18,8 +18,8 @@ - - + + diff --git a/template/build/core/phing/tasks/deploy.xml b/phing/tasks/deploy.xml similarity index 96% rename from template/build/core/phing/tasks/deploy.xml rename to phing/tasks/deploy.xml index b7d8122e2..7519aa5a8 100644 --- a/template/build/core/phing/tasks/deploy.xml +++ b/phing/tasks/deploy.xml @@ -11,7 +11,7 @@ - + @@ -107,7 +107,7 @@ - + diff --git a/template/build/core/phing/tasks/filesets.xml b/phing/tasks/filesets.xml similarity index 100% rename from template/build/core/phing/tasks/filesets.xml rename to phing/tasks/filesets.xml diff --git a/template/build/core/phing/tasks/frontend.xml b/phing/tasks/frontend.xml similarity index 100% rename from template/build/core/phing/tasks/frontend.xml rename to phing/tasks/frontend.xml diff --git a/template/build/core/phing/tasks/local-sync.xml b/phing/tasks/local-sync.xml similarity index 100% rename from template/build/core/phing/tasks/local-sync.xml rename to phing/tasks/local-sync.xml diff --git a/phing/tasks/properties.xml b/phing/tasks/properties.xml new file mode 100644 index 000000000..9de055d98 --- /dev/null +++ b/phing/tasks/properties.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Executing commands against multisite "${multisite.name}" + + + + + diff --git a/template/build/core/phing/tasks/setup.xml b/phing/tasks/setup.xml similarity index 58% rename from template/build/core/phing/tasks/setup.xml rename to phing/tasks/setup.xml index eb4ddb7c7..e26f5a30d 100644 --- a/template/build/core/phing/tasks/setup.xml +++ b/phing/tasks/setup.xml @@ -1,13 +1,14 @@ + depends="setup:build, setup:drupal:install, install-alias"> For a full list of available Phing targets, run: - ./blt.sh -l + blt -l + Attempting to generate tests/behat/local.yml. @@ -25,8 +26,9 @@ - - + + Removing all composer managed dependencies. + @@ -37,14 +39,31 @@ + - + - + Making ${docroot}/sites/default writable. + + + + + + + Generating settings.php from default.settings.php. + + + + Making ${docroot}/sites/default/settings.php writable. + + Ensuring that blt.settings.php is required by settings.php + + + Generating local settings files. @@ -54,27 +73,33 @@ + - + + - + - - - - - + + Expanding Phing variables in ${docroot}/sites/${multisite.name}/local.drushrc.php. + + + + + + + @@ -82,8 +107,9 @@ + depends="setup:drupal:settings, setup:hash-salt, configure"> + Installing Drupal. @@ -95,12 +121,10 @@ "install_configure_form.update_status_module='array(FALSE,FALSE)'" - - - sync - + + Making ${docroot}/sites/default writable. @@ -116,12 +140,31 @@ + + Importing configuration. + + config + + + + + + + + sync + + + + Removing ${repo.root}/.git/hooks, if it exists. + + Symlinking ${repo.root}/scripts/git-hooks to ${repo.root}/.git/hooks. + Making git hooks executable. @@ -130,6 +173,23 @@ + + + Checking for hash salt in ${repo.root}/salt.txt + + + + Writing hash salt to ${repo.root}/salt.txt + + + + + + ${repo.root}/salt.txt already exists. + + + + diff --git a/template/build/core/phing/tasks/tests.xml b/phing/tasks/tests.xml similarity index 94% rename from template/build/core/phing/tasks/tests.xml rename to phing/tasks/tests.xml index cbbc0e85d..06e2f199b 100644 --- a/template/build/core/phing/tasks/tests.xml +++ b/phing/tasks/tests.xml @@ -1,11 +1,13 @@ + + + depends="tests:security-updates, tests:phpunit, tests:behat"/> - + diff --git a/template/build/core/phing/tasks/validate.xml b/phing/tasks/validate.xml similarity index 72% rename from template/build/core/phing/tasks/validate.xml rename to phing/tasks/validate.xml index 7c425e5ce..58ed5ba36 100644 --- a/template/build/core/phing/tasks/validate.xml +++ b/phing/tasks/validate.xml @@ -1,4 +1,7 @@ - + + + + + - - - - - - - - - - - - + - + standard="${phpcs.ruleset}" + showSniffs="false" + showWarnings="true" + haltonerror="true" + haltonwarning="true"> + diff --git a/template/build/core/phing/tasks/vm.xml b/phing/tasks/vm.xml similarity index 88% rename from template/build/core/phing/tasks/vm.xml rename to phing/tasks/vm.xml index 4e57be1ed..50bdcf733 100644 --- a/template/build/core/phing/tasks/vm.xml +++ b/phing/tasks/vm.xml @@ -3,19 +3,19 @@ BLT support for Drupal VM is EXPERIMENTAL. Not all BLT features currently work with Drupal VM. - + - + - + diff --git a/template/scripts/README.md b/scripts/README.md similarity index 100% rename from template/scripts/README.md rename to scripts/README.md diff --git a/template/scripts/blt/alias b/scripts/blt/alias similarity index 76% rename from template/scripts/blt/alias rename to scripts/blt/alias index b9fdc5600..bae4ac926 100644 --- a/template/scripts/blt/alias +++ b/scripts/blt/alias @@ -6,8 +6,8 @@ function blt() { GIT_ROOT="." fi - if [ -f "$GIT_ROOT/blt.sh" ]; then - $GIT_ROOT/blt.sh "$@" + if [ -f "$GIT_ROOT/vendor/bin/blt" ]; then + $GIT_ROOT/vendor/bin/blt "$@" else echo "You must run this command from within a BLT-generated project repository." fi diff --git a/scripts/blt/convert-to-composer.sh b/scripts/blt/convert-to-composer.sh new file mode 100755 index 000000000..d0a3fb8df --- /dev/null +++ b/scripts/blt/convert-to-composer.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +if [ "`basename "/$SHELL"`" = "zsh" ]; then + DETECTED_PROFILE="$HOME/.zshrc" +elif [ -f "$HOME/.bashrc" ]; then + DETECTED_PROFILE="$HOME/.bashrc" +elif [ -f "$HOME/.bash_profile" ]; then + DETECTED_PROFILE="$HOME/.bash_profile" +elif [ -f "$HOME/.profile" ]; then + DETECTED_PROFILE="$HOME/.profile" +fi + +if [ ! -z "$DETECTED_PROFILE" ]; then + if [ "`grep 'function blt' $DETECTED_PROFILE`" ]; then + echo "Alias for blt exists in $DETECTED_PROFILE" + echo "Please remove it and then re-run this script." + exit 1 + fi +fi + +echo "This script will update your project to use a composerized version of BLT." +echo "It will do the following:" +echo "* Add a blt alias to $DETECTED_PROFILE" +echo "* Remove and modify files in your codebase." +echo "* Update your composer dependencies." +echo "" +read -p "Continue? (y/n) " -n 1 -r +echo "" + +if [[ $REPLY =~ ^[Yy]$ ]]; then + # composer require acquia/blt:~8 + + # Move values from custom/build.yml to project.yml. + # @todo Check if this exists and if it exactly matches core value. + if [[ ! -z build/custom/phing/build.yml ]]; then + echo "Moving custom Phing properties to project.yml." + echo "" >> project.yml + cat build/custom/phing/build.yml >> project.yml + fi + + # Move build/custom/files to new locations (e.g., deploy excludes or .gitignores). + echo "Moving custom Phing files from build/custom to blt." + mkdir blt + mv build/custom blt + + + # Remove unneeded files. + echo "Removing deprecated BLT files from project." + rm -rf build blt.sh tests/phpunit/blt + + # Install (new) alias + echo "Installing blt alias" + yes | ./vendor/acquia/blt/blt.sh install-alias + ./vendor/acquia/blt/blt.sh init + ./vendor/acquia/blt/blt.sh configure + composer update + + echo "Update complete. Please do the following:" + echo "" + echo "* Restart your terminal session to register your new blt alias." + echo "* Review your codebase and commit the desired changes." + echo "* Integrate your custom Phing files by adding their file paths to project.yml under the 'imports' key." + +else + exit 1 +fi + diff --git a/template/scripts/blt/install-alias.sh b/scripts/blt/install-alias.sh similarity index 79% rename from template/scripts/blt/install-alias.sh rename to scripts/blt/install-alias.sh index 4ba556574..ddb230570 100755 --- a/template/scripts/blt/install-alias.sh +++ b/scripts/blt/install-alias.sh @@ -12,6 +12,13 @@ fi if [ ! -z "$DETECTED_PROFILE" ]; then if [ "`grep 'function blt' $DETECTED_PROFILE`" ]; then + + if [ "`grep 'GIT_ROOT/blt.sh' $DETECTED_PROFILE`" ]; then + echo "You have an outdated version of the blt alias installed." + echo "Please remove it from $DETECTED_PROFILE and re-run this command." + exit 1 + fi + echo "Alias for blt already exists in $DETECTED_PROFILE" exit fi @@ -29,7 +36,7 @@ if [ ! -z "$DETECTED_PROFILE" ]; then echo "Added alias for blt to $DETECTED_PROFILE" echo "You may now use the 'blt' command from anywhere within a BLT-generated repository." echo "" - echo "Restart your terminal session to use the new command." + echo "Restart your terminal session or run 'source $DETECTED_PROFILE' to use the new command." else echo "Error: Could not modify $DETECTED_PROFILE." fi diff --git a/scripts/blt/rsync-include-if-does-not-exist.txt b/scripts/blt/rsync-include-if-does-not-exist.txt new file mode 100644 index 000000000..75d221a1a --- /dev/null +++ b/scripts/blt/rsync-include-if-does-not-exist.txt @@ -0,0 +1,3 @@ +# These files will be included if they do not yet exist. They will not overwrite +# existing files. +project.yml diff --git a/template/scripts/blt/update-scaffold b/scripts/blt/update-scaffold similarity index 98% rename from template/scripts/blt/update-scaffold rename to scripts/blt/update-scaffold index ed1974635..38e2167c2 100755 --- a/template/scripts/blt/update-scaffold +++ b/scripts/blt/update-scaffold @@ -16,6 +16,7 @@ BLT_DIRS=( "hooks/templates" "readme" "scripts/blt" + "scripts/drupal" "scripts/git-hooks/pre-commit" "scripts/release-notes" "tests/behat/behat.yml" diff --git a/template/scripts/drupal-vm/Vagrantfile b/scripts/drupal-vm/Vagrantfile similarity index 100% rename from template/scripts/drupal-vm/Vagrantfile rename to scripts/drupal-vm/Vagrantfile diff --git a/template/scripts/drupal-vm/config.yml b/scripts/drupal-vm/config.yml similarity index 100% rename from template/scripts/drupal-vm/config.yml rename to scripts/drupal-vm/config.yml diff --git a/template/scripts/drupal-vm/drupal-vm.aliases.drushrc.php b/scripts/drupal-vm/drupal-vm.aliases.drushrc.php similarity index 100% rename from template/scripts/drupal-vm/drupal-vm.aliases.drushrc.php rename to scripts/drupal-vm/drupal-vm.aliases.drushrc.php diff --git a/template/scripts/release-notes/README.md b/scripts/release-notes/README.md similarity index 100% rename from template/scripts/release-notes/README.md rename to scripts/release-notes/README.md diff --git a/template/scripts/release-notes/generate-release-notes.md b/scripts/release-notes/generate-release-notes.md similarity index 100% rename from template/scripts/release-notes/generate-release-notes.md rename to scripts/release-notes/generate-release-notes.md diff --git a/template/scripts/release-notes/generate-release-notes.php b/scripts/release-notes/generate-release-notes.php similarity index 100% rename from template/scripts/release-notes/generate-release-notes.php rename to scripts/release-notes/generate-release-notes.php diff --git a/template/scripts/release-notes/pull-request.example.md b/scripts/release-notes/pull-request.example.md similarity index 100% rename from template/scripts/release-notes/pull-request.example.md rename to scripts/release-notes/pull-request.example.md diff --git a/template/scripts/release-notes/release.example.md b/scripts/release-notes/release.example.md similarity index 100% rename from template/scripts/release-notes/release.example.md rename to scripts/release-notes/release.example.md diff --git a/template/scripts/tugboat/Makefile b/scripts/tugboat/Makefile similarity index 100% rename from template/scripts/tugboat/Makefile rename to scripts/tugboat/Makefile diff --git a/template/scripts/tugboat/README.md b/scripts/tugboat/README.md similarity index 98% rename from template/scripts/tugboat/README.md rename to scripts/tugboat/README.md index 557186fd3..c7b5b098d 100644 --- a/template/scripts/tugboat/README.md +++ b/scripts/tugboat/README.md @@ -3,7 +3,7 @@ To set up this project with Tugboat, run the following commands from the project root: ``` -./blt.sh ci:tugboat:init +blt ci:tugboat:init ``` ## Workflow diff --git a/template/scripts/tugboat/build.sh b/scripts/tugboat/build.sh similarity index 100% rename from template/scripts/tugboat/build.sh rename to scripts/tugboat/build.sh diff --git a/template/scripts/tugboat/init.sh b/scripts/tugboat/init.sh similarity index 100% rename from template/scripts/tugboat/init.sh rename to scripts/tugboat/init.sh diff --git a/template/scripts/tugboat/install-node.sh b/scripts/tugboat/install-node.sh similarity index 100% rename from template/scripts/tugboat/install-node.sh rename to scripts/tugboat/install-node.sh diff --git a/template/scripts/tugboat/tugboat.drushrc.aliases.php b/scripts/tugboat/tugboat.drushrc.aliases.php similarity index 100% rename from template/scripts/tugboat/tugboat.drushrc.aliases.php rename to scripts/tugboat/tugboat.drushrc.aliases.php diff --git a/template/scripts/tugboat/update.sh b/scripts/tugboat/update.sh similarity index 100% rename from template/scripts/tugboat/update.sh rename to scripts/tugboat/update.sh diff --git a/src/Console/Command/ComposerMungeCommand.php b/src/Console/Command/ComposerMungeCommand.php new file mode 100644 index 000000000..d0d8ae3d5 --- /dev/null +++ b/src/Console/Command/ComposerMungeCommand.php @@ -0,0 +1,153 @@ +setName('composer:munge') + ->setDescription('Munge values in two composer.json files') + ->addArgument( + 'file1', + InputArgument::REQUIRED, + 'The first composer.json. Any conflicts will prioritize the value in this file.' + ) + ->addArgument( + 'file2', + InputArgument::REQUIRED, + 'The second composer.json.' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $file1 = $input->getArgument('file1'); + $file2 = $input->getArgument('file2'); + $munged_json = $this->munge($file1, $file2); + + $output->writeln($munged_json); + } + + protected $repoRoot = ''; + + /** + * @param $file1 + * @param $file2 + */ + protected function munge($file1, $file2) { + $default_contents = [ + 'repositories' => [], + ]; + $file1_contents = (array) json_decode(file_get_contents($file1), true) + $default_contents; + $file2_contents = (array) json_decode(file_get_contents($file2), true) + $default_contents; + $output = $this->mergeKeyed($file1_contents, $file2_contents); + $output['repositories'] = $this->mergeRepositories((array) $file1_contents['repositories'], (array) $file2_contents['repositories']); + + $output_json = json_encode($output, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES); + + return $output_json; + } + + /** + * Merges specific keyed arrays and objects in composer.json files. + * + * @param $file1_contents + * @param $file2_contents + * + * @return mixed + */ + protected function mergeKeyed($file1_contents, $file2_contents) { + // Merge keyed arrays objects. + $merge_keys = [ + 'autoload-dev', + 'extra', + 'require', + 'require-dev', + 'scripts', + ]; + $output = $file1_contents; + foreach ($merge_keys as $key) { + if (!array_key_exists($key, $file1_contents)) { + $file1_contents[$key] = []; + } + if (!array_key_exists($key, $file2_contents)) { + $file2_contents[$key] = []; + } + $output[$key] = $this->array_merge_recursive_distinct($file1_contents[$key], $file2_contents[$key]); + } + + return $output; + } + + /** + * Merges the repositories array, which is unkeyed. + * + * @param $file1_contents + * @param $file2_contents + */ + protected function mergeRepositories($file1_repos, $file2_repos) { + $repos = array_merge($file1_repos, $file2_repos); + $repos = array_unique($repos, SORT_REGULAR); + + return $repos; + } + + /** + * array_merge_recursive does indeed merge arrays, but it converts values with duplicate + * keys to arrays rather than overwriting the value in the first array with the duplicate + * value in the second array, as array_merge does. I.e., with array_merge_recursive, + * this happens (documented behavior): + * + * array_merge_recursive(array('key' => 'org value'), array('key' => 'new value')); + * => array('key' => array('org value', 'new value')); + * + * array_merge_recursive_distinct does not change the datatypes of the values in the arrays. + * Matching keys' values in the second array overwrite those in the first array, as is the + * case with array_merge, i.e.: + * + * array_merge_recursive_distinct(array('key' => 'org value'), array('key' => 'new value')); + * => array('key' => array('new value')); + * + * Parameters are passed by reference, though only for performance reasons. They're not + * altered by this function. + * + * Additionally, array_merge_recursive_distinct will not overwrite numerically keyed rows. + * Instead it will append them to the parent array. + * + * @param array $array1 + * @param array $array2 + * @return array + * @author Daniel + * @author Gabriel Sobrinho + * @author Matthew Grasmick + * @see http://php.net/manual/en/function.array-merge-recursive.php#92195 + */ + protected function array_merge_recursive_distinct ( array &$array1, array &$array2 ) + { + $merged = $array1; + + foreach ( $array2 as $key => &$value ) + { + + if ( is_array ( $value ) && isset ( $merged [$key] ) && is_array ( $merged [$key] ) ) + { + $merged [$key] = $this->array_merge_recursive_distinct ( $merged [$key], $value ); + } + else + { + $merged [$key] = $value; + } + } + + return $merged; + } +} diff --git a/src/Console/Command/YamlMungeCommand.php b/src/Console/Command/YamlMungeCommand.php new file mode 100644 index 000000000..3f8fbbf7b --- /dev/null +++ b/src/Console/Command/YamlMungeCommand.php @@ -0,0 +1,66 @@ +setName('yaml:munge') + ->setAliases(['yml:munge']) + ->setDescription('Munge values in two yaml|yml files') + ->addArgument( + 'file1', + InputArgument::REQUIRED, + 'The first yaml or yml. Any conflicts will prioritize the value in this file.' + ) + ->addArgument( + 'file2', + InputArgument::REQUIRED, + 'The second yaml or yml.' + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $file1 = $input->getArgument('file1'); + $file2 = $input->getArgument('file2'); + $munged_contents = $this->munge($file1, $file2); + $output->writeln($munged_contents); + } + + protected $repoRoot = ''; + + /** + * @param $file1 + * @param $file2 + */ + protected function munge($file1, $file2) { + $file1_contents = $this->parseFile($file1); + $file2_contents = $this->parseFile($file2); + + $munged_contents = array_replace_recursive((array) $file1_contents, (array) $file2_contents); + + return Yaml::dump($munged_contents, 3); + } + + protected function parseFile($file) { + try { + $value = Yaml::parse(file_get_contents($file)); + } catch (ParseException $e) { + printf("Unable to parse the YAML string: %s", $e->getMessage()); + } + + return $value; + } +} diff --git a/template/.travis.yml b/template/.travis.yml index 4393baa0d..a0019ea64 100644 --- a/template/.travis.yml +++ b/template/.travis.yml @@ -28,8 +28,15 @@ notifications: # - slack: ':#[channel]' before_install: + # Enable aliases for non-interactive shell. + - shopt -s expand_aliases - composer selfupdate + # Disable xdebug. - phpenv config-rm xdebug.ini + # Enable $_ENV variables in PHP. + - echo 'variables_order = "EGPCS"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini + # Ensure that always_populate_raw_post_data PHP setting: Not set to -1 does not happen. + - echo "always_populate_raw_post_data = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - git config --global user.name "Travis-CI" - git config --global user.email "noreply@travis-ci.org" - mysql -e 'CREATE DATABASE drupal;' @@ -38,10 +45,12 @@ install: # Load composer dependencies. - composer validate --no-check-all --ansi - composer install - - export PATH=$PATH:$TRAVIS_BUILD_DIR/vendor/bin + - export PATH=$TRAVIS_BUILD_DIR/vendor/bin:$PATH # Install proper version of node for front end tasks. - nvm install 4.4.1 - nvm use 4.4.1 + # Initialize drupal console default configuration. + - drupal init before_script: # Clear drush release history cache, to pick up new releases. @@ -52,12 +61,12 @@ before_script: - drupal yaml:update:value project.yml project.local.hostname '127.0.0.1:8888' script: - - ./blt.sh -Dbehat.run-server=true -Dcreate_alias=false -Dbehat.launch-phantom=true ci:build:validate:test + - blt -Dbehat.run-server=true -Dcreate_alias=false -Dbehat.launch-phantom=true ci:build:validate:test # Uncomment to enable automatic deployments following merges. deploy: # provider: script - # script: ./blt.sh deploy -Ddeploy.commitMsg="Automated commit by Travis CI for Build ${TRAVIS_BUILD_ID}" -Ddeploy.branch="${TRAVIS_BRANCH}-build" + # script: blt deploy -Ddeploy.commitMsg="Automated commit by Travis CI for Build ${TRAVIS_BUILD_ID}" -Ddeploy.branch="${TRAVIS_BRANCH}-build" # skip_cleanup: true # on: # branch: master diff --git a/template/blt.sh b/template/blt.sh deleted file mode 100755 index 787bd60c8..000000000 --- a/template/blt.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -# Test if Composer is installed -composer -v > /dev/null 2>&1 -COMPOSER_IS_INSTALLED=$? - -# True, if composer is not installed -if [[ $COMPOSER_IS_INSTALLED -ne 0 ]]; then - echo "Composer is required but not found." - echo "Please install composer from the composer website:" - echo " https://getcomposer.org/doc/00-intro.md" - exit 1 -fi - -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -if [ ! -f ${DIR}/vendor/bin/phing ]; then - echo "Phing was not found in this project's bin directory." - echo "Attempting to run composer install. This takes a few minutes." - composer install -fi - -# This script simply passes all arguments to Phing. -${DIR}/vendor/bin/phing -f ${DIR}/build/custom/phing/build.xml "$@" diff --git a/template/build/core/README.md b/template/build/core/README.md deleted file mode 100644 index 387815257..000000000 --- a/template/build/core/README.md +++ /dev/null @@ -1,8 +0,0 @@ -This directory contains the core tasks that ship with BLT. No files in this -directory should be customized. You may pull in upstream changes with: - - ./blt.sh blt:update - -Please note that pulling in upstream changes in this way may break your project. -In some cases, you will need to change aspects of your project configuration or -modify your project's directory structure. diff --git a/template/build/core/phing/tasks/blt.xml b/template/build/core/phing/tasks/blt.xml deleted file mode 100644 index 72f82e246..000000000 --- a/template/build/core/phing/tasks/blt.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - You may be prompted to trust GitHub's SSL certification and to enter your GitHub password. - If you have two factor authentication enabled for GitHub, you must use an access token in lieu of a password. - GitHub access tokens can be generated here: https://github.com/settings/tokens - - - - - - - - - - - - - - - diff --git a/template/build/core/phing/tasks/properties.xml b/template/build/core/phing/tasks/properties.xml deleted file mode 100644 index 174f1a18e..000000000 --- a/template/build/core/phing/tasks/properties.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Executing commands against multisite "${multisite.name}" - Using settings file ${local.settings.file} - - - - - - - - diff --git a/template/build/custom/README.md b/template/build/custom/README.md deleted file mode 100644 index 95e536d3f..000000000 --- a/template/build/custom/README.md +++ /dev/null @@ -1,3 +0,0 @@ -This directory should contain custom build tasks and properties that extend or override those defined in `build/core/phing`. - -To see instructions for pulling in upstream updates to core tasks, see `build/core/README.md`. diff --git a/template/build/custom/files/README.md b/template/build/custom/files/README.md deleted file mode 100644 index 4dce092b5..000000000 --- a/template/build/custom/files/README.md +++ /dev/null @@ -1 +0,0 @@ -This directory contains static files that are used during the build process. diff --git a/template/build/custom/phing/build.xml b/template/build/custom/phing/build.xml deleted file mode 100644 index 9236d046c..000000000 --- a/template/build/custom/phing/build.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/template/build/custom/phing/build.yml b/template/build/custom/phing/build.yml deleted file mode 100644 index 407dcd7db..000000000 --- a/template/build/custom/phing/build.yml +++ /dev/null @@ -1,3 +0,0 @@ -# Define custom property values here. You can override values defined in -# ../../core/phing/build.yml. -example.property: 'example value' diff --git a/template/build/custom/phing/tasks/README.md b/template/build/custom/phing/tasks/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/template/composer.json b/template/composer.json index f55348be8..faefb2cae 100644 --- a/template/composer.json +++ b/template/composer.json @@ -1,17 +1,19 @@ { - "name": "${project.vendor_name}/${project.machine_name}", "license": "proprietary", "type": "project", - "description": "${project.description}", "repositories": [ { "type": "composer", "url": "https://packagist.drupal-composer.org" + }, + { + "type": "git", + "url": "https://github.com/FloeDesignTechnologies/composer-patches" } ], "require": { "composer/installers": "^1.0.20", - "cweagans/composer-patches": "~1.0", + "cweagans/composer-patches": "dev-master as 1.5.0", "drupal/acquia_connector": "8.1.*", "drupal/acsf": "~8.1", "drupal/core": "~8", @@ -19,9 +21,8 @@ "drupal/memcache" : "8.*", "drupal/security_review" : "8.*", "roave/security-advisories": "dev-master", - "drupal-composer/drupal-scaffold": "^2.0.1", "drupal-composer/drupal-security-advisories": "8.0.x-dev", - "drupal/lightning": "~8.1.0" + "drupal/lightning": "~8.1" }, "require-dev": { "behat/behat": "3.0.*", @@ -33,7 +34,7 @@ "drush/drush": "^9.0", "drupal/drupal-extension": "~3.0", "drupal/coder": "~8.2", - "phpunit/phpunit": "4.6.*", + "phpunit/phpunit": "~5.4", "squizlabs/php_codesniffer": "2.*", "phing/phing": "dev-master#0ef30e55bb5871cb38903cc0ee9d76074118a22c", "jakoch/phantomjs-installer": "1.9.8", @@ -44,8 +45,6 @@ "Drupal\\Tests\\PHPUnit\\": "tests/phpunit/src/" } }, - "minimum-stability": "dev", - "prefer-stable": true, "extra": { "installer-paths": { "docroot/core": ["type:drupal-core"], @@ -62,12 +61,13 @@ }, "scripts": { "install-phantomjs": "PhantomInstaller\\Installer::installPhantomJS", - "drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold", "post-install-cmd": [ "PhantomInstaller\\Installer::installPhantomJS" ], "post-update-cmd": [ "PhantomInstaller\\Installer::installPhantomJS" ] - } + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_account_menu.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_account_menu.yml deleted file mode 100644 index 93cadc8ba..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_account_menu.yml +++ /dev/null @@ -1,23 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - system.menu.account - module: - - system - theme: - - bartik -id: bartik_account_menu -theme: bartik -region: secondary_menu -weight: 0 -provider: null -plugin: 'system_menu_block:account' -settings: - id: 'system_menu_block:account' - label: 'User account menu' - provider: system - label_display: '0' - level: 1 - depth: 1 -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_branding.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_branding.yml deleted file mode 100644 index 6cf70a77c..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_branding.yml +++ /dev/null @@ -1,22 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - bartik -id: bartik_branding -theme: bartik -region: header -weight: 0 -provider: null -plugin: system_branding_block -settings: - id: system_branding_block - label: 'Site branding' - provider: system - label_display: '0' - use_site_logo: true - use_site_name: true - use_site_slogan: true -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_breadcrumbs.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_breadcrumbs.yml deleted file mode 100644 index bce3d01ba..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_breadcrumbs.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - bartik -id: bartik_breadcrumbs -theme: bartik -region: breadcrumb -weight: 0 -provider: null -plugin: system_breadcrumb_block -settings: - id: system_breadcrumb_block - label: Breadcrumbs - provider: system - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_content.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_content.yml deleted file mode 100644 index b1e0c801b..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_content.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - bartik -id: bartik_content -theme: bartik -region: content -weight: 0 -provider: null -plugin: system_main_block -settings: - id: system_main_block - label: 'Main page content' - provider: system - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_footer.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_footer.yml deleted file mode 100644 index a8623d11e..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_footer.yml +++ /dev/null @@ -1,23 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - system.menu.footer - module: - - system - theme: - - bartik -id: bartik_footer -theme: bartik -region: footer_fifth -weight: 0 -provider: null -plugin: 'system_menu_block:footer' -settings: - id: 'system_menu_block:footer' - label: 'Footer menu' - provider: system - label_display: '0' - level: 1 - depth: 0 -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_help.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_help.yml deleted file mode 100644 index cf344d360..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_help.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - help - theme: - - bartik -id: bartik_help -theme: bartik -region: content -weight: -30 -provider: null -plugin: help_block -settings: - id: help_block - label: Help - provider: help - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_local_actions.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_local_actions.yml deleted file mode 100644 index a58496db1..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_local_actions.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - bartik -id: bartik_local_actions -theme: bartik -region: content -weight: -20 -provider: null -plugin: local_actions_block -settings: - id: local_actions_block - label: 'Primary admin actions' - provider: core - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_local_tasks.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_local_tasks.yml deleted file mode 100644 index 6b7c5d3a4..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_local_tasks.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - bartik -id: bartik_local_tasks -theme: bartik -region: content -weight: -40 -provider: null -plugin: local_tasks_block -settings: - id: local_tasks_block - label: Tabs - provider: core - label_display: '0' - primary: true - secondary: true -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_main_menu.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_main_menu.yml deleted file mode 100644 index dc7ebecb0..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_main_menu.yml +++ /dev/null @@ -1,23 +0,0 @@ -langcode: en -status: true -dependencies: - config: - - system.menu.main - module: - - system - theme: - - bartik -id: bartik_main_menu -theme: bartik -region: primary_menu -weight: 0 -provider: null -plugin: 'system_menu_block:main' -settings: - id: 'system_menu_block:main' - label: 'Main navigation' - provider: system - label_display: '0' - level: 1 - depth: 1 -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_messages.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_messages.yml deleted file mode 100644 index e6bb7d766..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_messages.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - bartik -id: bartik_messages -theme: bartik -region: highlighted -weight: 0 -provider: null -plugin: system_messages_block -settings: - id: system_messages_block - label: 'Status messages' - provider: system - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_page_title.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_page_title.yml deleted file mode 100644 index 21cfb2f0e..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_page_title.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - bartik -id: bartik_page_title -theme: bartik -region: content -weight: -50 -provider: null -plugin: page_title_block -settings: - id: page_title_block - label: 'Page title' - provider: core - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_powered.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_powered.yml deleted file mode 100644 index bb74cc80d..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.bartik_powered.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - bartik -id: bartik_powered -theme: bartik -region: footer_fifth -weight: 10 -provider: null -plugin: system_powered_by_block -settings: - id: system_powered_by_block - label: 'Powered by Drupal' - provider: system - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_breadcrumbs.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.seven_breadcrumbs.yml deleted file mode 100644 index edbdfbd12..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_breadcrumbs.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - seven -id: seven_breadcrumbs -theme: seven -region: breadcrumb -weight: 0 -provider: null -plugin: system_breadcrumb_block -settings: - id: system_breadcrumb_block - label: Breadcrumbs - provider: system - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_content.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.seven_content.yml deleted file mode 100644 index d92214c67..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_content.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - seven -id: seven_content -theme: seven -region: content -weight: 0 -provider: null -plugin: system_main_block -settings: - id: system_main_block - label: 'Main page content' - provider: system - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_help.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.seven_help.yml deleted file mode 100644 index 9a4e2180f..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_help.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - help - theme: - - seven -id: seven_help -theme: seven -region: help -weight: 0 -provider: null -plugin: help_block -settings: - id: help_block - label: Help - provider: help - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_local_actions.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.seven_local_actions.yml deleted file mode 100644 index 61cdb177c..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_local_actions.yml +++ /dev/null @@ -1,17 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - seven -id: seven_local_actions -theme: seven -region: content -weight: -10 -provider: null -plugin: local_actions_block -settings: - id: local_actions_block - label: 'Primary admin actions' - provider: core - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_login.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.seven_login.yml deleted file mode 100644 index 110e8fd80..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_login.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - user - theme: - - seven -id: seven_login -theme: seven -region: content -weight: 10 -provider: null -plugin: user_login_block -settings: - id: user_login_block - label: 'User login' - provider: user - label_display: visible -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_messages.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.seven_messages.yml deleted file mode 100644 index f7b6038b2..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_messages.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - system - theme: - - seven -id: seven_messages -theme: seven -region: highlighted -weight: 0 -provider: null -plugin: system_messages_block -settings: - id: system_messages_block - label: 'Status messages' - provider: system - label_display: '0' -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_primary_local_tasks.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.seven_primary_local_tasks.yml deleted file mode 100644 index d0017c2c8..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_primary_local_tasks.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - seven -id: seven_primary_local_tasks -theme: seven -region: header -weight: 0 -provider: null -plugin: local_tasks_block -settings: - id: local_tasks_block - label: 'Primary tabs' - provider: core - label_display: '0' - primary: true - secondary: false -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_secondary_local_tasks.yml b/template/docroot/profiles/custom/minimal/config/install/block.block.seven_secondary_local_tasks.yml deleted file mode 100644 index 33391991c..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/block.block.seven_secondary_local_tasks.yml +++ /dev/null @@ -1,19 +0,0 @@ -langcode: en -status: true -dependencies: - theme: - - seven -id: seven_secondary_local_tasks -theme: seven -region: pre_content -weight: 0 -provider: null -plugin: local_tasks_block -settings: - id: local_tasks_block - label: 'Secondary tabs' - provider: core - label_display: '0' - primary: false - secondary: true -visibility: { } diff --git a/template/docroot/profiles/custom/minimal/config/install/system.theme.yml b/template/docroot/profiles/custom/minimal/config/install/system.theme.yml deleted file mode 100644 index a7caec5a7..000000000 --- a/template/docroot/profiles/custom/minimal/config/install/system.theme.yml +++ /dev/null @@ -1,2 +0,0 @@ -admin: seven -default: bartik \ No newline at end of file diff --git a/template/docroot/profiles/custom/minimal/minimal.info.yml b/template/docroot/profiles/custom/minimal/minimal.info.yml deleted file mode 100644 index c94f21f3d..000000000 --- a/template/docroot/profiles/custom/minimal/minimal.info.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: ${project.human_name} -type: profile -description: 'Build a custom site without pre-configured functionality.' -core: 8.x -dependencies: - - node - - block - - dblog - - page_cache - - dynamic_page_cache - - help -themes: - - bartik - - seven diff --git a/template/docroot/profiles/custom/minimal/minimal.install b/template/docroot/profiles/custom/minimal/minimal.install deleted file mode 100644 index aa79a01fd..000000000 --- a/template/docroot/profiles/custom/minimal/minimal.install +++ /dev/null @@ -1,20 +0,0 @@ -getEditable('system.theme.global')->set('features.node_user_picture', FALSE)->save(TRUE); - - // Allow visitor account creation, but with administrative approval. - \Drupal::configFactory()->getEditable('user.settings')->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save(TRUE); -} diff --git a/template/docroot/sites/default/settings.php b/template/docroot/sites/default/settings.php index 2504c302d..ea8dbb6e1 100755 --- a/template/docroot/sites/default/settings.php +++ b/template/docroot/sites/default/settings.php @@ -285,7 +285,7 @@ * $settings['hash_salt'] = file_get_contents('/home/example/salt.txt'); * @endcode */ -$settings['hash_salt'] = '${project.hash_salt}'; +$settings['hash_salt'] = file_get_contents(__DIR__ . '/../../../salt.txt'); /** * Deployment identifier. @@ -699,49 +699,5 @@ * example.org, with all subdomains included. */ -// Include custom settings (caching, logging, etc...). -require DRUPAL_ROOT . '/sites/default/settings/includes.settings.php'; - -/** - * Acquia Cloud settings. - */ -if ($is_ah_env && file_exists('/var/www/site-php')) { - require "/var/www/site-php/{$_ENV['AH_SITE_GROUP']}/{$_ENV['AH_SITE_GROUP']}-settings.inc"; - - // Store API Keys and things outside of version control. - // @see settings/sample-secrets.settings.php for sample code. - $secrets_file = sprintf('/mnt/gfs/%s.%s/secrets.settings.php', $_ENV['AH_SITE_GROUP'], $_ENV['AH_SITE_ENVIRONMENT']); - if (file_exists($secrets_file)) { - require $secrets_file; - } -} - -/** - * Load local development override configuration, if available. - * - * Use local.settings.php to override variables on secondary (staging, - * development, etc) installations of this site. Typically used to disable - * caching, JavaScript/CSS compression, re-routing of outgoing emails, and - * other things that should not happen on development and testing sites. - * - * Keep this code block at the end of this file to take full effect. - */ -if ($is_local_env) { - // Load Dev Desktop settings. - if (isset($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR']) && file_exists($_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/loc_${project.machine_name}_dd.inc')) { - require $_SERVER['DEVDESKTOP_DRUPAL_SETTINGS_DIR'] . '/loc_${project.machine_name}_dd.inc'; - } - // Load local machine settings. - elseif (file_exists(DRUPAL_ROOT . '/sites/default/settings/local.settings.php')) { - require DRUPAL_ROOT . '/sites/default/settings/local.settings.php'; - } - - // Load Travis CI settings. - if (getenv('TRAVIS') && file_exists(DRUPAL_ROOT . '/sites/default/settings/travis.settings.php')) { - require DRUPAL_ROOT . '/sites/default/settings/travis.settings.php'; - } - // Load Tugboat settings. - elseif (getenv('TUGBOAT_URL') && file_exists(DRUPAL_ROOT . '/sites/default/settings/tugboat.settings.php')) { - require DRUPAL_ROOT . '/sites/default/settings/tugboat.settings.php'; - } -} +// Include BLT configuration. +require DRUPAL_ROOT . '/sites/default/settings/blt.settings.php'; diff --git a/template/docroot/sites/default/settings/base.settings.php b/template/docroot/sites/default/settings/base.settings.php index 9a4a35d1a..045cd29e7 100755 --- a/template/docroot/sites/default/settings/base.settings.php +++ b/template/docroot/sites/default/settings/base.settings.php @@ -47,3 +47,6 @@ * } * } **/ + +// Prevent APCu memory exhaustion. +$settings['container_yamls'][] = __DIR__ . '/apcu_fix.yml'; diff --git a/template/docroot/sites/default/settings/blt.settings.php b/template/docroot/sites/default/settings/blt.settings.php new file mode 100644 index 000000000..7094c3ccf --- /dev/null +++ b/template/docroot/sites/default/settings/blt.settings.php @@ -0,0 +1,55 @@ +Using Acquia Dev Desktop for BLT-generated projects @@ -68,7 +68,7 @@ In order to use a custom version of Drush (required by BLT) with Dev Desktop, yo ``` export PATH="/Applications/DevDesktop/mysql/bin:$PATH" - export DEVDESKTOP_DRUPAL_SETTINGS_DIR="$HOME/.acquia/DevDesktop/DrupalSettings" + export DEVDESKTOP_DRUPAL_SETTINGS_DIR="~/.acquia/DevDesktop/DrupalSettings" ``` 1. Ensure that Dev Desktop's PHP binary is being used on the CLI. You can check this via `which php`. diff --git a/template/readme/onboarding.md b/template/readme/onboarding.md index 9de5e7a2e..fe30449d7 100644 --- a/template/readme/onboarding.md +++ b/template/readme/onboarding.md @@ -51,17 +51,17 @@ If you need to make requests via a proxy server, please [configure git to use a 1. Checkout the `develop` branch. `git checkout develop` 1. Run `composer install` (you must already have Composer installed). -1. Run `./blt.sh setup:drupal:settings` This will generate +1. Run `blt setup:drupal:settings` This will generate `docroot/sites/default/settings/local.settings.php` and `docroot/sites/default/local.drushrc.php`. Update these with your local database credentials and your local site URL. -1. Run `./blt.sh local:setup`. This will build all project dependencies and install +1. Run `blt local:setup`. This will build all project dependencies and install drupal. 1. Create and edit your local drush alias file. Copy `drush/site-aliases/example.local.aliases.drushrc.php` to `drush/site-aliases/local.aliases.drushrc.php`. Edit the new alias file with your local path. -After this initial setup, you should only need to run `./blt.sh setup:build` when composer.json is updated, and `./blt.sh local:drupal:install` when you need to reinstall the site. +After this initial setup, you should only need to run `blt setup:build` when composer.json is updated, and `blt local:drupal:install` when you need to reinstall the site. -For a full list of available project tasks, run `./blt.sh -l`. See [Project Tasks](project-tasks.md) for more information. +For a full list of available project tasks, run `blt -l`. See [Project Tasks](project-tasks.md) for more information. ### Local Git Configuration diff --git a/template/readme/project-tasks.md b/template/readme/project-tasks.md index cc25d6ab1..0d16ca036 100644 --- a/template/readme/project-tasks.md +++ b/template/readme/project-tasks.md @@ -13,11 +13,11 @@ Pre-requisites to installation: -1. Ensure that `docroot/sites/default/settings/local.settings.php` exists by executing `./blt.sh setup:drupal:settings`. +1. Ensure that `docroot/sites/default/settings/local.settings.php` exists by executing `blt setup:drupal:settings`. 1. Verify that correct local database credentials are set in `local.settings.php`. -1. Ensure that project dependencies have already been built via `./blt.sh setup:build` +1. Ensure that project dependencies have already been built via `blt setup:build` -To re-install Drupal, execute: `./blt.sh setup:drupal:install`. Note that this will drop the existing database tables and install Drupal from scratch! +To re-install Drupal, execute: `blt setup:drupal:install`. Note that this will drop the existing database tables and install Drupal from scratch! ## Update dependencies (core, profile, module, theme, libraries) @@ -42,18 +42,13 @@ Note that Composer versioning is not identical to drupal.org versioning. See: ### Drupal core -Drupal core files can be grouped into two categories: those that are within the `docroot/core` directory, and those that are directly within the `docroot` directory (scaffold files). - -Scaffold files are automatically updated via the `drupal-composer/drupal-scaffold library`, which hooks into the `composer update` and `composer install` commands. If you would like to exclude any scaffold files from automated updates (e.g., .htaccess or robots.txt), see the [Drupal Scaffold configuration documentation](https://github.com/drupal-composer/drupal-scaffold#configuration). All other core files are updated in normal composer fashion. - -To update all drupal core files (scaffold and non-scaffold): - To update drupal core: 1. Update the entry for `drupal/core` in the root composer.json. -1. Run `composer update`. -1. Use git to review changes to committed files. E.g., changes to .htaccess, robots.txt, etc. -1. Add and commit desired changes. +2. Run `composer update`. +3. Run `./scripts/drupal/update-scaffold`. This will update the core files not included in `drupal/core`. +4. Use git to review changes to committed files. E.g., changes to .htaccess, robots.txt, etc. +5. Add and commit desired changes. ## Patch a project @@ -70,7 +65,7 @@ Please see [tests/README.md](../tests/README.md) for information on running test To execute PHP codesniffer and PHP lint against the project codebase, run: ``` -./blt.sh validate:all +blt validate:all ``` ## Build front end assets @@ -100,7 +95,7 @@ target-hooks: This command will be executed when dependencies are built in a local or CI environment, and when a deployment artifact is generated. You may execute the command directly by calling the `frontend:build` target: ``` -./blt.sh frontend:build +blt frontend:build ``` ## Updating you local environment @@ -112,19 +107,19 @@ The project is configured to update the local environment with a local drush ali This all in one command will make sure your local is in sync with the remote site. ``` -./blt.sh local:refresh +blt local:refresh ``` ### Sync: Copy the database from the remote site ``` -./blt.sh local:sync +blt local:sync ``` ### Update: Run update tasks locally ``` -./blt.sh local:update +blt local:update ``` These tasks can be seen in `build/core/phing/tasks/local-sync.xml`. An additional script can be added at `/hooks/dev/post-db-copy/dev-mode.sh` which would run at the end of this task. diff --git a/template/readme/release-process.md b/template/readme/release-process.md index dd2c0d1e1..490806b9c 100644 --- a/template/readme/release-process.md +++ b/template/readme/release-process.md @@ -25,7 +25,7 @@ See [Create and deploy the build artifact](deploy.md#build-artifact) in [deploy. Each release should be accompanied by a set of release notes, which can be easily generated using the [Release Notes Script](../scripts/release-notes/README.md). -This script will automatically aggregate all of the descriptions from Pull Requests since a specified date. The generated text aggregate can then be copied and pasted into release notes on GitHub. +This script will automatically aggregate all of the descriptions from Pull Requests since a specified date. The generated tet aggregate can then be copied and pasted into release notes on GitHub. ## Deploying tag and executing updates diff --git a/template/readme/repo-architecture.md b/template/readme/repo-architecture.md index 744ba748f..19bf07c45 100644 --- a/template/readme/repo-architecture.md +++ b/template/readme/repo-architecture.md @@ -36,7 +36,7 @@ The following is an overview of the purpose of each top level directory in the p ## Dependency Management -All project and Drupal (module, themes, libraries) dependencies are managed via Composer. The management strategy is based on [The Drupal Project](https://github.com/drupal-composer/drupal-project). +All project and Drupal (module, themes, libraries) dependencies are managed via Composer. The management strategy is based on [The Drupal Project](https://github.com/drupal-composer/drupal-project). Modules, themes, and other contributed drupal projects can be added as dependencies in the root composer.json file. diff --git a/template/tests/README.md b/template/tests/README.md index 5ea59bb97..409c3572c 100644 --- a/template/tests/README.md +++ b/template/tests/README.md @@ -71,9 +71,9 @@ Before attempting to execute any tests, verify that composer dependencies are bu Each testing type can be either executed directly, or via a corresponding Phing target. Phing will execute the tests with default values defined in your project's yaml configuration files (project.yml). Examples: -* `./blt.sh tests:all` -* `./blt.sh tests:behat` -* `./blt.sh tests:phpunit` +* `blt tests:all` +* `blt tests:behat` +* `blt tests:phpunit` To execute the tests directly (without Phing) see the following examples: diff --git a/template/tests/behat/example.local.yml b/template/tests/behat/example.local.yml index 7c3756964..87aae0422 100644 --- a/template/tests/behat/example.local.yml +++ b/template/tests/behat/example.local.yml @@ -1,5 +1,5 @@ # To generate a local.yml file using this the example template, execute: -# `./blt.sh setup:behat` from the project root. +# `blt setup:behat` from the project root. imports: - behat.yml diff --git a/template/tests/phpunit/Bolt/DrushTest.php b/template/tests/phpunit/Bolt/DrushTest.php index 32136a04c..ff1d6b86f 100644 --- a/template/tests/phpunit/Bolt/DrushTest.php +++ b/template/tests/phpunit/Bolt/DrushTest.php @@ -21,6 +21,7 @@ public function testDrushConfig() { // Test that drush can be run from the following directories. $dirs = array( + $this->projectDirectory, $this->projectDirectory . '/docroot', $this->projectDirectory . '/docroot/sites/default', ); diff --git a/template/tests/phpunit/Bolt/GitTest.php b/template/tests/phpunit/Bolt/GitTest.php index bbd80a1b2..543d74bd6 100644 --- a/template/tests/phpunit/Bolt/GitTest.php +++ b/template/tests/phpunit/Bolt/GitTest.php @@ -66,6 +66,7 @@ public function testGitPreCommitHook() { // Commits must be executed inside of new project directory. chdir($this->projectDirectory); $prefix = $this->config['project']['prefix']; + // @todo Run this script without actual commit. $command = "git commit --amend -m '$prefix-123: This is a good commit.' 2>&1"; $output = shell_exec($command); $this->assertNotContains('PHP Code Sniffer was not found', $output); diff --git a/tests/phpunit/BltTest.php b/tests/phpunit/BltTest.php index fbd6f5b9c..b07d6920f 100644 --- a/tests/phpunit/BltTest.php +++ b/tests/phpunit/BltTest.php @@ -16,10 +16,9 @@ class BltTest extends \PHPUnit_Framework_TestCase { * Class constructor. */ public function __construct() { - $this->projectDirectory = realpath(dirname(__FILE__) . '/../../'); - $this->config = Yaml::parse(file_get_contents("{$this->projectDirectory}/project.yml")); - $this->new_project_dir = dirname($this->projectDirectory) . '/' . $this->config['project']['machine_name']; + $this->newProjectDir = dirname($this->projectDirectory) . '/blt-project'; + $this->config = Yaml::parse(file_get_contents("{$this->newProjectDir}/project.yml")); } /** @@ -27,35 +26,23 @@ public function __construct() { */ public function testBltCreate() { - $this->assertFileExists($this->new_project_dir); - $this->assertFileNotExists($this->new_project_dir . '/install'); - $this->assertFileNotExists($this->new_project_dir . '/tests/phpunit/BltTest.php'); - $this->assertFileExists($this->new_project_dir . '/vendor'); + $this->assertFileExists($this->newProjectDir); + $this->assertFileNotExists($this->newProjectDir . '/install'); + $this->assertFileNotExists($this->newProjectDir . '/tests/phpunit/BltTest.php'); + $this->assertFileExists($this->newProjectDir . '/vendor'); $this->assertNotContains( 'pt:self-test', - file_get_contents($this->new_project_dir . '/.travis.yml') + file_get_contents($this->newProjectDir . '/.travis.yml') ); - $this->assertFileNotExists($this->new_project_dir . '/build/tasks/blt.xml'); + $this->assertFileNotExists($this->newProjectDir . '/build/tasks/blt.xml'); $this->assertNotContains( '${project.machine_name}', - file_get_contents($this->new_project_dir . '/docroot/sites/default/settings.php') + file_get_contents($this->newProjectDir . '/docroot/sites/default/settings.php') ); $this->assertNotContains( '${project.human_name}', - file_get_contents($this->new_project_dir . '/readme/architecture.md') + file_get_contents($this->newProjectDir . '/readme/architecture.md') ); - $profile_dir = $this->new_project_dir . '/docroot/profiles/contrib/' . - $this->config['project']['profile']['name']; - - // Test new installation profile. - if (!$this->config['project']['profile']['contrib']) { - $this->assertFileExists($profile_dir . '/' . $this->config['project']['profile']['name'] . '.info.yml'); - $this->assertFileExists($profile_dir . '/' . $this->config['project']['profile']['name'] . '.install'); - $this->assertNotContains( - '${project.profile.name}', - file_get_contents($profile_dir . '/' . $this->config['project']['profile']['name'] . '.install') - ); - } } } diff --git a/tests/phpunit/DeployTest.php b/tests/phpunit/DeployTest.php index 7fbb601d6..d0bd801d3 100644 --- a/tests/phpunit/DeployTest.php +++ b/tests/phpunit/DeployTest.php @@ -17,9 +17,9 @@ class DeployTest extends \PHPUnit_Framework_TestCase { public function __construct() { $this->projectDirectory = realpath(dirname(__FILE__) . '/../../'); - $this->config = Yaml::parse(file_get_contents("{$this->projectDirectory}/project.yml")); - $this->new_project_dir = dirname($this->projectDirectory) . '/' . $this->config['project']['machine_name']; - $this->deploy_dir = $this->new_project_dir . '/deploy'; + $this->newProjectDir = dirname($this->projectDirectory) . '/blt-project'; + $this->config = Yaml::parse(file_get_contents("{$this->newProjectDir}/project.yml")); + $this->deploy_dir = $this->newProjectDir . '/deploy'; } /** diff --git a/tests/phpunit/DrupalVmTest.php b/tests/phpunit/DrupalVmTest.php index a78b55675..8f2ab432f 100644 --- a/tests/phpunit/DrupalVmTest.php +++ b/tests/phpunit/DrupalVmTest.php @@ -16,41 +16,41 @@ class DrupalVmTest extends \PHPUnit_Framework_TestCase { */ public function __construct() { $this->projectDirectory = realpath(dirname(__FILE__) . '/../../'); - $this->config = Yaml::parse(file_get_contents("{$this->projectDirectory}/project.yml")); - $this->new_project_dir = dirname($this->projectDirectory) . '/' . $this->config['project']['machine_name']; + $this->newProjectDir = dirname($this->projectDirectory) . '/blt-project'; + $this->config = Yaml::parse(file_get_contents("{$this->newProjectDir}/project.yml")); } /** * Tests Phing vm:init target. */ public function testVmInit() { - $this->assertFileExists($this->new_project_dir . '/Vagrantfile'); - $this->assertFileExists($this->new_project_dir . '/box/config.yml'); - $this->assertFileExists($this->new_project_dir . '/drush/site-aliases/drupal-vm.aliases.drushrc.php'); + $this->assertFileExists($this->newProjectDir . '/Vagrantfile'); + $this->assertFileExists($this->newProjectDir . '/box/config.yml'); + $this->assertFileExists($this->newProjectDir . '/drush/site-aliases/drupal-vm.aliases.drushrc.php'); $this->assertNotContains( '${project.machine_name}', - file_get_contents($this->new_project_dir . '/box/config.yml') + file_get_contents($this->newProjectDir . '/box/config.yml') ); $this->assertNotContains( '${project.machine_name}', - file_get_contents($this->new_project_dir . '/drush/site-aliases/drupal-vm.aliases.drushrc.php') + file_get_contents($this->newProjectDir . '/drush/site-aliases/drupal-vm.aliases.drushrc.php') ); $this->assertContains( 'drush:', - file_get_contents($this->new_project_dir . '/example.project.local.yml') + file_get_contents($this->newProjectDir . '/example.project.local.yml') ); $this->assertContains( 'root:', - file_get_contents($this->new_project_dir . '/example.project.local.yml') + file_get_contents($this->newProjectDir . '/example.project.local.yml') ); $this->assertContains( 'drush:', - file_get_contents($this->new_project_dir . '/project.local.yml') + file_get_contents($this->newProjectDir . '/project.local.yml') ); $this->assertContains( 'root:', - file_get_contents($this->new_project_dir . '/project.local.yml') + file_get_contents($this->newProjectDir . '/project.local.yml') ); }