Skip to content

Commit

Permalink
Merge branch 'main' into integration-service-location
Browse files Browse the repository at this point in the history
  • Loading branch information
omahane authored Oct 26, 2023
2 parents 8d7f49c + 9318d56 commit b83f4ce
Show file tree
Hide file tree
Showing 73 changed files with 2,013 additions and 784 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ datadog-setup.php
# web
# @TODO: Installer paths is not working. Leaving symlink for now.

# Ignore Next (next-build)
next

# Temporary .deb packages
*.deb

Expand Down
51 changes: 51 additions & 0 deletions .next/403-error-document.j2.html
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&amp;utm_medium=referral&amp;utm_content=creditCopyText">Artur Pokusin</a> on <a href="https://unsplash.com/s/photos/void?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>
</footer>
</body>

</html>
51 changes: 51 additions & 0 deletions .next/503-error-document.j2.html
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&amp;utm_medium=referral&amp;utm_content=creditCopyText">Artur Pokusin</a> on <a href="https://unsplash.com/s/photos/void?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>
</footer>
</body>

</html>
1 change: 1 addition & 0 deletions .next/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See /.tugboat/vhost-next.conf.
Binary file added .next/artur-pokusin-unsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 13 additions & 2 deletions .tugboat/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
- cms
- web
- storybook
- next

# Set this as the default service. This does a few things
# 1. Clones the git repository into the service container
Expand Down Expand Up @@ -49,7 +50,7 @@ services:

# Install opcache, and Apache modules
- docker-php-ext-install opcache
- a2enmod headers rewrite vhost_alias
- a2enmod headers rewrite vhost_alias proxy proxy_http
# Install datadog agent for application tracing and profiling.
- DD_API_KEY=" " DD_INSTALL_ONLY=true DD_SITE="ddog-gov.com" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"

Expand All @@ -62,6 +63,9 @@ services:
# Setup storybook-*. vhost to serve static website.
- cp "${TUGBOAT_ROOT}"/.tugboat/vhost-storybook.conf /etc/apache2/sites-enabled/

# Setup next-*. vhost to serve static website.
- cp "${TUGBOAT_ROOT}"/.tugboat/vhost-next.conf /etc/apache2/sites-enabled/

# Configure KeepAliveTimeout in apache2.conf. This is set 5 seconds longer than the internal tools ALB.
# The internal tools ALB idle timeout is set to longer than a typical GQL query takes.
- sed -e 's/KeepAliveTimeout 5/KeepAliveTimeout 185/' -i /etc/apache2/apache2.conf
Expand Down Expand Up @@ -184,11 +188,14 @@ services:
# This command is shared by the clone and build stages, make sure to update both stages.
- j2 "${TUGBOAT_ROOT}/.web/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.web/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.storybook/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.storybook/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.next/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.next/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.next/503-error-document.j2.html" -o "${TUGBOAT_ROOT}/.next/503-error-document.html"
- composer install
- bash -lc 'nvm install'
- bash -lc 'npm install'
- bash -lc 'composer va:theme:compile'
- bash -lc 'composer va:web:install'
- bash -lc 'composer va:next:install'
# https://www.drush.org/latest/deploycommand/ (updatedb, cache:rebuild, config:import, deploy:hook)
- drush deploy

Expand All @@ -212,6 +219,8 @@ services:
# This command is shared by the clone and build stages, make sure to update both stages.
- j2 "${TUGBOAT_ROOT}/.web/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.web/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.storybook/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.storybook/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.next/403-error-document.j2.html" -o "${TUGBOAT_ROOT}/.next/403-error-document.html"
- j2 "${TUGBOAT_ROOT}/.next/503-error-document.j2.html" -o "${TUGBOAT_ROOT}/.next/503-error-document.html"

online:
# We only want tests running on PRs, not branches like the base preview build of main.
Expand All @@ -224,8 +233,10 @@ services:
- find -L "${DOCROOT}/vendor/va-gov/content-build/node_modules/.bin" -type f -exec chmod +x {} \+
- find "${DOCROOT}/vendor/va-gov/content-build/script" -type f -exec chmod +x {} \+

# Build storybook and the frontend in parallel
# Build storybook and the frontends in parallel
- bash -lc 'time task --taskfile=tugboat.yml'
# Build next build server
- bash -lc 'composer va:next:start'

memcache:
image: tugboatqa/memcached:1.6
Expand Down
48 changes: 48 additions & 0 deletions .tugboat/vhost-next.conf
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>
25 changes: 22 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
"symfony/phpunit-bridge": "^5.1",
"symfony/process": "^4.0",
"symfony/routing": "^4.0",
"va-gov/content-build": "^0.0.3372",
"va-gov/content-build": "^0.0.3374",
"vlucas/phpdotenv": "^5.3",
"webflo/drupal-finder": "^1.0.0",
"webmozart/path-util": "^2.3",
Expand Down Expand Up @@ -383,7 +383,8 @@
"3047110 - Add workflow to taxonomy" : "https://www.drupal.org/files/issues/2023-04-14/3047110-45.patch",
"3106205 - Length of menu_tree.url and menu_tree.route_param_key are too short (255 characters)": "https://www.drupal.org/files/issues/2023-05-24/3106205-length-menu-tree-too-short.patch",
"3274419 - Make BaseFieldOverride inherit internal property from the base field": "https://www.drupal.org/files/issues/2023-03-13/3274419-45.patch",
"3333401 - Pager h4 cause accessibility flag on many pages": "https://www.drupal.org/files/issues/2023-07-27/3333401-56-configurable-heading-pager.patch"
"3333401 - Pager h4 cause accessibility flag on many pages": "https://www.drupal.org/files/issues/2023-07-27/3333401-56-configurable-heading-pager.patch",
"3382759 - Add multiple workflow content moderation filter to Views.": "https://www.drupal.org/files/issues/2023-08-24/3382759-8.patch"
},
"drupal/danse": {
"3364925 - added explicit access check": "https://www.drupal.org/files/issues/2023-06-05/3364925-added-explicit-access-check.patch"
Expand Down Expand Up @@ -571,7 +572,10 @@
"va:theme:watch": "Watch VA.gov Claro theme source and compile as needed.",
"va:web:build": "Perform a content build.",
"va:web:install": "Prepare the content-build project.",
"va:web:prepare-dotenv": "Prepare the ./web/.env file."
"va:web:prepare-dotenv": "Prepare the ./web/.env file.",
"va:next:install": "Prepare the next-build project",
"va:next:build": "Build the next-build server for preview",
"va:next:start": "Start the next-build server for preview"
},
"scripts": {
"pre-install-cmd": [
Expand Down Expand Up @@ -817,6 +821,21 @@
"# Prepare the ./web/.env file.",
"! ./scripts/should-run-directly.sh || ./scripts/web-prepare-dotenv.sh",
"./scripts/should-run-directly.sh || ddev composer va:web:prepare-dotenv --"
],
"va:next:install": [
"# Prepare the next build project",
"! ./scripts/should-run-directly.sh || ./scripts/next-install.sh",
"./scripts/should-run-directly.sh || ddev composer va:next:install --"
],
"va:next:build": [
"# Prepare the next build server",
"! ./scripts/should-run-directly.sh || ./scripts/next-build.sh",
"./scripts/should-run-directly.sh || ddev composer va:next:build --"
],
"va:next:start": [
"# Start the next build server",
"! ./scripts/should-run-directly.sh || ./scripts/next-start.sh",
"./scripts/should-run-directly.sh || ddev composer va:next:start --"
]
}
}
28 changes: 18 additions & 10 deletions composer.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "2029832df0507f936056503739c48520",
"content-hash": "a719753bc58db6f1e66bb30d1a538748",
"packages": [
{
"name": "alchemy/zippy",
Expand Down Expand Up @@ -6169,6 +6169,10 @@
"GPL-2.0-or-later"
],
"authors": [
{
"name": "Anybody",
"homepage": "https://www.drupal.org/user/291091"
},
{
"name": "Hydra",
"homepage": "https://www.drupal.org/user/647364"
Expand Down Expand Up @@ -10688,7 +10692,7 @@
},
"require": {
"bjeavons/zxcvbn-php": "^1.3",
"drupal/core": "^8 || ^9",
"drupal/core": "^8 || ^9 || ^10",
"drupal/password_policy": "^3.1|^4.0"
},
"type": "drupal-module",
Expand All @@ -10697,8 +10701,8 @@
"dev-2.x": "2.x-dev"
},
"drupal": {
"version": "8.x-2.0-beta1+4-dev",
"datestamp": "1668804356",
"version": "8.x-2.0-beta2+1-dev",
"datestamp": "1696647229",
"security-coverage": {
"status": "not-covered",
"message": "Dev releases are not covered by Drupal security advisories."
Expand Down Expand Up @@ -10726,6 +10730,10 @@
"name": "nerdstein",
"homepage": "https://www.drupal.org/user/1557710"
},
{
"name": "nord102",
"homepage": "https://www.drupal.org/user/3471419"
},
{
"name": "scor",
"homepage": "https://www.drupal.org/user/52142"
Expand Down Expand Up @@ -26892,16 +26900,16 @@
},
{
"name": "va-gov/content-build",
"version": "v0.0.3372",
"version": "v0.0.3374",
"source": {
"type": "git",
"url": "https://github.com/department-of-veterans-affairs/content-build.git",
"reference": "b2c66f1be86b262b28b6c086c217e6a308b3bfd7"
"reference": "3ffbbed51f3d002915d71383967db07efa1f5335"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/department-of-veterans-affairs/content-build/zipball/b2c66f1be86b262b28b6c086c217e6a308b3bfd7",
"reference": "b2c66f1be86b262b28b6c086c217e6a308b3bfd7",
"url": "https://api.github.com/repos/department-of-veterans-affairs/content-build/zipball/3ffbbed51f3d002915d71383967db07efa1f5335",
"reference": "3ffbbed51f3d002915d71383967db07efa1f5335",
"shasum": ""
},
"type": "node-project",
Expand All @@ -26928,9 +26936,9 @@
"description": "Front-end for VA.gov. This repository contains the code that generates the www.va.gov website. It contains a Metalsmith static site builder that uses a Drupal CMS for content. This file is here to publish releases to https://packagist.org/packages/va-gov/content-build, so that the CMS CI system can install it and update it using standard composer processes, and so that we can run tests across both systems. See https://github.com/department-of-veterans-affairs/va.gov-cms for the CMS repo, and stand by for more documentation.",
"support": {
"issues": "https://github.com/department-of-veterans-affairs/content-build/issues",
"source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3372"
"source": "https://github.com/department-of-veterans-affairs/content-build/tree/v0.0.3374"
},
"time": "2023-10-23T14:31:55+00:00"
"time": "2023-10-25T18:07:01+00:00"
},
{
"name": "vlucas/phpdotenv",
Expand Down
Loading

0 comments on commit b83f4ce

Please sign in to comment.