Skip to content

Commit db9b560

Browse files
VACMS-12994: Install node and npm on DDEV and Tugboat (#13054)
* VACMS-12870: change DDEV and tugboat to nvm * VACMS-12870: added npm check * VACMS-12870: removed mouf installer from composer * VACMS-12870: fix for composer * VACMS-12870: reconfigured script to install nvm, nvm install after cd in build * VACMS-12870: fresh commit of all work * VACMS-12870: fix script perms, fresh composer.lock * VACMS-12870: fix for va:web:install in bash shell * VACMS-12870: fix for typo * VACMS-12994: updated composer.lock * VACMS-12994: updated composer.lockl * VACMS-12994: updated composer.lock * VACMS-12994: updated composer.lock * VACMS-12994: updated composer.lock --------- Co-authored-by: Nathan Douglas <[email protected]>
1 parent 8675401 commit db9b560

File tree

7 files changed

+30
-82
lines changed

7 files changed

+30
-82
lines changed

.ddev/config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ hooks:
1919
- exec: drush deploy
2020
post-start:
2121
- exec: ./scripts/install_task_runner.sh
22+
- exec: ./scripts/install-nvm.sh
2223
- composer: install
2324
- composer: va:theme:compile
2425
- composer: va:web:install

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.15.0
1+
16.19.1

.tugboat/config.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ services:
2424
# A set of commands to run while building this service
2525
commands:
2626
# Commands that set up the basic preview infrastructure
27-
27+
2828
# Changes made in this section will _not_ automatically take effect when
29-
# base previews are refreshed through the scheduled process! A manual
29+
# base previews are refreshed through the scheduled process! A manual
3030
# rebuild of the base preview is necessary.
3131
init:
3232
- apt-get update
3333

3434
# TODO: Add "Why" comment for Python, was this for the FE dependencies `yarn install`, if so which dependencies
3535
# so we can remove if they are removed in the future.
3636
- apt-get install python
37-
37+
3838
# General useful development tools
3939
- apt-get install jq nano
4040

@@ -128,6 +128,9 @@ services:
128128
- pecl install memcache-8.0
129129
- docker-php-ext-enable memcache
130130

131+
# Install node and npm.
132+
- ./scripts/install-nvm.sh
133+
131134
# Ensure that we're using version 2 of composer.
132135
- composer self-update --2
133136

@@ -148,9 +151,10 @@ services:
148151
# Install/update packages managed by composer, including drush.
149152
# Composer options are in composer.json, 'config' key.
150153
- composer install
151-
- ./bin/npm install
152-
- composer va:theme:compile
153-
- composer va:web:install
154+
- bash -lc 'nvm install'
155+
- bash -lc 'npm install'
156+
- bash -lc 'composer va:theme:compile'
157+
- bash -lc 'composer va:web:install'
154158

155159
- curl --remote-name https://dsva-vagov-prod-cms-backup-sanitized.s3-us-gov-west-1.amazonaws.com/files/cms-prod-files-latest.tgz
156160
- tar --extract --gunzip --file cms-prod-files-latest.tgz --directory "${DOCROOT}/sites/default/files/"
@@ -179,9 +183,10 @@ services:
179183
- j2 "${TUGBOAT_ROOT}/.web/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.web/403-error-document.html"
180184
- j2 "${TUGBOAT_ROOT}/.storybook/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.storybook/403-error-document.html"
181185
- composer install
182-
- ./bin/npm install
183-
- composer va:theme:compile
184-
- composer va:web:install
186+
- bash -lc 'nvm install'
187+
- bash -lc 'npm install'
188+
- bash -lc 'composer va:theme:compile'
189+
- bash -lc 'composer va:web:install'
185190
# https://www.drush.org/latest/deploycommand/ (updatedb, cache:rebuild, config:import, deploy:hook)
186191
- drush deploy
187192

composer.json

+1-9
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@
186186
"mglaman/phpstan-drupal": "^1.0",
187187
"michelf/php-markdown": "^2.0",
188188
"mikey179/vfsstream": "^1.6",
189-
"mouf/nodejs-installer": "^1.0",
190189
"npm-asset/dropzone": "^5.5",
191190
"npm-asset/yarn": "1.19.1",
192191
"oomphinc/composer-installers-extender": "^2.0",
@@ -297,8 +296,8 @@
297296
"drupal/core-composer-scaffold": true,
298297
"zaporylie/composer-drupal-optimizations": true,
299298
"drupal/console-extend-plugin": true,
300-
"mouf/nodejs-installer": true,
301299
"oomphinc/composer-installers-extender": true,
300+
"mouf/nodejs-installer": true,
302301
"dealerdirect/phpcodesniffer-composer-installer": true,
303302
"php-http/discovery": true
304303
}
@@ -321,13 +320,6 @@
321320
"web-root": "docroot/"
322321
}
323322
},
324-
"mouf": {
325-
"nodejs": {
326-
"version": "^16.0.0",
327-
"targetDir": "docroot/vendor/nodejs/nodejs",
328-
"forceLocal": true
329-
}
330-
},
331323
"installer-types": [
332324
"bower-asset",
333325
"npm-asset"

composer.lock

+1-62
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/install-nvm.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
# Install NVM.
4+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
5+
6+
# Make sure we can run it.
7+
export NVM_DIR="$HOME/.nvm"
8+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
9+
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
10+
11+
nvm install 16.19.1

scripts/web-install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ echo "Node $(node -v)"
1313
echo "NPM $(npm -v)"
1414
echo "Yarn $(yarn -v)"
1515

16-
./scripts/composer/check-yarn-version.sh
16+
./scripts/composer/check_yarn_version.sh
1717

1818
pushd "./web"
1919
yarn run install-repos

0 commit comments

Comments
 (0)