Preview Modes

Each Preview has a mode, which sets how a Rebuild treats the content changes made in the Preview, such as changes to the database or uploaded files. The mode also applies to the automatic rebuild when new code is pushed to a pull request.

  • Development is the default mode. A Rebuild wipes out the Preview and rebuilds it, from the Base Preview if the Preview has one. Content changes made in the Preview are discarded.
  • Review mode integrates new code changes, but any content changes made in the Preview persist. A Rebuild keeps the Preview’s containers and runs only the commands from the build section of the config file. Each Rebuild in Review mode can increase the storage the Preview uses.

A Preview in Review mode shows a Review label in its info row, in the Preview list and on the Preview page. A Base Preview has no mode, because Tugboat always re-creates a Base Preview when you rebuild it. A clone of a Preview starts in Development mode.

In Review mode:

  • Changes to the Services in your config file do not take effect until you rebuild the Preview in Development mode.
  • A Preview does not pick up changes from its Base Preview, and stays marked as out of date. To update it, switch it to Development mode and rebuild it, which discards its content changes.
  • The Actions menu does not offer Refresh or Reset, because both discard the content changes that Review mode keeps. To run them from the Tugboat command-line interface (CLI), set force=true, for example tugboat reset [preview_id] force=true. A failed Preview in Review mode is the exception, and you can still Reset it (which will discard any content changes).
  • If the Preview fails, Tugboat does not rebuild it when new code is pushed, and sets a failed status on the pull request. To build the new commits, either Reset the Preview, or Rebuild it. Rebuilding a failed Preview in Review mode re-creates its containers and discards its content changes, and the Preview stays in Review mode.

A Preview in Review mode, with the Review label in its info row. Its Actions panel offers Rebuild and Clone in the left column, without Refresh or Reset, and says that content changes made in the Preview persist. A Preview in Review mode, with the Review label in its info row. Its Actions panel offers Rebuild and Clone in the left column, without Refresh or Reset, and says that content changes made in the Preview persist.

To change the mode of a Preview:

  1. Click the Settings button for the Preview.
  2. In the Preview Mode section, select Development or Review.
  3. Press the Save Configuration button.

When you switch a Preview from Review mode to Development mode, Tugboat asks you to confirm in a Switch to Development mode dialog, because the next rebuild discards the content changes made in the Preview.

To change the mode with the Tugboat CLI, use tugboat update. Switching from Review mode to Development mode needs force=true.

1tugboat update [preview_id] mode=review
2tugboat update [preview_id] mode=development force=true

To stop a Preview from changing at all, including when new code is pushed, Lock it instead.