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

DEV-70: Update install node dependencies task in the build #238

Merged
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
21 changes: 13 additions & 8 deletions defaults/install/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ jobs:
name: Configure URL in /etc/hosts
command: echo 127.0.0.1 ${CIRCLE_PROJECT_REPONAME}.local | sudo tee -a /etc/hosts

# Composer package cache
# Package cache
- restore_cache:
keys:
- composer-v1-
- package-cache-v1-

# Source cache
- restore_cache:
keys:
Expand All @@ -64,15 +65,19 @@ jobs:
- run:
name: Composer install
command: composer install --no-interaction --prefer-dist
- run:
name: Yarn install
command: yarn install

# Composer package cache - update when the contents of the Composer cache directory
# change
- run: ls -1R ~/.cache/composer/ > /tmp/composer-cache.txt
# Package cache. This is updated when the contents of the ~/.cache directory change.
# Both Composer and Yarn use this directory.
- run: ls -1R ~/.cache/ > /tmp/package-cache.txt
- save_cache:
key: composer-v1-{{ checksum "/tmp/composer-cache.txt" }}
key: package-cache-v1-{{ checksum "/tmp/package-cache.txt" }}
paths:
- ~/.cache/composer
# Source cache - update when branch changes
- ~/.cache

# Source cache. This is updated for each different branch.
- save_cache:
key: source-v1-{{ .Branch }}
paths:
Expand Down
26 changes: 3 additions & 23 deletions defaults/install/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<target name="eslint" depends="install-node-dependencies">
<!-- Lint custom module and theme (by default) javascript. -->
<echo msg="$> yarn run eslint --ext ${eslint.extensions} ${eslint.directory}" />
<exec command="yarn run eslint --fix-dry-run --ext ${eslint.extensions} --resolve-plugins-relative-to ${drupal.root}/core --no-error-on-unmatched-pattern ${eslint.directory}" logoutput="true" checkreturn="true" />
<exec command="yarn run eslint --fix-dry-run --ext ${eslint.extensions} --no-error-on-unmatched-pattern ${eslint.directory}" logoutput="true" checkreturn="true" />
</target>


Expand All @@ -162,28 +162,8 @@

<!-- Target: install-node-dependencies -->
<target name="install-node-dependencies" depends="" description="Install project, core, and custom module node dependencies">
<echo msg="Seeing if project npm packages are installed and at the expected version." />
<exec command="yarn install --check-files --verbose" returnProperty="project_dependencies" logoutput="true" />
<if>
<not>
<equals arg1="${project_dependencies}" arg2="0" />
</not>
<then>
<echo msg="Install project node dependencies to get eslint libraries." />
<exec dir="${drupal.root}/.." command="yarn install" logoutput="true" />
</then>
</if>
<echo msg="Seeing if Drupal core npm packages are installed and at the expected version." />
<exec dir="${drupal.root}/core" command="yarn install --check-files --verbose" returnProperty="core_dependencies" logoutput="true" />
<if>
<not>
<equals arg1="${core_dependencies}" arg2="0" />
</not>
<then>
<echo msg="Install Core node dependencies to get eslint libraries." />
<exec dir="${drupal.root}/core" command="yarn install" logoutput="true" checkreturn="true" />
</then>
</if>
<echo msg="Install project node dependencies to get eslint libraries." />
<exec dir="${drupal.root}/.." command="yarn install" logoutput="true" />
</target>


Expand Down