From feafba4c1925ea0ca1f113cd1d761c4bcbbc5f66 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 11 Jul 2016 14:55:45 -0400 Subject: [PATCH 01/27] Moving template/build to build. --- build/README.md | 102 +++++++++++++++--- {template/build => build}/core/README.md | 0 .../build => build}/core/files/.gitignore | 0 .../build => build}/core/files/README.md | 0 .../core/files/deploy-exclude.txt | 0 .../build => build}/core/phing/build.xml | 0 .../build => build}/core/phing/build.yml | 0 .../core/phing/example.multisite.yml | 0 .../core/phing/phingcludes/BehatTask.php | 0 .../core/phing/phingcludes/DrushTask.php | 0 .../phingcludes/FileInFilesetCondition.php | 0 .../FilterFileListByFileSetTask.php | 0 .../phing/phingcludes/PhpVariableTask.php | 0 .../build => build}/core/phing/tasks/acsf.xml | 0 .../build => build}/core/phing/tasks/blt.xml | 0 .../build => build}/core/phing/tasks/ci.xml | 0 .../core/phing/tasks/deploy.xml | 0 .../core/phing/tasks/filesets.xml | 0 .../core/phing/tasks/frontend.xml | 0 .../core/phing/tasks/local-sync.xml | 0 .../core/phing/tasks/properties.xml | 0 .../core/phing/tasks/setup.xml | 0 .../core/phing/tasks/tests.xml | 0 .../core/phing/tasks/validate.xml | 0 .../build => build}/core/phing/tasks/vm.xml | 0 {template/build => build}/custom/README.md | 0 .../build => build}/custom/files/README.md | 0 .../build => build}/custom/phing/build.xml | 0 .../build => build}/custom/phing/build.yml | 0 .../custom/phing/tasks/README.md | 0 template/build/README.md | 95 ---------------- 31 files changed, 90 insertions(+), 107 deletions(-) rename {template/build => build}/core/README.md (100%) rename {template/build => build}/core/files/.gitignore (100%) rename {template/build => build}/core/files/README.md (100%) rename {template/build => build}/core/files/deploy-exclude.txt (100%) rename {template/build => build}/core/phing/build.xml (100%) rename {template/build => build}/core/phing/build.yml (100%) rename {template/build => build}/core/phing/example.multisite.yml (100%) rename {template/build => build}/core/phing/phingcludes/BehatTask.php (100%) rename {template/build => build}/core/phing/phingcludes/DrushTask.php (100%) rename {template/build => build}/core/phing/phingcludes/FileInFilesetCondition.php (100%) rename {template/build => build}/core/phing/phingcludes/FilterFileListByFileSetTask.php (100%) rename {template/build => build}/core/phing/phingcludes/PhpVariableTask.php (100%) rename {template/build => build}/core/phing/tasks/acsf.xml (100%) rename {template/build => build}/core/phing/tasks/blt.xml (100%) rename {template/build => build}/core/phing/tasks/ci.xml (100%) rename {template/build => build}/core/phing/tasks/deploy.xml (100%) rename {template/build => build}/core/phing/tasks/filesets.xml (100%) rename {template/build => build}/core/phing/tasks/frontend.xml (100%) rename {template/build => build}/core/phing/tasks/local-sync.xml (100%) rename {template/build => build}/core/phing/tasks/properties.xml (100%) rename {template/build => build}/core/phing/tasks/setup.xml (100%) rename {template/build => build}/core/phing/tasks/tests.xml (100%) rename {template/build => build}/core/phing/tasks/validate.xml (100%) rename {template/build => build}/core/phing/tasks/vm.xml (100%) rename {template/build => build}/custom/README.md (100%) rename {template/build => build}/custom/files/README.md (100%) rename {template/build => build}/custom/phing/build.xml (100%) rename {template/build => build}/custom/phing/build.yml (100%) rename {template/build => build}/custom/phing/tasks/README.md (100%) delete mode 100644 template/build/README.md diff --git a/build/README.md b/build/README.md index 3f8838a23..68428d039 100644 --- a/build/README.md +++ b/build/README.md @@ -1,17 +1,95 @@ -# BLT Build Process +# Build files -Given that BLT generates child projects which must be tested, the CI flow is a little confusing. The CI configuration is detailed below. +This directory contains configuration files for running common project tasks. These may be used for running tasks locally, or for running automated builds via continuous integration solutions. -## CI Flow +This directory should not contain any test files. Those exist in the [/tests](/tests) directory. -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: +## Build Tasks -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. +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. -Likewise, this process occurs for pull requests submitted to BLT 8.x with BLTed8 as a companion project. +For a full list of available Phing tasks, run `./blt.sh -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` +* To run Phing directly from the binary, simply run `./bin/phing -f build/phing/build.xml ` + +## Continuous Integration + +Integration with Travis CI is included, although Phing tasks can be used with any CI tool. The default Travis CI build process is as follows: + +1. Pull request or commit to GitHub triggers Travis CI. +1. `.travis.yml` is read and executed by Travis CI. The environment is built by installing composer dependencies. +1. Travis CI begins a a build and calls various Phing targets. + +### Creating your own custom tasks + +You may add your own custom tasks to the build engine by defining new [Phing](https://www.phing.info/) targets in [build/custom/phing/build.xml] +(custom/phing/build.xml). + +You may override or define custom Phing properties in [build/custom/phing/build.yml](custom/phing/build.yml) + +### Automated testing using live content + +By default, the Travis CI automated tests install and test your site from scratch. Once you have a production site in a remote environment, it’s recommended to also run automated tests against a copy of your production database, especially in order to functionally test update hooks. + +Automated testing of live content is easy to set up with two simple steps: + +1. Add the hostname of your staging server to .travis.yml: + + ``` + ssh_known_hosts: + - staging-12345.prod.hosting.acquia.com + ``` +2. Override the default `ci:build:validate:test` target by adding the following to `build/custom/phing/build.xml`: + + ``` + + + ``` + +### Setting Up Travis CI for automated deployments + +Travis CI can be used to deploy a fully built site artifact (with the docroot) in the following manner: + +1. A pull request is merged into the GitHub repository +2. Travis builds the docroot +3. Travis commits the docroot to a specific "build" branch and pushes to Acquia Cloud + +To set up this workflow, you must configure Acquia Cloud, GitHub, and Travis CI to work together. Step-by-step instructions are provided below. + + +1. Generate an SSH key locally. E.g., + + ``` + cd ~/.ssh + ssh-keygen -t rsa -b 4096 + ``` + + Do not use a passphrase! +1. Create a new Acquia Cloud account to be used exclusively as a container for the SSH keys that will grant Travis push access to Acquia Cloud. This can be done by inviting a new team member on the "Teams" tab in Acquia Cloud. You can use an email address like `+travis@acquia.com`. The team member must have SSH push access. +1. Login the your new Acquia Cloud account and add the public SSH key from the key pair that was generated in step 1 by visiting `https://accounts.acquia.com/account/[uid]/security`. +1. Add the same public SSH key to the "Deployment Keys" section on your project's GitHub settings page, located at `https://github.com/acquia-pso/[project-name]/settings/keys`. +1. Add the _private SSH key_ to your project's Travis CI settings located at `https://magnum.travis-ci.com/acquia-pso/[project-name]/settings`. +1. Uncomment the example deployment steps in your .travis.yml file and customize them to deploy your desired branch. +1. Add your cloud git repository to the remotes section of your project.yml file: + + ``` + remotes: + - example@svn-14671.prod.hosting.acquia.com:example.git` + ``` + +1. Add your cloud git repository's server host name to `ssh_known_hosts` in your .travis.yml file. + + ``` + addons: + ssh_known_hosts: + - svn-14671.prod.hosting.acquia.com + ``` + +1. Commits or merges to the develop branch on GitHub should now trigger a fully built artifact to be deployed to your specified remotes. + +For information on manually deploying your project, read [readme/deploy.md](readme/deploy.md) diff --git a/template/build/core/README.md b/build/core/README.md similarity index 100% rename from template/build/core/README.md rename to build/core/README.md diff --git a/template/build/core/files/.gitignore b/build/core/files/.gitignore similarity index 100% rename from template/build/core/files/.gitignore rename to build/core/files/.gitignore diff --git a/template/build/core/files/README.md b/build/core/files/README.md similarity index 100% rename from template/build/core/files/README.md rename to build/core/files/README.md diff --git a/template/build/core/files/deploy-exclude.txt b/build/core/files/deploy-exclude.txt similarity index 100% rename from template/build/core/files/deploy-exclude.txt rename to build/core/files/deploy-exclude.txt diff --git a/template/build/core/phing/build.xml b/build/core/phing/build.xml similarity index 100% rename from template/build/core/phing/build.xml rename to build/core/phing/build.xml diff --git a/template/build/core/phing/build.yml b/build/core/phing/build.yml similarity index 100% rename from template/build/core/phing/build.yml rename to build/core/phing/build.yml diff --git a/template/build/core/phing/example.multisite.yml b/build/core/phing/example.multisite.yml similarity index 100% rename from template/build/core/phing/example.multisite.yml rename to build/core/phing/example.multisite.yml diff --git a/template/build/core/phing/phingcludes/BehatTask.php b/build/core/phing/phingcludes/BehatTask.php similarity index 100% rename from template/build/core/phing/phingcludes/BehatTask.php rename to build/core/phing/phingcludes/BehatTask.php diff --git a/template/build/core/phing/phingcludes/DrushTask.php b/build/core/phing/phingcludes/DrushTask.php similarity index 100% rename from template/build/core/phing/phingcludes/DrushTask.php rename to build/core/phing/phingcludes/DrushTask.php diff --git a/template/build/core/phing/phingcludes/FileInFilesetCondition.php b/build/core/phing/phingcludes/FileInFilesetCondition.php similarity index 100% rename from template/build/core/phing/phingcludes/FileInFilesetCondition.php rename to build/core/phing/phingcludes/FileInFilesetCondition.php diff --git a/template/build/core/phing/phingcludes/FilterFileListByFileSetTask.php b/build/core/phing/phingcludes/FilterFileListByFileSetTask.php similarity index 100% rename from template/build/core/phing/phingcludes/FilterFileListByFileSetTask.php rename to build/core/phing/phingcludes/FilterFileListByFileSetTask.php diff --git a/template/build/core/phing/phingcludes/PhpVariableTask.php b/build/core/phing/phingcludes/PhpVariableTask.php similarity index 100% rename from template/build/core/phing/phingcludes/PhpVariableTask.php rename to build/core/phing/phingcludes/PhpVariableTask.php diff --git a/template/build/core/phing/tasks/acsf.xml b/build/core/phing/tasks/acsf.xml similarity index 100% rename from template/build/core/phing/tasks/acsf.xml rename to build/core/phing/tasks/acsf.xml diff --git a/template/build/core/phing/tasks/blt.xml b/build/core/phing/tasks/blt.xml similarity index 100% rename from template/build/core/phing/tasks/blt.xml rename to build/core/phing/tasks/blt.xml diff --git a/template/build/core/phing/tasks/ci.xml b/build/core/phing/tasks/ci.xml similarity index 100% rename from template/build/core/phing/tasks/ci.xml rename to build/core/phing/tasks/ci.xml diff --git a/template/build/core/phing/tasks/deploy.xml b/build/core/phing/tasks/deploy.xml similarity index 100% rename from template/build/core/phing/tasks/deploy.xml rename to build/core/phing/tasks/deploy.xml diff --git a/template/build/core/phing/tasks/filesets.xml b/build/core/phing/tasks/filesets.xml similarity index 100% rename from template/build/core/phing/tasks/filesets.xml rename to build/core/phing/tasks/filesets.xml diff --git a/template/build/core/phing/tasks/frontend.xml b/build/core/phing/tasks/frontend.xml similarity index 100% rename from template/build/core/phing/tasks/frontend.xml rename to build/core/phing/tasks/frontend.xml diff --git a/template/build/core/phing/tasks/local-sync.xml b/build/core/phing/tasks/local-sync.xml similarity index 100% rename from template/build/core/phing/tasks/local-sync.xml rename to build/core/phing/tasks/local-sync.xml diff --git a/template/build/core/phing/tasks/properties.xml b/build/core/phing/tasks/properties.xml similarity index 100% rename from template/build/core/phing/tasks/properties.xml rename to build/core/phing/tasks/properties.xml diff --git a/template/build/core/phing/tasks/setup.xml b/build/core/phing/tasks/setup.xml similarity index 100% rename from template/build/core/phing/tasks/setup.xml rename to build/core/phing/tasks/setup.xml diff --git a/template/build/core/phing/tasks/tests.xml b/build/core/phing/tasks/tests.xml similarity index 100% rename from template/build/core/phing/tasks/tests.xml rename to build/core/phing/tasks/tests.xml diff --git a/template/build/core/phing/tasks/validate.xml b/build/core/phing/tasks/validate.xml similarity index 100% rename from template/build/core/phing/tasks/validate.xml rename to build/core/phing/tasks/validate.xml diff --git a/template/build/core/phing/tasks/vm.xml b/build/core/phing/tasks/vm.xml similarity index 100% rename from template/build/core/phing/tasks/vm.xml rename to build/core/phing/tasks/vm.xml diff --git a/template/build/custom/README.md b/build/custom/README.md similarity index 100% rename from template/build/custom/README.md rename to build/custom/README.md diff --git a/template/build/custom/files/README.md b/build/custom/files/README.md similarity index 100% rename from template/build/custom/files/README.md rename to build/custom/files/README.md diff --git a/template/build/custom/phing/build.xml b/build/custom/phing/build.xml similarity index 100% rename from template/build/custom/phing/build.xml rename to build/custom/phing/build.xml diff --git a/template/build/custom/phing/build.yml b/build/custom/phing/build.yml similarity index 100% rename from template/build/custom/phing/build.yml rename to build/custom/phing/build.yml diff --git a/template/build/custom/phing/tasks/README.md b/build/custom/phing/tasks/README.md similarity index 100% rename from template/build/custom/phing/tasks/README.md rename to build/custom/phing/tasks/README.md diff --git a/template/build/README.md b/template/build/README.md deleted file mode 100644 index 68428d039..000000000 --- a/template/build/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# Build files - -This directory contains configuration files for running common project tasks. These may be used for running tasks locally, or for running automated builds via continuous integration solutions. - -This directory should not contain any test files. Those exist in the [/tests](/tests) directory. - -## Build Tasks - -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. - -### 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` -* To run Phing directly from the binary, simply run `./bin/phing -f build/phing/build.xml ` - -## Continuous Integration - -Integration with Travis CI is included, although Phing tasks can be used with any CI tool. The default Travis CI build process is as follows: - -1. Pull request or commit to GitHub triggers Travis CI. -1. `.travis.yml` is read and executed by Travis CI. The environment is built by installing composer dependencies. -1. Travis CI begins a a build and calls various Phing targets. - -### Creating your own custom tasks - -You may add your own custom tasks to the build engine by defining new [Phing](https://www.phing.info/) targets in [build/custom/phing/build.xml] -(custom/phing/build.xml). - -You may override or define custom Phing properties in [build/custom/phing/build.yml](custom/phing/build.yml) - -### Automated testing using live content - -By default, the Travis CI automated tests install and test your site from scratch. Once you have a production site in a remote environment, it’s recommended to also run automated tests against a copy of your production database, especially in order to functionally test update hooks. - -Automated testing of live content is easy to set up with two simple steps: - -1. Add the hostname of your staging server to .travis.yml: - - ``` - ssh_known_hosts: - - staging-12345.prod.hosting.acquia.com - ``` -2. Override the default `ci:build:validate:test` target by adding the following to `build/custom/phing/build.xml`: - - ``` - - - ``` - -### Setting Up Travis CI for automated deployments - -Travis CI can be used to deploy a fully built site artifact (with the docroot) in the following manner: - -1. A pull request is merged into the GitHub repository -2. Travis builds the docroot -3. Travis commits the docroot to a specific "build" branch and pushes to Acquia Cloud - -To set up this workflow, you must configure Acquia Cloud, GitHub, and Travis CI to work together. Step-by-step instructions are provided below. - - -1. Generate an SSH key locally. E.g., - - ``` - cd ~/.ssh - ssh-keygen -t rsa -b 4096 - ``` - - Do not use a passphrase! -1. Create a new Acquia Cloud account to be used exclusively as a container for the SSH keys that will grant Travis push access to Acquia Cloud. This can be done by inviting a new team member on the "Teams" tab in Acquia Cloud. You can use an email address like `+travis@acquia.com`. The team member must have SSH push access. -1. Login the your new Acquia Cloud account and add the public SSH key from the key pair that was generated in step 1 by visiting `https://accounts.acquia.com/account/[uid]/security`. -1. Add the same public SSH key to the "Deployment Keys" section on your project's GitHub settings page, located at `https://github.com/acquia-pso/[project-name]/settings/keys`. -1. Add the _private SSH key_ to your project's Travis CI settings located at `https://magnum.travis-ci.com/acquia-pso/[project-name]/settings`. -1. Uncomment the example deployment steps in your .travis.yml file and customize them to deploy your desired branch. -1. Add your cloud git repository to the remotes section of your project.yml file: - - ``` - remotes: - - example@svn-14671.prod.hosting.acquia.com:example.git` - ``` - -1. Add your cloud git repository's server host name to `ssh_known_hosts` in your .travis.yml file. - - ``` - addons: - ssh_known_hosts: - - svn-14671.prod.hosting.acquia.com - ``` - -1. Commits or merges to the develop branch on GitHub should now trigger a fully built artifact to be deployed to your specified remotes. - -For information on manually deploying your project, read [readme/deploy.md](readme/deploy.md) From 1ed61a45c75735c5eee4f92df7e074f091b0a980 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 11 Jul 2016 15:15:50 -0400 Subject: [PATCH 02/27] Removing custom tasks dir. --- build/core/phing/build.xml | 3 +++ build/core/phing/tasks/blt.xml | 4 ++++ build/custom/README.md | 3 --- build/custom/files/README.md | 1 - build/custom/phing/build.xml | 23 ----------------------- build/custom/phing/build.yml | 3 --- build/custom/phing/tasks/README.md | 0 build/phing/build.xml | 18 ------------------ build/phing/build.yml | 2 -- 9 files changed, 7 insertions(+), 50 deletions(-) delete mode 100644 build/custom/README.md delete mode 100644 build/custom/files/README.md delete mode 100644 build/custom/phing/build.xml delete mode 100644 build/custom/phing/build.yml delete mode 100644 build/custom/phing/tasks/README.md delete mode 100644 build/phing/build.yml diff --git a/build/core/phing/build.xml b/build/core/phing/build.xml index 27ba83241..dcc6de9a4 100644 --- a/build/core/phing/build.xml +++ b/build/core/phing/build.xml @@ -15,6 +15,9 @@ + + + diff --git a/build/core/phing/tasks/blt.xml b/build/core/phing/tasks/blt.xml index 72f82e246..bb1f2e3aa 100644 --- a/build/core/phing/tasks/blt.xml +++ b/build/core/phing/tasks/blt.xml @@ -9,6 +9,10 @@ + + + + diff --git a/build/custom/README.md b/build/custom/README.md deleted file mode 100644 index 95e536d3f..000000000 --- a/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/build/custom/files/README.md b/build/custom/files/README.md deleted file mode 100644 index 4dce092b5..000000000 --- a/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/build/custom/phing/build.xml b/build/custom/phing/build.xml deleted file mode 100644 index 9236d046c..000000000 --- a/build/custom/phing/build.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/custom/phing/build.yml b/build/custom/phing/build.yml deleted file mode 100644 index 407dcd7db..000000000 --- a/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/build/custom/phing/tasks/README.md b/build/custom/phing/tasks/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/phing/build.xml b/build/phing/build.xml index d9e4e7012..0e894988e 100644 --- a/build/phing/build.xml +++ b/build/phing/build.xml @@ -15,24 +15,6 @@ - - - - - - - - - - - - - - - - - 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} From 88de12acd0c5faf95fb2ad8bc47d5136e7745218 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 11 Jul 2016 15:18:35 -0400 Subject: [PATCH 03/27] Removing build/core. --- build/core/README.md | 8 - build/core/phing/build.xml | 84 ------- build/phing/build-old.xml | 162 +++++++++++++ build/phing/build.xml | 212 ++++++------------ build/{core => }/phing/build.yml | 0 build/{core => }/phing/example.multisite.yml | 0 build/{core => phing}/files/.gitignore | 0 build/{core => phing}/files/README.md | 0 .../{core => phing}/files/deploy-exclude.txt | 0 .../phing/phingcludes/BehatTask.php | 0 .../phing/phingcludes/DrushTask.php | 0 .../phingcludes/FileInFilesetCondition.php | 0 .../FilterFileListByFileSetTask.php | 0 .../phing/phingcludes/PhpVariableTask.php | 0 build/{core => }/phing/tasks/acsf.xml | 0 build/{core => }/phing/tasks/blt.xml | 0 build/{core => }/phing/tasks/ci.xml | 0 build/{core => }/phing/tasks/deploy.xml | 0 build/{core => }/phing/tasks/filesets.xml | 0 build/{core => }/phing/tasks/frontend.xml | 0 build/{core => }/phing/tasks/local-sync.xml | 0 build/{core => }/phing/tasks/properties.xml | 0 build/{core => }/phing/tasks/setup.xml | 0 build/{core => }/phing/tasks/tests.xml | 0 build/{core => }/phing/tasks/validate.xml | 0 build/{core => }/phing/tasks/vm.xml | 0 template/blt.sh | 23 -- 27 files changed, 229 insertions(+), 260 deletions(-) delete mode 100644 build/core/README.md delete mode 100644 build/core/phing/build.xml create mode 100644 build/phing/build-old.xml rename build/{core => }/phing/build.yml (100%) rename build/{core => }/phing/example.multisite.yml (100%) rename build/{core => phing}/files/.gitignore (100%) rename build/{core => phing}/files/README.md (100%) rename build/{core => phing}/files/deploy-exclude.txt (100%) rename build/{core => }/phing/phingcludes/BehatTask.php (100%) rename build/{core => }/phing/phingcludes/DrushTask.php (100%) rename build/{core => }/phing/phingcludes/FileInFilesetCondition.php (100%) rename build/{core => }/phing/phingcludes/FilterFileListByFileSetTask.php (100%) rename build/{core => }/phing/phingcludes/PhpVariableTask.php (100%) rename build/{core => }/phing/tasks/acsf.xml (100%) rename build/{core => }/phing/tasks/blt.xml (100%) rename build/{core => }/phing/tasks/ci.xml (100%) rename build/{core => }/phing/tasks/deploy.xml (100%) rename build/{core => }/phing/tasks/filesets.xml (100%) rename build/{core => }/phing/tasks/frontend.xml (100%) rename build/{core => }/phing/tasks/local-sync.xml (100%) rename build/{core => }/phing/tasks/properties.xml (100%) rename build/{core => }/phing/tasks/setup.xml (100%) rename build/{core => }/phing/tasks/tests.xml (100%) rename build/{core => }/phing/tasks/validate.xml (100%) rename build/{core => }/phing/tasks/vm.xml (100%) delete mode 100755 template/blt.sh diff --git a/build/core/README.md b/build/core/README.md deleted file mode 100644 index 387815257..000000000 --- a/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/build/core/phing/build.xml b/build/core/phing/build.xml deleted file mode 100644 index dcc6de9a4..000000000 --- a/build/core/phing/build.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - You are running BLT with xdebug enabled. This has a major impact on - runtime performance. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The directory ${target-hooks.${hook-name}.dir} does not exist. Will not run command for ${hook-name}. - - - - - No commands are defined for ${hook-name}. Skipping. - - - - - diff --git a/build/phing/build-old.xml b/build/phing/build-old.xml new file mode 100644 index 000000000..0e894988e --- /dev/null +++ b/build/phing/build-old.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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.xml b/build/phing/build.xml index 0e894988e..dcc6de9a4 100644 --- a/build/phing/build.xml +++ b/build/phing/build.xml @@ -1,162 +1,84 @@ - - + + + + + + + + + + + + + You are running BLT with xdebug enabled. This has a major impact on + runtime performance. + + + + + - - - + - - - - - - - - - - - - - - - - - - - - - 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. - - + - + + + The directory ${target-hooks.${hook-name}.dir} does not exist. Will not run command for ${hook-name}. + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + No commands are defined for ${hook-name}. Skipping. - - - - - - - - - - - - - - - - - - - - - - - - - - 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/core/phing/build.yml b/build/phing/build.yml similarity index 100% rename from build/core/phing/build.yml rename to build/phing/build.yml diff --git a/build/core/phing/example.multisite.yml b/build/phing/example.multisite.yml similarity index 100% rename from build/core/phing/example.multisite.yml rename to build/phing/example.multisite.yml diff --git a/build/core/files/.gitignore b/build/phing/files/.gitignore similarity index 100% rename from build/core/files/.gitignore rename to build/phing/files/.gitignore diff --git a/build/core/files/README.md b/build/phing/files/README.md similarity index 100% rename from build/core/files/README.md rename to build/phing/files/README.md diff --git a/build/core/files/deploy-exclude.txt b/build/phing/files/deploy-exclude.txt similarity index 100% rename from build/core/files/deploy-exclude.txt rename to build/phing/files/deploy-exclude.txt diff --git a/build/core/phing/phingcludes/BehatTask.php b/build/phing/phingcludes/BehatTask.php similarity index 100% rename from build/core/phing/phingcludes/BehatTask.php rename to build/phing/phingcludes/BehatTask.php diff --git a/build/core/phing/phingcludes/DrushTask.php b/build/phing/phingcludes/DrushTask.php similarity index 100% rename from build/core/phing/phingcludes/DrushTask.php rename to build/phing/phingcludes/DrushTask.php diff --git a/build/core/phing/phingcludes/FileInFilesetCondition.php b/build/phing/phingcludes/FileInFilesetCondition.php similarity index 100% rename from build/core/phing/phingcludes/FileInFilesetCondition.php rename to build/phing/phingcludes/FileInFilesetCondition.php diff --git a/build/core/phing/phingcludes/FilterFileListByFileSetTask.php b/build/phing/phingcludes/FilterFileListByFileSetTask.php similarity index 100% rename from build/core/phing/phingcludes/FilterFileListByFileSetTask.php rename to build/phing/phingcludes/FilterFileListByFileSetTask.php diff --git a/build/core/phing/phingcludes/PhpVariableTask.php b/build/phing/phingcludes/PhpVariableTask.php similarity index 100% rename from build/core/phing/phingcludes/PhpVariableTask.php rename to build/phing/phingcludes/PhpVariableTask.php diff --git a/build/core/phing/tasks/acsf.xml b/build/phing/tasks/acsf.xml similarity index 100% rename from build/core/phing/tasks/acsf.xml rename to build/phing/tasks/acsf.xml diff --git a/build/core/phing/tasks/blt.xml b/build/phing/tasks/blt.xml similarity index 100% rename from build/core/phing/tasks/blt.xml rename to build/phing/tasks/blt.xml diff --git a/build/core/phing/tasks/ci.xml b/build/phing/tasks/ci.xml similarity index 100% rename from build/core/phing/tasks/ci.xml rename to build/phing/tasks/ci.xml diff --git a/build/core/phing/tasks/deploy.xml b/build/phing/tasks/deploy.xml similarity index 100% rename from build/core/phing/tasks/deploy.xml rename to build/phing/tasks/deploy.xml diff --git a/build/core/phing/tasks/filesets.xml b/build/phing/tasks/filesets.xml similarity index 100% rename from build/core/phing/tasks/filesets.xml rename to build/phing/tasks/filesets.xml diff --git a/build/core/phing/tasks/frontend.xml b/build/phing/tasks/frontend.xml similarity index 100% rename from build/core/phing/tasks/frontend.xml rename to build/phing/tasks/frontend.xml diff --git a/build/core/phing/tasks/local-sync.xml b/build/phing/tasks/local-sync.xml similarity index 100% rename from build/core/phing/tasks/local-sync.xml rename to build/phing/tasks/local-sync.xml diff --git a/build/core/phing/tasks/properties.xml b/build/phing/tasks/properties.xml similarity index 100% rename from build/core/phing/tasks/properties.xml rename to build/phing/tasks/properties.xml diff --git a/build/core/phing/tasks/setup.xml b/build/phing/tasks/setup.xml similarity index 100% rename from build/core/phing/tasks/setup.xml rename to build/phing/tasks/setup.xml diff --git a/build/core/phing/tasks/tests.xml b/build/phing/tasks/tests.xml similarity index 100% rename from build/core/phing/tasks/tests.xml rename to build/phing/tasks/tests.xml diff --git a/build/core/phing/tasks/validate.xml b/build/phing/tasks/validate.xml similarity index 100% rename from build/core/phing/tasks/validate.xml rename to build/phing/tasks/validate.xml diff --git a/build/core/phing/tasks/vm.xml b/build/phing/tasks/vm.xml similarity index 100% rename from build/core/phing/tasks/vm.xml rename to build/phing/tasks/vm.xml 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 "$@" From 4605a1f3270de355348f636ed807914745077ca5 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 11 Jul 2016 15:23:37 -0400 Subject: [PATCH 04/27] Removing template dir. --- .gitignore | 6 +- .travis.yml | 45 ++- CONTRIBUTING.md | 10 + application.php | 13 + bin/blt | 11 + blt-project/README.md | 18 ++ blt-project/composer.json | 25 ++ blt.sh | 11 +- build/phing/build-old.xml | 162 ---------- build/phing/tasks/blt.xml | 24 -- composer.json | 23 +- composer.lock | 291 +++++++++--------- {build => phing}/README.md | 0 {build/phing => phing}/build.xml | 33 +- {build/phing => phing}/build.yml | 3 +- {build/phing => phing}/example.multisite.yml | 0 {build/phing => phing}/files/.gitignore | 0 {build/phing => phing}/files/README.md | 0 .../phing => 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/phing => phing}/tasks/acsf.xml | 0 phing/tasks/blt.xml | 91 ++++++ {build/phing => phing}/tasks/ci.xml | 4 +- {build/phing => phing}/tasks/deploy.xml | 2 +- {build/phing => phing}/tasks/filesets.xml | 0 {build/phing => phing}/tasks/frontend.xml | 0 {build/phing => phing}/tasks/local-sync.xml | 0 {build/phing => phing}/tasks/properties.xml | 15 +- {build/phing => phing}/tasks/setup.xml | 55 +++- {build/phing => phing}/tasks/tests.xml | 6 +- {build/phing => phing}/tasks/validate.xml | 5 +- {build/phing => phing}/tasks/vm.xml | 6 +- {template/scripts => scripts}/README.md | 0 {template/scripts => scripts}/blt/alias | 4 +- scripts/blt/convert-to-composer.sh | 15 + .../scripts => scripts}/blt/install-alias.sh | 2 +- .../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 scripts/drupal/update-scaffold | 26 ++ .../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 | 0 .../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 | 150 +++++++++ src/Console/Command/YamlMungeCommand.php | 66 ++++ template/.travis.yml | 11 +- template/composer.json | 12 +- .../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 | 6 +- template/readme/local-development.md | 2 +- template/readme/project-tasks.md | 13 +- template/readme/release-process.md | 2 +- template/tests/phpunit/Bolt/DrushTest.php | 1 + template/tests/phpunit/Bolt/GitTest.php | 1 + tests/phpunit/BltTest.php | 17 +- tests/phpunit/DeployTest.php | 4 +- tests/phpunit/DrupalVmTest.php | 4 +- 101 files changed, 926 insertions(+), 932 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 application.php create mode 100755 bin/blt create mode 100644 blt-project/README.md create mode 100644 blt-project/composer.json delete mode 100644 build/phing/build-old.xml delete mode 100644 build/phing/tasks/blt.xml rename {build => phing}/README.md (100%) rename {build/phing => phing}/build.xml (70%) rename {build/phing => phing}/build.yml (91%) rename {build/phing => phing}/example.multisite.yml (100%) rename {build/phing => phing}/files/.gitignore (100%) rename {build/phing => phing}/files/README.md (100%) rename {build/phing => phing}/files/deploy-exclude.txt (100%) rename {build/phing => phing}/phingcludes/BehatTask.php (100%) rename {build/phing => phing}/phingcludes/DrushTask.php (100%) rename {build/phing => phing}/phingcludes/FileInFilesetCondition.php (100%) rename {build/phing => phing}/phingcludes/FilterFileListByFileSetTask.php (100%) rename {build/phing => phing}/phingcludes/PhpVariableTask.php (100%) rename {build/phing => phing}/tasks/acsf.xml (100%) create mode 100644 phing/tasks/blt.xml rename {build/phing => phing}/tasks/ci.xml (85%) rename {build/phing => phing}/tasks/deploy.xml (98%) rename {build/phing => phing}/tasks/filesets.xml (100%) rename {build/phing => phing}/tasks/frontend.xml (100%) rename {build/phing => phing}/tasks/local-sync.xml (100%) rename {build/phing => phing}/tasks/properties.xml (78%) rename {build/phing => phing}/tasks/setup.xml (70%) rename {build/phing => phing}/tasks/tests.xml (94%) rename {build/phing => phing}/tasks/validate.xml (95%) rename {build/phing => phing}/tasks/vm.xml (88%) rename {template/scripts => scripts}/README.md (100%) rename {template/scripts => scripts}/blt/alias (76%) create mode 100644 scripts/blt/convert-to-composer.sh rename {template/scripts => scripts}/blt/install-alias.sh (92%) 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%) create mode 100755 scripts/drupal/update-scaffold 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 (100%) 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 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..a9d352f96 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,6 @@ /project.yml local.* -# Ignore build artifacts -bin/* - # OS X .DS_Store .AppleDouble @@ -103,3 +100,6 @@ nbproject/* # Some files should be excluded from blt but not from the projects it # generates, so they must be specified here rather than in template/.gitignore. template/.idea/.name + +blt-project/composer.lock +blt-project/vendor diff --git a/.travis.yml b/.travis.yml index 296034431..bbdc46cd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,11 @@ addons: - svn-5223.devcloud.hosting.acquia.com before_install: + - ls -lash ~/.composer/cache # 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: + # Remove acquia packages from cache before running `composer install`. + - rm -rf vendor/acquia + # Load composer dependencies. - composer validate --no-check-all --ansi - 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,38 @@ 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 + # It is necessary to fetch the full git history in order to use a local composer package in blt-project. + - git fetch --unshallow + # 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 + - blt init + - blt configure + # Running `blt init` modified composer.json, so we must update. + - composer update # 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 + # 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..82cd773f7 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ +#### Why are you using both Phing and 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/application.php b/application.php new file mode 100644 index 000000000..b3dcc2506 --- /dev/null +++ b/application.php @@ -0,0 +1,13 @@ +#!/usr/bin/env php +add(new ComposerMungeCommand()); +$application->add(new YamlMungeCommand()); +$application->run(); diff --git a/bin/blt b/bin/blt new file mode 100755 index 000000000..64826b23b --- /dev/null +++ b/bin/blt @@ -0,0 +1,11 @@ +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/blt-project/README.md b/blt-project/README.md new file mode 100644 index 000000000..93d647a65 --- /dev/null +++ b/blt-project/README.md @@ -0,0 +1,18 @@ +This directory is used to aid in the development and testing of BLT. + +Use the following commands to create a testable BLT-created project: + +``` +cp -R blt/blt-project . +cd blt-project +composer install +export $PATH=$(pwd)/vendor/bin:$PATH +blt init +blt configure +composer update +blt setup +blt test +blt deploy:build +``` + +This will fully create, BLTify, install, tests, and generate a deployment artifact for the blt-project. The acquia/blt dependency in blt-project will be symlinked to ../blt, which enables simple iterative development and testing of both BLT and a BLT-created project in parallel. 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..db7144a6b 100755 --- a/blt.sh +++ b/blt.sh @@ -12,12 +12,17 @@ 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 ) +echo $SCRIPT_DIR +BIN=$(cd ${SCRIPT_DIR}/../../bin && pwd) +echo $BIN +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/phing/build-old.xml b/build/phing/build-old.xml deleted file mode 100644 index 0e894988e..000000000 --- a/build/phing/build-old.xml +++ /dev/null @@ -1,162 +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/tasks/blt.xml b/build/phing/tasks/blt.xml deleted file mode 100644 index bb1f2e3aa..000000000 --- a/build/phing/tasks/blt.xml +++ /dev/null @@ -1,24 +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/composer.json b/composer.json index 6428583bd..16bf4e127 100644 --- a/composer.json +++ b/composer.json @@ -3,13 +3,22 @@ "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"], + "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/build/README.md b/phing/README.md similarity index 100% rename from build/README.md rename to phing/README.md diff --git a/build/phing/build.xml b/phing/build.xml similarity index 70% rename from build/phing/build.xml rename to phing/build.xml index dcc6de9a4..bd78ed8bc 100644 --- a/build/phing/build.xml +++ b/phing/build.xml @@ -1,7 +1,7 @@ - + - + @@ -15,49 +15,46 @@ - - - - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/build/phing/build.yml b/phing/build.yml similarity index 91% rename from build/phing/build.yml rename to phing/build.yml index 749e67abb..c0699d220 100644 --- a/build/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 diff --git a/build/phing/example.multisite.yml b/phing/example.multisite.yml similarity index 100% rename from build/phing/example.multisite.yml rename to phing/example.multisite.yml diff --git a/build/phing/files/.gitignore b/phing/files/.gitignore similarity index 100% rename from build/phing/files/.gitignore rename to phing/files/.gitignore diff --git a/build/phing/files/README.md b/phing/files/README.md similarity index 100% rename from build/phing/files/README.md rename to phing/files/README.md diff --git a/build/phing/files/deploy-exclude.txt b/phing/files/deploy-exclude.txt similarity index 100% rename from build/phing/files/deploy-exclude.txt rename to phing/files/deploy-exclude.txt diff --git a/build/phing/phingcludes/BehatTask.php b/phing/phingcludes/BehatTask.php similarity index 100% rename from build/phing/phingcludes/BehatTask.php rename to phing/phingcludes/BehatTask.php diff --git a/build/phing/phingcludes/DrushTask.php b/phing/phingcludes/DrushTask.php similarity index 100% rename from build/phing/phingcludes/DrushTask.php rename to phing/phingcludes/DrushTask.php diff --git a/build/phing/phingcludes/FileInFilesetCondition.php b/phing/phingcludes/FileInFilesetCondition.php similarity index 100% rename from build/phing/phingcludes/FileInFilesetCondition.php rename to phing/phingcludes/FileInFilesetCondition.php diff --git a/build/phing/phingcludes/FilterFileListByFileSetTask.php b/phing/phingcludes/FilterFileListByFileSetTask.php similarity index 100% rename from build/phing/phingcludes/FilterFileListByFileSetTask.php rename to phing/phingcludes/FilterFileListByFileSetTask.php diff --git a/build/phing/phingcludes/PhpVariableTask.php b/phing/phingcludes/PhpVariableTask.php similarity index 100% rename from build/phing/phingcludes/PhpVariableTask.php rename to phing/phingcludes/PhpVariableTask.php diff --git a/build/phing/tasks/acsf.xml b/phing/tasks/acsf.xml similarity index 100% rename from build/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..c5bc44055 --- /dev/null +++ b/phing/tasks/blt.xml @@ -0,0 +1,91 @@ + + + BLT files have been copied to your project directory. + Please customize ${repo.root}/project.yml and then run: + blt configure + + + + 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. + + php application.php composer:munge ${repo.root}/composer.json ${blt.root}/template/composer.json > ${repo.root}/composer.json.tmp" + + + + 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. + + + + Expanding Phing properties in BLT files. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${property.name} + ${${property.name}} + + + + + + + + + + + + + + + diff --git a/build/phing/tasks/ci.xml b/phing/tasks/ci.xml similarity index 85% rename from build/phing/tasks/ci.xml rename to phing/tasks/ci.xml index 9d9b8964b..3d79fae73 100644 --- a/build/phing/tasks/ci.xml +++ b/phing/tasks/ci.xml @@ -18,8 +18,8 @@ - - + + diff --git a/build/phing/tasks/deploy.xml b/phing/tasks/deploy.xml similarity index 98% rename from build/phing/tasks/deploy.xml rename to phing/tasks/deploy.xml index b7d8122e2..c880afad8 100644 --- a/build/phing/tasks/deploy.xml +++ b/phing/tasks/deploy.xml @@ -107,7 +107,7 @@ - + diff --git a/build/phing/tasks/filesets.xml b/phing/tasks/filesets.xml similarity index 100% rename from build/phing/tasks/filesets.xml rename to phing/tasks/filesets.xml diff --git a/build/phing/tasks/frontend.xml b/phing/tasks/frontend.xml similarity index 100% rename from build/phing/tasks/frontend.xml rename to phing/tasks/frontend.xml diff --git a/build/phing/tasks/local-sync.xml b/phing/tasks/local-sync.xml similarity index 100% rename from build/phing/tasks/local-sync.xml rename to phing/tasks/local-sync.xml diff --git a/build/phing/tasks/properties.xml b/phing/tasks/properties.xml similarity index 78% rename from build/phing/tasks/properties.xml rename to phing/tasks/properties.xml index 174f1a18e..691f4781e 100644 --- a/build/phing/tasks/properties.xml +++ b/phing/tasks/properties.xml @@ -1,14 +1,18 @@ - + + - - + + - + + + + @@ -31,10 +35,7 @@ Executing commands against multisite "${multisite.name}" - Using settings file ${local.settings.file} - - diff --git a/build/phing/tasks/setup.xml b/phing/tasks/setup.xml similarity index 70% rename from build/phing/tasks/setup.xml rename to phing/tasks/setup.xml index eb4ddb7c7..dc2e899c8 100644 --- a/build/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 + Attempting to generate tests/behat/local.yml using tests/behat/example.local.yml. @@ -46,6 +47,18 @@ + + + + + Generating settings.php from default.settings.php. + + + + + Ensuring that blt.settings.php is required by settings.php + + @@ -54,17 +67,19 @@ + - + + - + @@ -82,7 +97,7 @@ + depends="setup:drupal:settings, setup:hash-salt, configure"> @@ -95,10 +110,7 @@ "install_configure_form.update_status_module='array(FALSE,FALSE)'" - - - sync - + @@ -116,9 +128,24 @@ + + + config + + + + + + + + sync + + + + @@ -130,6 +157,18 @@ + + + + + + + + + + + + diff --git a/build/phing/tasks/tests.xml b/phing/tasks/tests.xml similarity index 94% rename from build/phing/tasks/tests.xml rename to phing/tasks/tests.xml index cbbc0e85d..06e2f199b 100644 --- a/build/phing/tasks/tests.xml +++ b/phing/tasks/tests.xml @@ -1,11 +1,13 @@ + + + depends="tests:security-updates, tests:phpunit, tests:behat"/> - + diff --git a/build/phing/tasks/validate.xml b/phing/tasks/validate.xml similarity index 95% rename from build/phing/tasks/validate.xml rename to phing/tasks/validate.xml index 7c425e5ce..25673b7c8 100644 --- a/build/phing/tasks/validate.xml +++ b/phing/tasks/validate.xml @@ -1,4 +1,7 @@ - + + + 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 100644 index 000000000..1761b4f8e --- /dev/null +++ b/scripts/blt/convert-to-composer.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +echo "Note that you will lose any custom scripts in build/custom" + +# Move values from custom/build.yml to project.yml. +cat build/custom/phing/build.yml >> project.yml +# Remove unneeded files. +rm -rf build bolt.sh tests/phpunit/blt +# @todo remove old alias! +# Install (new) alias +./vendor/acquia/blt/blt.sh install-alias +blt init +blt configure + +# Move build/custom/files to new locations (e.g., deploy excludes or .gitignores). diff --git a/template/scripts/blt/install-alias.sh b/scripts/blt/install-alias.sh similarity index 92% rename from template/scripts/blt/install-alias.sh rename to scripts/blt/install-alias.sh index 4ba556574..a2d43b9fa 100755 --- a/template/scripts/blt/install-alias.sh +++ b/scripts/blt/install-alias.sh @@ -29,7 +29,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/scripts/drupal/update-scaffold b/scripts/drupal/update-scaffold new file mode 100755 index 000000000..fde65bfef --- /dev/null +++ b/scripts/drupal/update-scaffold @@ -0,0 +1,26 @@ +#!/bin/bash -e + +ROOT=$(pwd) +DRUSH=$ROOT/vendor/bin/drush +VERSION=${1:-drupal-8} +DRUPAL_TEMP=$(mktemp -d) + +$DRUSH dl "$VERSION" --root=$DRUPAL_TEMP --destination=$DRUPAL_TEMP --drupal-project-rename=drupal-8 --quiet -y + +rsync -avz --delete $DRUPAL_TEMP/drupal-8/ "$ROOT/docroot" \ + --exclude=.gitkeep \ + --exclude=autoload.php \ + --exclude=composer.json \ + --exclude=composer.lock \ + --exclude=core \ + --exclude=drush \ + --exclude=example.gitignore \ + --exclude=LICENSE.txt \ + --exclude=README.txt \ + --exclude=vendor \ + --exclude=sites \ + --exclude=themes \ + --exclude=profiles \ + --exclude=modules + +rm -rf $DRUPAL_TEMP/drupal-8 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 100% rename from template/scripts/tugboat/README.md rename to scripts/tugboat/README.md 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..3ba9bcf70 --- /dev/null +++ b/src/Console/Command/ComposerMungeCommand.php @@ -0,0 +1,150 @@ +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) { + $file1_contents = (array) json_decode(file_get_contents($file1), true); + $file2_contents = (array) json_decode(file_get_contents($file2), true); + $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..11b135ab4 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. diff --git a/template/composer.json b/template/composer.json index f55348be8..c71cbcd32 100644 --- a/template/composer.json +++ b/template/composer.json @@ -19,9 +19,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 +32,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 +43,6 @@ "Drupal\\Tests\\PHPUnit\\": "tests/phpunit/src/" } }, - "minimum-stability": "dev", - "prefer-stable": true, "extra": { "installer-paths": { "docroot/core": ["type:drupal-core"], @@ -62,12 +59,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 @@ +Patch a project 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/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..e46e046e2 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")); } /** @@ -44,18 +43,6 @@ public function testBltCreate() { '${project.human_name}', file_get_contents($this->new_project_dir . '/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..10b03ea70 100644 --- a/tests/phpunit/DeployTest.php +++ b/tests/phpunit/DeployTest.php @@ -17,8 +17,8 @@ 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->newProjectDir = dirname($this->projectDirectory) . '/blt-project'; + $this->config = Yaml::parse(file_get_contents("{$this->newProjectDir}/project.yml")); $this->deploy_dir = $this->new_project_dir . '/deploy'; } diff --git a/tests/phpunit/DrupalVmTest.php b/tests/phpunit/DrupalVmTest.php index a78b55675..a0b0a65b7 100644 --- a/tests/phpunit/DrupalVmTest.php +++ b/tests/phpunit/DrupalVmTest.php @@ -16,8 +16,8 @@ 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")); } /** From 7b03d0a010285ecfb8dad291d96cafdb7b723d45 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Wed, 20 Jul 2016 19:46:06 -0400 Subject: [PATCH 05/27] Fixing incorrect paths in phpunit tests. --- tests/phpunit/BltTest.php | 16 ++++++++-------- tests/phpunit/DeployTest.php | 2 +- tests/phpunit/DrupalVmTest.php | 18 +++++++++--------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/phpunit/BltTest.php b/tests/phpunit/BltTest.php index e46e046e2..b07d6920f 100644 --- a/tests/phpunit/BltTest.php +++ b/tests/phpunit/BltTest.php @@ -26,22 +26,22 @@ 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') ); } diff --git a/tests/phpunit/DeployTest.php b/tests/phpunit/DeployTest.php index 10b03ea70..d0bd801d3 100644 --- a/tests/phpunit/DeployTest.php +++ b/tests/phpunit/DeployTest.php @@ -19,7 +19,7 @@ public function __construct() { $this->projectDirectory = realpath(dirname(__FILE__) . '/../../'); $this->newProjectDir = dirname($this->projectDirectory) . '/blt-project'; $this->config = Yaml::parse(file_get_contents("{$this->newProjectDir}/project.yml")); - $this->deploy_dir = $this->new_project_dir . '/deploy'; + $this->deploy_dir = $this->newProjectDir . '/deploy'; } /** diff --git a/tests/phpunit/DrupalVmTest.php b/tests/phpunit/DrupalVmTest.php index a0b0a65b7..8f2ab432f 100644 --- a/tests/phpunit/DrupalVmTest.php +++ b/tests/phpunit/DrupalVmTest.php @@ -24,33 +24,33 @@ public function __construct() { * 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') ); } From 49acafcb27eb353b818e2bf894dbaf7b82208655 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Wed, 20 Jul 2016 19:47:16 -0400 Subject: [PATCH 06/27] Fixing executables. --- bin/blt | 2 ++ blt.sh | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/blt b/bin/blt index 64826b23b..80d102380 100755 --- a/bin/blt +++ b/bin/blt @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + if [ "`git rev-parse --show-cdup 2> /dev/null`" != "" ]; then GIT_ROOT=$(git rev-parse --show-cdup) else diff --git a/blt.sh b/blt.sh index db7144a6b..e98581a5f 100755 --- a/blt.sh +++ b/blt.sh @@ -13,9 +13,7 @@ if [[ $COMPOSER_IS_INSTALLED -ne 0 ]]; then fi SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -echo $SCRIPT_DIR BIN=$(cd ${SCRIPT_DIR}/../../bin && pwd) -echo $BIN PHING=${BIN}/phing if [ ! -f ${PHING} ]; then From 04465667d21c0b51679c2daecbb331910ca2bcae Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Wed, 20 Jul 2016 19:50:03 -0400 Subject: [PATCH 07/27] Removing unnecessary git fetch. --- .travis.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index bbdc46cd4..6d369728d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,6 @@ addons: - svn-5223.devcloud.hosting.acquia.com before_install: - - ls -lash ~/.composer/cache # 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 - composer selfupdate @@ -38,10 +37,10 @@ before_install: - mysql -e 'CREATE DATABASE drupal;' install: - # Remove acquia packages from cache before running `composer install`. - - rm -rf vendor/acquia # 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 # Install proper version of node for front end tasks. @@ -59,8 +58,6 @@ before_script: script: # Ensure code quality of 'blt' itself. - phpcs --standard=./vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml tests - # It is necessary to fetch the full git history in order to use a local composer package in blt-project. - - git fetch --unshallow # Generate a new 'blt-project' project. - cp -R blt-project ../ - cd ../blt-project From dbcbf1377c83b50eda5f077a5da60d0510f1e302 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 21 Jul 2016 13:32:22 -0400 Subject: [PATCH 08/27] Making phpcs filesets configurable. --- phing/build.yml | 6 ++++++ phing/tasks/validate.xml | 38 +++++++++----------------------------- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/phing/build.yml b/phing/build.yml index c0699d220..4941f91a9 100644 --- a/phing/build.yml +++ b/phing/build.yml @@ -45,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/phing/tasks/validate.xml b/phing/tasks/validate.xml index 25673b7c8..58ed5ba36 100644 --- a/phing/tasks/validate.xml +++ b/phing/tasks/validate.xml @@ -58,38 +58,18 @@ + + - - - - - - - - - - - - + - + standard="${phpcs.ruleset}" + showSniffs="false" + showWarnings="true" + haltonerror="true" + haltonwarning="true"> + From e8b7842dd58d7e0619720130d02e90c8a9d9b73a Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Fri, 22 Jul 2016 16:15:05 -0400 Subject: [PATCH 09/27] Working on upgrade path. --- .travis.yml | 1 + CONTRIBUTING.md | 37 ++++++++- INSTALL.md | 84 +++++++++++++------- README.md | 40 +++------- application.php | 13 --- bin/blt-console | 25 ++++++ blt-project/README.md | 17 +--- composer.json | 5 +- phing/build.xml | 2 + phing/tasks/blt.xml | 11 +-- scripts/blt/convert-to-composer.sh | 75 ++++++++++++++--- scripts/drupal/update-scaffold | 26 ------ src/Console/Command/ComposerMungeCommand.php | 7 +- template/composer.json | 2 - template/project.yml | 7 +- 15 files changed, 211 insertions(+), 141 deletions(-) delete mode 100644 application.php create mode 100755 bin/blt-console mode change 100644 => 100755 scripts/blt/convert-to-composer.sh delete mode 100755 scripts/drupal/update-scaffold diff --git a/.travis.yml b/.travis.yml index 6d369728d..da4b90b9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ language: php php: - 5.6 + - 7 cache: bundler: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 82cd773f7..8c1583f2a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,39 @@ -#### Why are you using both Phing and Symfony commands? +# 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. diff --git a/INSTALL.md b/INSTALL.md index 3a03af39a..215fbe9d0 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 and existing project +* Updating to the latest version of BLT + * Updating from a non-composer-managed version + * Updating a composer-managed version ## System Requirements @@ -15,42 +13,68 @@ 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) +* [NPM](https://nodejs.org/en/download/) (for [Lightning](https://github.com/acquia/lightning) support) -## Prepare BLT installer +## Creating a new project with BLT -* Clone BLT to your local machine on your native OS: - `git clone https://github.com/acquia/blt.git` +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. Create a new project and add acquia/blt as a composer dependency +1. Generate and modify configuration files for your new project +1. Build your new project’s dependencies +1. Setup a local *AMP stack +1. Install Drupal locally via BLT -# 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: +### Generate and modify configuration files -* project.yml -* local.settings.php +1. Create a new empty directory for your project. -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: + ``` + mkdir myproject + cd myproject + ``` +1. (optional) Globally install pretissimo for parallelized composer downloads: -* Local site DB credentials: `$databases` in local.settings.php + ``` + composer global require "hirak/prestissimo:^0.3" + ``` +1. Initialize Composer and install BLT: -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. + ``` + composer init --stability=dev + composer config prefer-stable true + composer require acquia/blt:~8 + ``` + * Do not define dependencies or dev dependencies interactively. +1. Install BLT alias and initialize BLT: -## Create a new project + ``` + ./vendor/acquia/blt/blt.sh install-alias + blt init + ``` +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: -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 + ``` + blt configure + ``` +1. Update your project with new dependencies that were added BLT: -Run `./blt.sh create` to do all the things! + ``` + composer update + ``` -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 +### Modify project files This is an optional step. Important files that you may want to modify include: @@ -65,7 +89,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) 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/application.php b/application.php deleted file mode 100644 index b3dcc2506..000000000 --- a/application.php +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env php -add(new ComposerMungeCommand()); -$application->add(new YamlMungeCommand()); -$application->run(); 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/README.md b/blt-project/README.md index 93d647a65..fa7e0ac3c 100644 --- a/blt-project/README.md +++ b/blt-project/README.md @@ -1,18 +1,3 @@ This directory is used to aid in the development and testing of BLT. -Use the following commands to create a testable BLT-created project: - -``` -cp -R blt/blt-project . -cd blt-project -composer install -export $PATH=$(pwd)/vendor/bin:$PATH -blt init -blt configure -composer update -blt setup -blt test -blt deploy:build -``` - -This will fully create, BLTify, install, tests, and generate a deployment artifact for the blt-project. The acquia/blt dependency in blt-project will be symlinked to ../blt, which enables simple iterative development and testing of both BLT and a BLT-created project in parallel. +See CONTRIBUTING.md for instructions on how you can develop BLT locally. diff --git a/composer.json b/composer.json index 16bf4e127..e2303829e 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,10 @@ "autoload": { "psr-4": {"Acquia\\Blt\\": "src/"} }, - "bin": ["bin/blt"], + "bin": [ + "bin/blt", + "bin/blt-console" + ], "minimum-stability": "beta", "prefer-stable": true, "scripts": { diff --git a/phing/build.xml b/phing/build.xml index bd78ed8bc..54c3a533d 100644 --- a/phing/build.xml +++ b/phing/build.xml @@ -53,6 +53,8 @@ + + diff --git a/phing/tasks/blt.xml b/phing/tasks/blt.xml index c5bc44055..e2178f5c2 100644 --- a/phing/tasks/blt.xml +++ b/phing/tasks/blt.xml @@ -1,5 +1,5 @@ - + BLT files have been copied to your project directory. Please customize ${repo.root}/project.yml and then run: blt configure @@ -20,20 +20,21 @@ - Merging BLT's composer.json template with your project's composer.json + Merging BLT's composer.json template with your project's composer.json. This MAY overwrite some existing values. - php application.php composer:munge ${repo.root}/composer.json ${blt.root}/template/composer.json > ${repo.root}/composer.json.tmp" - + ${repo.root}/vendor/bin/blt-console composer:munge ${repo.root}/composer.json ${blt.root}/template/composer.json > ${repo.root}/composer.json.tmp + 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. diff --git a/scripts/blt/convert-to-composer.sh b/scripts/blt/convert-to-composer.sh old mode 100644 new mode 100755 index 1761b4f8e..df95225d3 --- a/scripts/blt/convert-to-composer.sh +++ b/scripts/blt/convert-to-composer.sh @@ -1,15 +1,64 @@ #!/usr/bin/env bash -echo "Note that you will lose any custom scripts in build/custom" - -# Move values from custom/build.yml to project.yml. -cat build/custom/phing/build.yml >> project.yml -# Remove unneeded files. -rm -rf build bolt.sh tests/phpunit/blt -# @todo remove old alias! -# Install (new) alias -./vendor/acquia/blt/blt.sh install-alias -blt init -blt configure - -# Move build/custom/files to new locations (e.g., deploy excludes or .gitignores). +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 "" >> project.yml + cat build/custom/phing/build.yml >> project.yml + fi + + # Move build/custom/files to new locations (e.g., deploy excludes or .gitignores). + mkdir blt + mv build/custom blt + + + # Remove unneeded files. + rm -rf build blt.sh tests/phpunit/blt + + # Install (new) alias + yes | ./vendor/acquia/blt/blt.sh install-alias + source $DETECTED_PROFILE + blt init + blt 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/scripts/drupal/update-scaffold b/scripts/drupal/update-scaffold deleted file mode 100755 index fde65bfef..000000000 --- a/scripts/drupal/update-scaffold +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -e - -ROOT=$(pwd) -DRUSH=$ROOT/vendor/bin/drush -VERSION=${1:-drupal-8} -DRUPAL_TEMP=$(mktemp -d) - -$DRUSH dl "$VERSION" --root=$DRUPAL_TEMP --destination=$DRUPAL_TEMP --drupal-project-rename=drupal-8 --quiet -y - -rsync -avz --delete $DRUPAL_TEMP/drupal-8/ "$ROOT/docroot" \ - --exclude=.gitkeep \ - --exclude=autoload.php \ - --exclude=composer.json \ - --exclude=composer.lock \ - --exclude=core \ - --exclude=drush \ - --exclude=example.gitignore \ - --exclude=LICENSE.txt \ - --exclude=README.txt \ - --exclude=vendor \ - --exclude=sites \ - --exclude=themes \ - --exclude=profiles \ - --exclude=modules - -rm -rf $DRUPAL_TEMP/drupal-8 diff --git a/src/Console/Command/ComposerMungeCommand.php b/src/Console/Command/ComposerMungeCommand.php index 3ba9bcf70..d0d8ae3d5 100644 --- a/src/Console/Command/ComposerMungeCommand.php +++ b/src/Console/Command/ComposerMungeCommand.php @@ -44,8 +44,11 @@ protected function execute(InputInterface $input, OutputInterface $output) * @param $file2 */ protected function munge($file1, $file2) { - $file1_contents = (array) json_decode(file_get_contents($file1), true); - $file2_contents = (array) json_decode(file_get_contents($file2), true); + $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']); diff --git a/template/composer.json b/template/composer.json index c71cbcd32..13234e51c 100644 --- a/template/composer.json +++ b/template/composer.json @@ -1,8 +1,6 @@ { - "name": "${project.vendor_name}/${project.machine_name}", "license": "proprietary", "type": "project", - "description": "${project.description}", "repositories": [ { "type": "composer", diff --git a/template/project.yml b/template/project.yml index 1eb3e7ea7..0da5237c6 100644 --- a/template/project.yml +++ b/template/project.yml @@ -1,8 +1,4 @@ project: - # The project's composer.json will be updated with the below vendor_name and description - # and should be updated directly to change these values after initial creation. - vendor_name: 'acquia' - description: 'A short description of the package. Usually this is just one line long.' # Everyone: This will determine the the directory name of the new repository. # Dev Desktop users: this should match your local site name. machine_name: 'blted8' @@ -61,6 +57,9 @@ target-hooks: dir: ${docroot}/profiles/contrib/lightning command: npm run install-libraries +# Define any custom Phing files that you'd like to import. E.g., ${repo.root}/blt/phing/build.xml +imports: [] + # Hosting environment flags. # Examples: acsf (Acquia Cloud Site Factory), ac (Acquia Cloud) # hosting: "acsf" From 1e466279506f883c2f6c47f7ca52b152b0053ea4 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 1 Aug 2016 11:37:02 -0400 Subject: [PATCH 10/27] Updating install docs and process. --- INSTALL.md | 56 ++++++++++++++++++++---------------- phing/tasks/blt.xml | 2 +- phing/tasks/setup.xml | 2 +- scripts/blt/install-alias.sh | 7 +++++ 4 files changed, 40 insertions(+), 27 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 215fbe9d0..d9f5d88ce 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,10 +2,10 @@ * System requirements * [Creating a new project with BLT](#creating-new) -* Adding BLT to and existing project -* Updating to the latest version of BLT - * Updating from a non-composer-managed version - * Updating a composer-managed version +* [Adding BLT to and 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 @@ -21,23 +21,12 @@ You should be able to use the following tools on the command line of your native ## Creating a new project with BLT -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. Create a new project and add acquia/blt as a composer dependency -1. Generate and modify configuration files for your new project -1. Build your new project’s dependencies -1. Setup a local *AMP stack -1. Install Drupal locally via BLT - - -### Generate and modify configuration files - -1. Create a new empty directory for your project. +1. Create a new empty directory for your project and initialize it as a new Git repository. ``` mkdir myproject cd myproject + git init ``` 1. (optional) Globally install pretissimo for parallelized composer downloads: @@ -72,15 +61,32 @@ The following high-level steps will be required to generate a new, fully functio ``` composer update ``` + This command may take a long time to run. It is recursively discovering and downloading all of your project's upstream dependencies. +1. Modify 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. +1. Commit new a modified project files to Git: + ``` + git add -A + git commit + ``` + +## Adding BLT to and 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. Follow instructions under "Creating a new project with BLT", starting at step 2. +## Updating to the latest version of BLT -### Modify project files +### Updating from a non-composer-managed version -This is an optional step. Important files that you may want to modify include: +### Updating a composer-managed version -* 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. 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. @@ -98,9 +104,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 @@ -109,7 +115,7 @@ 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 diff --git a/phing/tasks/blt.xml b/phing/tasks/blt.xml index e2178f5c2..ef388ac01 100644 --- a/phing/tasks/blt.xml +++ b/phing/tasks/blt.xml @@ -8,7 +8,7 @@ Copying files from BLT's template into your project. - + diff --git a/phing/tasks/setup.xml b/phing/tasks/setup.xml index dc2e899c8..6cce0e1e2 100644 --- a/phing/tasks/setup.xml +++ b/phing/tasks/setup.xml @@ -162,7 +162,7 @@ - + diff --git a/scripts/blt/install-alias.sh b/scripts/blt/install-alias.sh index a2d43b9fa..ddb230570 100755 --- a/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 From a03d89e0c67af1d12048accbbf3a335e58ba3df7 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Wed, 3 Aug 2016 12:42:22 -0400 Subject: [PATCH 11/27] Making setup tasks more verbose. --- phing/tasks/setup.xml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/phing/tasks/setup.xml b/phing/tasks/setup.xml index 6cce0e1e2..6cb7841f1 100644 --- a/phing/tasks/setup.xml +++ b/phing/tasks/setup.xml @@ -8,7 +8,7 @@ - Attempting to generate tests/behat/local.yml using tests/behat/example.local.yml. + Attempting to generate tests/behat/local.yml. @@ -26,8 +26,9 @@ - - + + Removing all composer managed dependencies. + @@ -38,13 +39,15 @@ + - + + Making ${docroot}/sites/default writable. @@ -55,10 +58,13 @@ + Making ${docroot}/sites/default/settings.php writable. Ensuring that blt.settings.php is required by settings.php + Generating local settings files. + @@ -82,14 +88,17 @@ - - - - - + + Replacing placeholders in local settings files. + + + + + + @@ -99,6 +108,7 @@ description="Installs a specific Drupal site." depends="setup:drupal:settings, setup:hash-salt, configure"> + Installing Drupal. @@ -113,6 +123,7 @@ + Making ${docroot}/sites/default writable. @@ -129,6 +140,7 @@ + Importing configuration. config @@ -143,12 +155,15 @@ + Removing ${repo.root}/.git/hooks, if it exists. + Symlinking ${repo.root}/scripts/git-hooks to ${repo.root}/.git/hooks. + Making git hooks executable. @@ -164,6 +179,7 @@ + Writing hash salt to ${repo.root}/salt.txt From bd4da05aac110b6f4511d9c4a9517a818d0cc56d Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Wed, 3 Aug 2016 12:45:26 -0400 Subject: [PATCH 12/27] Using fork of composer-patches. --- template/composer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/template/composer.json b/template/composer.json index 13234e51c..faefb2cae 100644 --- a/template/composer.json +++ b/template/composer.json @@ -5,11 +5,15 @@ { "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", From 7d699c01d2a17d7c7c3966ac8bb35b54853db358 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Wed, 3 Aug 2016 13:26:19 -0400 Subject: [PATCH 13/27] Adding update instructions. --- INSTALL.md | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index d9f5d88ce..276c75042 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -19,6 +19,8 @@ You should be able to use the following tools on the command line of your native * [Linux](http://php.net/manual/en/install.unix.debian.php) * [NPM](https://nodejs.org/en/download/) (for [Lightning](https://github.com/acquia/lightning) support) +_If you have xDebug enabled for your PHP CLI binary, it is highly recommended that you disable it._ + ## Creating a new project with BLT 1. Create a new empty directory for your project and initialize it as a new Git repository. @@ -33,14 +35,18 @@ You should be able to use the following tools on the command line of your native ``` composer global require "hirak/prestissimo:^0.3" ``` -1. Initialize Composer and install BLT: +1. Initialize Composer: ``` composer init --stability=dev - composer config prefer-stable true - composer require acquia/blt:~8 ``` * Do not define dependencies or dev dependencies interactively. + +1. Add BLT to project: + ``` + composer config prefer-stable true + composer require acquia/blt:~8 --dev + ``` 1. Install BLT alias and initialize BLT: ``` @@ -56,7 +62,7 @@ You should be able to use the following tools on the command line of your native ``` blt configure ``` -1. Update your project with new dependencies that were added BLT: +1. Update your project with new dependencies that were added by BLT: ``` composer update @@ -67,10 +73,12 @@ You should be able to use the following tools on the command line of your native * Project’s root README.md. * Other project documentation in the readme directory. 1. Commit new a modified project files to Git: + ``` git add -A git commit ``` +1. Follow instructions for installing Drupal locally. ## Adding BLT to and existing project @@ -81,12 +89,25 @@ To add BLT to a pre-existing Drupal project, do the following: 1. `cd` into your existing project directory. 1. Follow instructions under "Creating a new project with BLT", starting at step 2. -## Updating to the latest version of BLT - -### Updating from a non-composer-managed version +## 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: + +``` +composer require acquia/blt:~8 +./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. @@ -104,7 +125,7 @@ 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 local dependencies and install Drupal locally +## Build your project’s local dependencies and install Drupal locally Run the following command from the project root: `blt local:setup`. This will do a lot of things for you, including: From c001763d54f9ab3f71a3d362da40baba01f3f166 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Wed, 3 Aug 2016 19:10:54 -0400 Subject: [PATCH 14/27] More improvements to verbosity. --- phing/build.xml | 2 ++ phing/tasks/properties.xml | 12 ++++++------ phing/tasks/setup.xml | 6 +++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/phing/build.xml b/phing/build.xml index 54c3a533d..514127d52 100644 --- a/phing/build.xml +++ b/phing/build.xml @@ -67,6 +67,8 @@ + Executing command in ${target-hooks.${hook-name}.dir}: + ${target-hooks.${hook-name}.command} diff --git a/phing/tasks/properties.xml b/phing/tasks/properties.xml index 691f4781e..24c8afd8b 100644 --- a/phing/tasks/properties.xml +++ b/phing/tasks/properties.xml @@ -2,17 +2,17 @@ - + - + - + - + @@ -38,6 +38,6 @@ - - + + diff --git a/phing/tasks/setup.xml b/phing/tasks/setup.xml index 6cb7841f1..65a917d52 100644 --- a/phing/tasks/setup.xml +++ b/phing/tasks/setup.xml @@ -174,14 +174,18 @@ + Checking for hash salt in ${repo.root}/salt.txt + Writing hash salt to ${repo.root}/salt.txt - Writing hash salt to ${repo.root}/salt.txt + + ${repo.root}/salt.txt already exists. + From 9c57ffa154793474ec9a7c488951ac2fc4692977 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 4 Aug 2016 11:14:19 -0400 Subject: [PATCH 15/27] debug --- .gitignore | 3 --- blt-project/.gitignore | 2 ++ phing/tasks/blt.xml | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 blt-project/.gitignore diff --git a/.gitignore b/.gitignore index a9d352f96..7feca236a 100644 --- a/.gitignore +++ b/.gitignore @@ -100,6 +100,3 @@ nbproject/* # Some files should be excluded from blt but not from the projects it # generates, so they must be specified here rather than in template/.gitignore. template/.idea/.name - -blt-project/composer.lock -blt-project/vendor 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/phing/tasks/blt.xml b/phing/tasks/blt.xml index ef388ac01..bdde8ee9a 100644 --- a/phing/tasks/blt.xml +++ b/phing/tasks/blt.xml @@ -8,7 +8,7 @@ Copying files from BLT's template into your project. - + @@ -23,7 +23,6 @@ Merging BLT's composer.json template with your project's composer.json. This MAY overwrite some existing values. - ${repo.root}/vendor/bin/blt-console composer:munge ${repo.root}/composer.json ${blt.root}/template/composer.json > ${repo.root}/composer.json.tmp From 3eb62918857098f3dd5c9a3f354633164e7d4427 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 4 Aug 2016 14:10:20 -0400 Subject: [PATCH 16/27] Fixing rsync issues. --- phing/tasks/blt.xml | 5 +++++ phing/tasks/setup.xml | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/phing/tasks/blt.xml b/phing/tasks/blt.xml index bdde8ee9a..37f05abe5 100644 --- a/phing/tasks/blt.xml +++ b/phing/tasks/blt.xml @@ -1,14 +1,19 @@ 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. + diff --git a/phing/tasks/setup.xml b/phing/tasks/setup.xml index 65a917d52..22bbe7554 100644 --- a/phing/tasks/setup.xml +++ b/phing/tasks/setup.xml @@ -61,7 +61,7 @@ Making ${docroot}/sites/default/settings.php writable. Ensuring that blt.settings.php is required by settings.php - + Generating local settings files. @@ -92,7 +92,8 @@ - Replacing placeholders in local settings files. + Expanding Phing variables in ${docroot}/sites/${multisite.name}/local.drushrc.php. + From ec3668b7ed8926d6d7ec380aa36bfc981560a22d Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 4 Aug 2016 15:45:51 -0400 Subject: [PATCH 17/27] updating instructions. --- INSTALL.md | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 276c75042..ec46bf62c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -104,10 +104,33 @@ blt update 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: -``` -composer require acquia/blt:~8 -./vendor/acquia/blt/scripts/blt/convert-to-composer.sh -``` +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. From aeb3b04c90565892a5b35a809879c3bf61a5e750 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 4 Aug 2016 16:00:11 -0400 Subject: [PATCH 18/27] fixing upgrade script. --- INSTALL.md | 6 +++--- phing/tasks/blt.xml | 10 +++++++--- scripts/blt/convert-to-composer.sh | 11 +++++++---- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index ec46bf62c..773efc23f 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -68,17 +68,17 @@ _If you have xDebug enabled for your PHP CLI binary, it is highly recommended th composer update ``` This command may take a long time to run. It is recursively discovering and downloading all of your project's upstream dependencies. -1. Modify project files. This is an optional step. Important files that you may want to modify include: +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. Commit new a modified project files to Git: +1. (optional) Commit new a modified project files to Git: ``` git add -A git commit ``` -1. Follow instructions for installing Drupal locally. +1. (optional) Follow instructions for installing Drupal locally. ## Adding BLT to and existing project diff --git a/phing/tasks/blt.xml b/phing/tasks/blt.xml index 37f05abe5..024ea8d2c 100644 --- a/phing/tasks/blt.xml +++ b/phing/tasks/blt.xml @@ -1,5 +1,5 @@ - + BLT files have been copied to your project directory. Some of your existing files may have been modified. @@ -45,14 +45,18 @@ + Making ${docroot}/sites/default/settings.php writable. + + Expanding Phing properties in BLT files. - - + + + diff --git a/scripts/blt/convert-to-composer.sh b/scripts/blt/convert-to-composer.sh index df95225d3..d0a3fb8df 100755 --- a/scripts/blt/convert-to-composer.sh +++ b/scripts/blt/convert-to-composer.sh @@ -24,7 +24,7 @@ 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 +read -p "Continue? (y/n) " -n 1 -r echo "" if [[ $REPLY =~ ^[Yy]$ ]]; then @@ -33,23 +33,26 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then # 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 - source $DETECTED_PROFILE - blt init - blt configure + ./vendor/acquia/blt/blt.sh init + ./vendor/acquia/blt/blt.sh configure composer update echo "Update complete. Please do the following:" From e0f13e43a7cbc705a2cd72e5fa49f5799e51b632 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 4 Aug 2016 21:10:50 -0400 Subject: [PATCH 19/27] fixing travis. --- .travis.yml | 4 ++-- phing/tasks/blt.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index da4b90b9d..e9e3fa327 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,11 +70,11 @@ script: - composer install - export PATH=$TRAVIS_BUILD_DIR/../blt-project/vendor/bin:$PATH - 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 configure # Running `blt init` modified composer.json, so we must update. - composer update - # 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' # 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. diff --git a/phing/tasks/blt.xml b/phing/tasks/blt.xml index 024ea8d2c..8044371f8 100644 --- a/phing/tasks/blt.xml +++ b/phing/tasks/blt.xml @@ -45,6 +45,7 @@ + Making ${docroot}/sites/default/settings.php writable. From cc0f19722fc49225c023129e9d74f9bd55688ab8 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Fri, 5 Aug 2016 12:59:13 -0400 Subject: [PATCH 20/27] Adding create-project target. --- phing/tasks/blt.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/phing/tasks/blt.xml b/phing/tasks/blt.xml index 8044371f8..74bae5987 100644 --- a/phing/tasks/blt.xml +++ b/phing/tasks/blt.xml @@ -1,4 +1,11 @@ + + + + + + + BLT files have been copied to your project directory. Some of your existing files may have been modified. From 4347181beb79c94220eeae3e7aa81a875999d9a5 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Fri, 5 Aug 2016 13:16:34 -0400 Subject: [PATCH 21/27] Adding blt-project instructions. --- INSTALL.md | 38 +++----------------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 773efc23f..af2592790 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -23,61 +23,29 @@ _If you have xDebug enabled for your PHP CLI binary, it is highly recommended th ## Creating a new project with BLT -1. Create a new empty directory for your project and initialize it as a new Git repository. - - ``` - mkdir myproject - cd myproject - git init - ``` 1. (optional) Globally install pretissimo for parallelized composer downloads: ``` composer global require "hirak/prestissimo:^0.3" ``` -1. Initialize Composer: - - ``` - composer init --stability=dev - ``` - * Do not define dependencies or dev dependencies interactively. - -1. Add BLT to project: - ``` - composer config prefer-stable true - composer require acquia/blt:~8 --dev - ``` -1. Install BLT alias and initialize BLT: +1. Create a new project using the [blt-project](https://github.com/acquia/blt-project) template: ``` - ./vendor/acquia/blt/blt.sh install-alias - blt init + composer create-project acquia/blt-project:~8 MY_PROJECT --no-interaction ``` 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: +1. Replace tokens in new BLT-generated files with your custom values in project.yml: ``` blt configure ``` -1. Update your project with new dependencies that were added by BLT: - - ``` - composer update - ``` - This command may take a long time to run. It is recursively discovering and downloading all of your project's upstream dependencies. 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) Commit new a modified project files to Git: - - ``` - git add -A - git commit - ``` 1. (optional) Follow instructions for installing Drupal locally. ## Adding BLT to and existing project From 342c4f9c4e72e74d111103a57f3812083125acf3 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Fri, 5 Aug 2016 13:26:44 -0400 Subject: [PATCH 22/27] Installing alias as part of init. --- INSTALL.md | 11 ++++++++++- phing/tasks/blt.xml | 5 +++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index af2592790..b3fde567e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -55,7 +55,16 @@ 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. Follow instructions under "Creating a new project with BLT", starting at step 2. +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 diff --git a/phing/tasks/blt.xml b/phing/tasks/blt.xml index 74bae5987..3babf75c0 100644 --- a/phing/tasks/blt.xml +++ b/phing/tasks/blt.xml @@ -1,12 +1,13 @@ - + + - + BLT files have been copied to your project directory. Some of your existing files may have been modified. From 03fd8edeb07fa7bc3adbf5d882ef89e897ff71de Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Fri, 5 Aug 2016 13:45:40 -0400 Subject: [PATCH 23/27] fixing travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e9e3fa327..db99de46d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ script: # BLT is the only dependency at this point. Install it. - composer install - export PATH=$TRAVIS_BUILD_DIR/../blt-project/vendor/bin:$PATH - - blt init + - 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 configure From cb5b1a4e4d2219c9e804771085e8e63736f817b3 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Fri, 5 Aug 2016 15:08:41 -0400 Subject: [PATCH 24/27] more docs fixes. --- INSTALL.md | 27 +++++++++++++++------------ phing/build.xml | 2 +- phing/tasks/blt.xml | 2 +- phing/tasks/properties.xml | 2 +- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index b3fde567e..96db8c136 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -19,19 +19,27 @@ You should be able to use the following tools on the command line of your native * [Linux](http://php.net/manual/en/install.unix.debian.php) * [NPM](https://nodejs.org/en/download/) (for [Lightning](https://github.com/acquia/lightning) support) -_If you have xDebug enabled for your PHP CLI binary, it is highly recommended that you disable it._ +### Recommended tools and configuration -## Creating a new project with BLT - -1. (optional) Globally install pretissimo for parallelized composer downloads: +* 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 MY_PROJECT --no-interaction + 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` @@ -48,7 +56,7 @@ _If you have xDebug enabled for your PHP CLI binary, it is highly recommended th * Other project documentation in the readme directory. 1. (optional) Follow instructions for installing Drupal locally. -## Adding BLT to and existing project +## Adding BLT to an existing project To add BLT to a pre-existing Drupal project, do the following: @@ -140,9 +148,4 @@ Note that all common project tasks are executed through `blt`. For a full list o ## 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/phing/build.xml b/phing/build.xml index 514127d52..602874dae 100644 --- a/phing/build.xml +++ b/phing/build.xml @@ -56,7 +56,7 @@ diff --git a/phing/tasks/blt.xml b/phing/tasks/blt.xml index 3babf75c0..144bd4674 100644 --- a/phing/tasks/blt.xml +++ b/phing/tasks/blt.xml @@ -7,7 +7,7 @@ - + BLT files have been copied to your project directory. Some of your existing files may have been modified. diff --git a/phing/tasks/properties.xml b/phing/tasks/properties.xml index 24c8afd8b..ca0fcbf92 100644 --- a/phing/tasks/properties.xml +++ b/phing/tasks/properties.xml @@ -19,7 +19,7 @@ - + From 4989b2ce62a47f90c397bb03fba65d6130695a01 Mon Sep 17 00:00:00 2001 From: JS Carter Date: Sun, 7 Aug 2016 18:50:39 -0400 Subject: [PATCH 25/27] Replace blt sh mentions with blt alias. (#263) --- phing/README.md | 6 +++--- phing/example.multisite.yml | 2 +- phing/tasks/deploy.xml | 2 +- phing/tasks/setup.xml | 2 +- scripts/tugboat/README.md | 2 +- template/.travis.yml | 4 ++-- template/readme/acsf-setup.md | 2 +- template/readme/deploy.md | 6 +++--- template/readme/local-development.md | 6 +++--- template/readme/onboarding.md | 8 ++++---- template/readme/project-tasks.md | 16 ++++++++-------- template/tests/README.md | 6 +++--- template/tests/behat/example.local.yml | 2 +- 13 files changed, 32 insertions(+), 32 deletions(-) diff --git a/phing/README.md b/phing/README.md index 68428d039..e3f3b6139 100644 --- a/phing/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/phing/example.multisite.yml b/phing/example.multisite.yml index 8b0bb045c..0c9eee650 100644 --- a/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/phing/tasks/deploy.xml b/phing/tasks/deploy.xml index c880afad8..7519aa5a8 100644 --- a/phing/tasks/deploy.xml +++ b/phing/tasks/deploy.xml @@ -11,7 +11,7 @@ - + diff --git a/phing/tasks/setup.xml b/phing/tasks/setup.xml index 22bbe7554..091a8767f 100644 --- a/phing/tasks/setup.xml +++ b/phing/tasks/setup.xml @@ -3,7 +3,7 @@ For a full list of available Phing targets, run: - ./blt.sh -l + blt -l diff --git a/scripts/tugboat/README.md b/scripts/tugboat/README.md index 557186fd3..c7b5b098d 100644 --- a/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/.travis.yml b/template/.travis.yml index 11b135ab4..a0019ea64 100644 --- a/template/.travis.yml +++ b/template/.travis.yml @@ -61,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/readme/acsf-setup.md b/template/readme/acsf-setup.md index aa09eba36..b36db37db 100644 --- a/template/readme/acsf-setup.md +++ b/template/readme/acsf-setup.md @@ -3,7 +3,7 @@ To configure a project to run on ACSF, perform the following steps after initially setting up BLT: 1. Add the following line to project.yml: `hosting: "acsf"`. This ensures that the correct settings files are added to the deployment artifact. -1. Execute `./blt.sh acsf:init` from the project root. +1. Execute `blt acsf:init` from the project root. 1. Ensure that `drupal/acsf` is a listed dependency in your composer.json file: `composer require drupal/acsf:~8` 1. Add the acsf module as a dependency to your installation profile diff --git a/template/readme/deploy.md b/template/readme/deploy.md index 25a2924fd..77292edf6 100644 --- a/template/readme/deploy.md +++ b/template/readme/deploy.md @@ -22,7 +22,7 @@ Ensure your ACE remote is listed in project.yml under git:remotes. In order to create the build artifact in `/deploy`, simply run ``` -./blt.sh deploy:build +blt deploy:build ``` This task is analogous to `setup:build` but with a few critical differences: @@ -38,7 +38,7 @@ After the artifact is created, you can inspect it or even run it as a website lo To both create and deploy the build artifact in a single command, run the following command ```` -./blt.sh deploy -Ddeploy.branch=develop-build -Ddeploy.commitMsg='BLT-123: The commit message.' +blt deploy -Ddeploy.branch=develop-build -Ddeploy.commitMsg='BLT-123: The commit message.' ```` This command will commit the artifact to the `develop-build` branch with the specified commit message and push it to the remotes defined in project.yml. @@ -48,7 +48,7 @@ This command will commit the artifact to the `develop-build` branch with the spe If you would like to create, commit, but _not push_ the artifact, you may do a dry run: ```` -./blt.sh deploy -Ddeploy.branch=develop-build -Ddeploy.commitMsg='BLT-123: The commit message.' -Ddeploy.dryRun=true +blt deploy -Ddeploy.branch=develop-build -Ddeploy.commitMsg='BLT-123: The commit message.' -Ddeploy.dryRun=true ```` This is helpful for debugging deployment artifacts. diff --git a/template/readme/local-development.md b/template/readme/local-development.md index 719905a80..445aa9ff3 100644 --- a/template/readme/local-development.md +++ b/template/readme/local-development.md @@ -29,7 +29,7 @@ _BLT support for Drupal VM is experimental. Not all BLT features currently work To use [Drupal VM](http://www.drupalvm.com/) with a Drupal project that is generated with BLT: -1. Execute `./blt.sh vm:init` from the project root directory. +1. Execute `blt vm:init` from the project root directory. 1. Follow the Quick Start Guide in [Drupal VM's README](https://github.com/geerlingguy/drupal-vm#quick-start-guide) There are also other changes you can make if you choose to match the Acquia Cloud server configuration more closely. See Drupal VM's example configuration changes in Drupal VM's `examples/acquia/acquia.overrides.yml` file. @@ -48,11 +48,11 @@ To execute Behat tests using the 'drupal' driver on a Drupal VM environment, you 1. SSH into the VM `vagrant ssh`. 1. Change to your project directory `cd /var/www/[project.machine_name]`. 1. Assert that PhantomJS is installed for VM: `composer run-script install-phantomjs` -1. Execute behat tests `./blt.sh tests:behat` +1. Execute behat tests `blt tests:behat` #### Using the Drupal Extension's "drush" driver with Drupal VM -You may choose to write only behat tests that utilize the Drupal Extension's "drupal" driver. Doing this will allow you to run `./blt.sh tests:behat` from the host machine without modificaitons to the Behat local.yml configuration. +You may choose to write only behat tests that utilize the Drupal Extension's "drupal" driver. Doing this will allow you to run `blt tests:behat` from the host machine without modificaitons to the Behat local.yml configuration. ## Using Acquia Dev Desktop for BLT-generated projects 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 f6a113ad6..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) @@ -65,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 @@ -95,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 @@ -107,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/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 From d13c7f479b08d41990a5ab30b60f3f2e3ebec9ee Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Sun, 7 Aug 2016 18:57:13 -0400 Subject: [PATCH 26/27] Allowing custom import. --- INSTALL.md | 2 +- phing/build.xml | 12 +++++++++++- phing/tasks/properties.xml | 1 - template/project.yml | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 96db8c136..e49d8d5a2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,7 +2,7 @@ * System requirements * [Creating a new project with BLT](#creating-new) -* [Adding BLT to and existing project](#existing-project) +* [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) diff --git a/phing/build.xml b/phing/build.xml index 602874dae..70fd2baf0 100644 --- a/phing/build.xml +++ b/phing/build.xml @@ -53,7 +53,17 @@ - + + + + + Importing custom Phing file ${import}. + + + + No custom Phing file specified. + +