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

VACMS-16288 use generated assets for next preview server #16340

Merged
merged 15 commits into from
Jan 2, 2024
Merged
12 changes: 11 additions & 1 deletion .tugboat/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ services:
# Install GitHub Status Updater, which updates the status of GitHub check runs.
- ./scripts/install_github_status_updater.sh

# Install & build vets-website early for next-build preview
# Build vets-website so assets are available (various widgets, fonts, etc)
- ./scripts/vets-web-setup.sh

# Commands that import files, databases, or other assets. When an
# existing preview is refreshed, the build workflow starts here,
# skipping the init step, because the results of that step will
Expand Down Expand Up @@ -203,6 +207,12 @@ services:
- bash -lc 'composer va:theme:compile'
- bash -lc 'composer va:web:install'
- bash -lc 'composer va:next:install'

# Create symlink between vets-website assets and next-build
# - ln -snf "${DOCROOT}/vendor/va-gov/vets-website/build/localhost/generated" "${TUGBOAT_ROOT}/next/public/generated"
- ln -snf "${TUGBOAT_ROOT}/vets-website/build/localhost/generated" "${TUGBOAT_ROOT}/next/public/generated"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noting that attempting to symlink to the vets-website installed inside vendor seemed to have issues either creating the symlink or building vets-website later as part of content-build.

Installing & symlinking to a different directory entirely had no issues, the assets are immediately present for the next-build server.



# https://www.drush.org/latest/deploycommand/ (updatedb, cache:rebuild, config:import, deploy:hook)
- drush deploy

Expand Down Expand Up @@ -250,7 +260,7 @@ services:
# Build storybook and the frontends (web, next) in parallel
- bash -lc 'time task --taskfile=tugboat.yml'

# Start the next build server
# Start the next build preview server
- bash -lc 'composer va:next:start'

memcache:
Expand Down
2 changes: 1 addition & 1 deletion docroot/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "echo \"Error: no test specified\" && exit 1",
"css": "node ./.storybook/cssVariables.js",
"storybook": "npm run css && storybook dev -p 6006",
"build:storybook": "npm run css && storybook build",
"build:storybook": "npm run css && storybook build --quiet",
"build:drupal": "webpack --node-env=production --progress",
"build:dev": "webpack --mode=development",
"watch": "webpack --watch"
Expand Down
4 changes: 4 additions & 0 deletions scripts/next-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ source ~/.bashrc

cd next

# Start the dev server. Vets-website assets will be available to the preview server after content-build builds them.
# APP_ENV=tugboat yarn dev

# Start the dev server. Vets-website assets need to be in place prior to this build.
APP_ENV=tugboat yarn start
29 changes: 29 additions & 0 deletions scripts/vets-web-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
source ~/.bashrc

# Installs & builds vets-website dependencies for next-build preview.
#if [ ! -d docroot/vendor/va-gov/vets-website ]; then
if [ ! -d vets-website ]; then
git clone --single-branch --depth 1 https://github.com/department-of-veterans-affairs/vets-website.git vets-website
else
echo "Repo vets-website already cloned."
fi

#cd docroot/vendor/va-gov/vets-website
cd vets-website

nvm install 14.15.1
nvm use 14.15.1
npm install -g yarn

echo "Node $(node -v)"
echo "NPM $(npm -v)"
echo "Yarn $(yarn -v)"

export NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
yarn install
yarn build
Loading