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

Add drupal check dependency #181

Merged
merged 6 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@ jobs:
name: Configure URL in /etc/hosts
command: echo 127.0.0.1 example.ddev.site | sudo tee -a /etc/hosts

# Note: phing and drupal-check have mutually exclusive requirements.
# It'd be better to add drupal-check as a dependency of the drupal project
# rather than as part of the virtual environment, but this will have to do
# for now. Also note, drupal-check is added as part of the-vagrant so it
# is available to run within our VM.
# Note 2: drupal-check is pinned to a known stable version.
- run:
name: Install drupal-check
command: |
composer global require mglaman/drupal-check
ln -s ~/.config/composer/vendor/bin ~/bin

# Composer package cache
- restore_cache:
keys:
Expand All @@ -70,10 +58,7 @@ jobs:
# Use this copy of the-build
- run:
name: Replace the default version of the-build with this one
command: rm -r vendor/palantirnet/the-build

- checkout:
path: ~/example/vendor/palantirnet/the-build
command: composer require --dev --with-all-dependencies palantirnet/the-build:dev-${CIRCLE_BRANCH}

# Source cache - update when branch changes
- save_cache:
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
"cweagans/composer-patches": "^1.7",
"drupal/coder": "^8.3.6",
"drush/drush": "^9 || ^10",
"mglaman/drupal-check": "^1.2",
byrond marked this conversation as resolved.
Show resolved Hide resolved
"palantirnet/phing-drush-task": "^1.1",
"pear/http_request2": "^2.3",
"pear/versioncontrol_git": "@dev",
"phing/phing": "^2.14",
"phpmd/phpmd": "^2.4"
"phpmd/phpmd": "^2.4",
"phpspec/prophecy-phpunit": "^2"
},
"autoload": {
"psr-0": {
Expand Down
8 changes: 4 additions & 4 deletions defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ phpmd:
# Configuration for checking the site with the Drupal Checker code linter.
#
# @see https://github.com/mglaman/drupal-check
# These values are used in the defaults/build.xml template.
# @see defaults/build.xml
drupal-check:
# Location of the drupal-check script. This script is currently installed globally
# because of repository-level composer conflicts.
bin: "~/bin/drupal-check"
# Location of the drupal-check script. This shouldn't need to be overridden,
# but it is used in the defaults/build.xml template.
bin: "vendor/bin/drupal-check"
# Comma separated list of directories
directories: "${drupal.root}/modules/custom/,${drupal.root}/themes/custom/"

Expand Down
14 changes: 0 additions & 14 deletions defaults/install/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,6 @@ jobs:
name: Configure URL in /etc/hosts
command: echo 127.0.0.1 ${CIRCLE_PROJECT_REPONAME}.local | sudo tee -a /etc/hosts

# Note: phing and drupal-check have mutually exclusive requirements.
# It'd be better to add drupal-check as a dependency of the drupal project
# rather than as part of the virtual environment, but this will have to do
# for now. Also note, drupal-check is added as part of the-vagrant so it
# is available to run within our VM.
# Note 2: drupal-check is pinned to a known stable version.
- run:
name: Install drupal-check
command: |
curl -O -L https://github.com/mglaman/drupal-check/releases/download/1.0.9/drupal-check.phar
mkdir --parents ~/bin
mv drupal-check.phar ~/bin/drupal-check
chmod +x ~/bin/drupal-check

# Composer package cache
- restore_cache:
keys:
Expand Down
3 changes: 2 additions & 1 deletion defaults/install/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@
<!-- Separated out so that we can use foreach. drupal-check only accepts a single directory argument. -->
<target name="drupal-check" hidden="true">
<fail unless="drupal-check.dir" />
<property name="drupal-check.bin" value="~/bin/drupal-check" />
<property name="drupal-check.bin" value="vendor/bin/drupal-check" />
<property name="drupal-check.command" value="${drupal-check.bin} ${drupal-check.dir}" />

<echo msg="$> ${drupal-check.command}" />
<exec command="${drupal-check.command}" logoutput="true" checkreturn="true" />
</target>
Expand Down
3 changes: 0 additions & 3 deletions defaults/install/the-build/build.circleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@ drupal:

behat:
args: "--profile=circleci --suite=default --strict --format=junit --out=/tmp/artifacts --tags=~@skipci"

eric-schmidt marked this conversation as resolved.
Show resolved Hide resolved
drupal-check:
bin: "/home/circleci/bin/drupal-check"
7 changes: 0 additions & 7 deletions defaults/install/the-build/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ drupal:
behat:
args: "--suite=default --strict"

# Configuration for checking the site with the Drupal Checker code linter.
eric-schmidt marked this conversation as resolved.
Show resolved Hide resolved
drupal-check:
# Location of the drupal-check script. This script is currently installed globally
# on the-vagrant because of repository-level composer conflicts.
bin: "~/bin/drupal-check"


# To build an artifact from your code, add the URL to your artifact git repository.
# @see https://github.com/palantirnet/the-build/blob/release-2.0/defaults.yml
#
Expand Down