Skip to content

Commit

Permalink
Merge pull request #181 from palantirnet/add-drupal-check-dependency
Browse files Browse the repository at this point in the history
Add drupal check dependency
  • Loading branch information
becw authored Mar 11, 2022
2 parents 463a3f1 + 5221507 commit e4b49e2
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 46 deletions.
17 changes: 1 addition & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,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 @@ -65,10 +53,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",
"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 @@ -46,20 +46,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"

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.
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

0 comments on commit e4b49e2

Please sign in to comment.