Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TECH-33 Copy phpcs.xml to different path depending on host #211

Merged
merged 6 commits into from
Feb 3, 2023

Conversation

iajon
Copy link
Contributor

@iajon iajon commented Jan 23, 2023

Overview

Modifies phpcs.xml install location for pantheon builds.

Jira ticket

Testing

I tested this using the following steps:

  1. git clone https://github.com/palantirnet/drupal-skeleton.git
  2. cd drupal-skeleton
  3. composer install
  4. cd vendor/palantirnet && rm -rf the-build
  5. git clone https://github.com/palantirnet/the-build.git
  6. cd the-build
  7. git checkout --track origin/TECH-33-update-phpcs-xml-during-the-build-install
  8. ddev start
  9. ddev ssh
  10. vendor/bin/the-build-installer
  11. When prompted, specify pantheon as the hosting platform.
  12. Once the install is complete, ensure that phpcs.xml has the following lines:
  <!-- Directories to scan. -->
  <file>web/modules/custom</file>
  <file>web/themes/custom</file>
  1. Repeat steps 1-10
  2. When prompted, specify acquia as the hosting platform.
  3. Once the install is complete, ensure that phpcs.xml has the following lines:
  <!-- Directories to scan. -->
  <file>docroot/modules/custom</file>
  <file>docroot/themes/custom</file>

@byrond
Copy link
Contributor

byrond commented Feb 2, 2023

I don't think I adequately described what we need here. We actually need to modify the contents of:
https://github.com/palantirnet/the-build/blob/develop/defaults/install/phpcs.xml

Specifically, we need to change these lines in the file when the web root is changed from docroot to web:

<file>docroot/modules/custom</file>
<file>docroot/themes/custom</file>

The file should always be copied to the project root.

See the following example:
https://github.com/palantirnet/the-build/blob/develop/targets/install.xml#L164-L173

In the above example, we are updating the installer-paths in composer.json whenever we change the web root. See:
https://github.com/palantirnet/drupal-skeleton/blob/develop/composer.json#L82-L91

Copy link
Contributor

@byrond byrond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments.

Copy link
Contributor

@byrond byrond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thank you!

@byrond byrond merged commit a390e42 into develop Feb 3, 2023
@byrond byrond deleted the TECH-33-update-phpcs-xml-during-the-build-install branch February 3, 2023 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants