How do I pull content from a demo environment?

Last updated on December 2, 2021 at 2:15 pm
Learn how frontend developers can pull content from Tugboat demo environments.
This article is for:
All products

Context

  • Much of the va.gov website is static content generated at build time.  The static generation functionality is housed in the content-build repo.
  • When building, the default behavior is to pull data from the production CMS (on the first run), then, subsequently, from cache.
  • When building locally, it is often useful/necessary to pull data from an environment that is not production.  This documentation explains how to do so.

Before you start

  • You must be a developer or engineer.
  • You must have the URL for the demo environment you're trying to pull content from.
  • Some resources may require special access.

How to do it

  1. Use `yarn build`
  2. Use flag `--pull-drupal` to indicate to the build that data should be pulled from the CMS rather than from the cache.
  3. Use flag `--drupal-address` to indicate the URL of the environment from which you want to pull content (if this is omitted, but `--pull-drupal` is present, content will be pulled from the production CMS).
  4. Optional: Use flag `--use-cached-assets` to bypass the downloading of assets (images, files, etc.).  If your local work does not depend on these assets, it is recommended to use this flag.  Doing so will drastically expedite the build time.

EXAMPLE:

`yarn build --use-cached-assets --pull-drupal --drupal-address https://master-ddp5k5x2lzneepm1tv6y8gysbap7ukxc.demo.cms.va.gov`

Was this helpful?