From 8ec152973653641227d8979c8da081a0c0c719f5 Mon Sep 17 00:00:00 2001 From: Tanner Heffner Date: Thu, 21 Dec 2023 08:47:35 -0800 Subject: [PATCH] test a different theory --- .tugboat/config.yml | 4 ++++ scripts/next-start.sh | 5 ++++- scripts/vets-web-setup.sh | 27 +++++++++++++++++++++++++++ tugboat.yml | 10 +++++----- 4 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 scripts/vets-web-setup.sh diff --git a/.tugboat/config.yml b/.tugboat/config.yml index 74d46be974..74a793f7fa 100644 --- a/.tugboat/config.yml +++ b/.tugboat/config.yml @@ -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 diff --git a/scripts/next-start.sh b/scripts/next-start.sh index f4a7aa5dd1..99f1e59994 100755 --- a/scripts/next-start.sh +++ b/scripts/next-start.sh @@ -8,4 +8,7 @@ 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 +# 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 diff --git a/scripts/vets-web-setup.sh b/scripts/vets-web-setup.sh new file mode 100644 index 0000000000..efcfc64508 --- /dev/null +++ b/scripts/vets-web-setup.sh @@ -0,0 +1,27 @@ +#!/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 + git clone --single-branch --depth 1 https://github.com/department-of-veterans-affairs/vets-website.git docroot/vendor/va-gov/vets-website +else + echo "Repo vets-website already cloned." +fi + +cd docroot/vendor/va-gov/vets-website + +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 +export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=TRUE +yarn install +yarn build diff --git a/tugboat.yml b/tugboat.yml index 1272128dac..0af8f93bac 100644 --- a/tugboat.yml +++ b/tugboat.yml @@ -13,16 +13,16 @@ tasks: cmds: - drush va-gov-content-release:request:submit -# build-next: -# desc: build next.js preview server -# cmds: -# - composer va:next:build + build-next: + desc: build next.js preview server + cmds: + - composer va:next:build build: deps: - build-storybook - build-frontend -# - build-next + - build-next default: cmds: