-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VACMS-15240 Stand up running next-build server per tugboat instance (#…
…15429) * Stubbing out next server config * Updating config values to be spaces * Updating to add splash page * changing line endings * Scripts for next build * Fixed permissions issues * Attempting file permission fix * trying one more permission thing * Change permissions. * Removed tab character * Removed the actual white space that was the issue * Added yarn start to next build * Adjusting scripts for next start * Resolving issues from review * Resolving more review stuff * adding rest of the path to next-start * Adjusting scope for output * update perms * add apache proxy settings for next-build node server * add 503 error page for next-* * 503 j2 to html --------- Co-authored-by: Kit Nunnally <[email protected]> Co-authored-by: Nathan Douglas <[email protected]> Co-authored-by: Tanner Heffner <[email protected]>
- Loading branch information
1 parent
ba2b98e
commit 16d504d
Showing
12 changed files
with
246 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!-- This is a Jinja2 template without a *.j2 extension because it isn't testable in a browser with *.j2. --> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Next-build Preview not built yet</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta http-equiv="refresh" content="2" /> | ||
|
||
<style> | ||
body { | ||
/* VA.gov dark blue */ | ||
background: #112e51; | ||
text-align: center; | ||
color: white; | ||
} | ||
|
||
p { | ||
font-size: large; | ||
} | ||
|
||
a { | ||
text-decoration: underline; | ||
color: white; | ||
} | ||
|
||
.hero { | ||
margin-top: 25px; | ||
width: 70%; | ||
height: 20%; | ||
object-fit: cover; | ||
object-position: 0 80%; | ||
} | ||
|
||
.container-info { | ||
margin-bottom: 100px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<img class="hero" src="/.next/artur-pokusin-unsplash.jpg"> | ||
<h1>Next-build not ready yet</h1> | ||
<div class="container-info"> | ||
<p>The next-build server is not built & running yet.</p> | ||
<p>Check the status of the <code>composer va:next:start</code> command in the logs to learn more.</p> | ||
</div> | ||
<footer>Photo by <a href="https://unsplash.com/@arturpokusin?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Artur Pokusin</a> on <a href="https://unsplash.com/s/photos/void?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a> | ||
</footer> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!-- This is a Jinja2 template without a *.j2 extension because it isn't testable in a browser with *.j2. --> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Next-build Preview Server 503 Error</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta http-equiv="refresh" content="2" /> | ||
|
||
<style> | ||
body { | ||
/* VA.gov dark blue */ | ||
background: #112e51; | ||
text-align: center; | ||
color: white; | ||
} | ||
|
||
p { | ||
font-size: large; | ||
} | ||
|
||
a { | ||
text-decoration: underline; | ||
color: white; | ||
} | ||
|
||
.hero { | ||
margin-top: 25px; | ||
width: 70%; | ||
height: 20%; | ||
object-fit: cover; | ||
object-position: 0 80%; | ||
} | ||
|
||
.container-info { | ||
margin-bottom: 100px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<img class="hero" src="/.next/artur-pokusin-unsplash.jpg"> | ||
<h1>Next-build server 503 response</h1> | ||
<div class="container-info"> | ||
<p>There was a 503 error returned from the next-build server when it asked for this route.</p> | ||
<p>Check the status of the <code>composer va:next:start</code> command in the logs to learn more.</p> | ||
</div> | ||
<footer>Photo by <a href="https://unsplash.com/@arturpokusin?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Artur Pokusin</a> on <a href="https://unsplash.com/s/photos/void?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a> | ||
</footer> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
See /.tugboat/vhost-next.conf. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# If testing changes to this file on the tugboatqa/php:7.1-apache image (current), | ||
# use `apache2ctl -S` to check for syntax issues then `killall apache2` to get changes to take. | ||
# Or "Stop" then "Start" the preview as that will restart apache2 too. Worth noting that | ||
# `service apache2 reload|restart` doesn't work on this image as `runit` is used. | ||
# Also `sv restart apache` acts like it works but it doesn't and doesn't bubble up any errors. | ||
|
||
<VirtualHost *:80> | ||
|
||
ServerName next-wildcard | ||
# Route preview URLs with prefix of `next-` to folder where the generated site output is symlinked. | ||
# e.g. https://next-msecydk1vl7ncmpkgh8vevjhzq25vacv.ci.cms.va.gov/ | ||
ServerAlias next-* | ||
VirtualDocumentRoot /var/lib/tugboat/docroot/next/.next | ||
|
||
Alias "/.next" "/var/lib/tugboat/.next" | ||
ErrorDocument 403 /.next/403-error-document.html | ||
ErrorDocument 503 /.next/503-error-document.html | ||
|
||
<Directory /var/lib/tugboat/docroot/next/.next/> | ||
Options FollowSymLinks | ||
Require all granted | ||
</Directory> | ||
|
||
<Directory /var/lib/tugboat/.next/> | ||
Require all granted | ||
</Directory> | ||
|
||
ProxyPreserveHost on | ||
# Ignore redirecting error doc directory | ||
ProxyPass /.next/ ! | ||
# Redirect requests to the running node server from next-build | ||
ProxyPass / http://localhost:3000/ | ||
ProxyPassReverse / http://localhost:3000/ | ||
|
||
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn, | ||
# error, crit, alert, emerg. | ||
# It is also possible to configure the loglevel for particular | ||
# modules, e.g. | ||
#LogLevel debug | ||
|
||
# On Tugboat these are symlinks to /dev/null by default. | ||
# `rm /var/log/apache2/*.log` and they will be generated. | ||
# Then `tail -f /var/log/apache2/*` will work. | ||
ErrorLog ${APACHE_LOG_DIR}/error.log | ||
CustomLog ${APACHE_LOG_DIR}/access.log combined | ||
|
||
SetEnvIf X-Forwarded-Proto "^https" HTTPS=on | ||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
#preview | ||
|
||
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 | ||
|
||
cd next | ||
|
||
APP_ENV=tugboat yarn build:preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/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 the content-build dependencies. | ||
|
||
if [ ! -d next ]; then | ||
git clone --single-branch --depth 1 https://github.com/department-of-veterans-affairs/next-build.git next | ||
else | ||
echo "Repo next-build already cloned." | ||
fi | ||
|
||
cd next | ||
#repo_root="$(git rev-parse --show-toplevel)" | ||
#pushd "${repo_root}" > /dev/null | ||
|
||
nvm install 18.17.0 | ||
nvm use 18.17.0 | ||
corepack enable | ||
corepack prepare yarn@stable --activate | ||
echo "Node $(node -v)" | ||
echo "NPM $(npm -v)" | ||
echo "Yarn $(yarn -v)" | ||
|
||
#not sure how popd works | ||
#pushd "./next" | ||
yarn install | ||
#popd | ||
|
||
#popd > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/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 | ||
|
||
cd next | ||
|
||
APP_ENV=tugboat yarn start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters