Deployment strategy

Published

Updated

🔄

Options to sync files.

The deployment strategy sets how a fortrabbit deployment writes its result into the storage of an environment. Replace deletes everything not in the deployment, merge keeps existing files.

The code from Git and the results of the build commands form the deploy package. The strategy decides how it goes into the storage of the environment. The software template sets it, and the software templates page lists the strategy of each one. Apps without a template start with merge. Change it in the deployment settings.

When the repository contains a deploy file, this setting is managed there and cannot be edited in the dashboard.

Merge strategy

Merge overwrites but does not delete:

  • Files in the deploy package overwrite their copies in the storage.
  • New files are created.
  • Files in the storage that are not in the deploy package stay.

Uploads, image transforms and cache files survive without further setup. Files deleted in Git stay in the storage, though, and can confuse the software. Replace patterns name folders to swap completely. Exclude patterns keep build leftovers like node_modules out of the storage.

Replace strategy

The storage becomes an exact copy of the deploy package: everything else is deleted. This is sometimes called an immutable deployment, in line with 12-factor apps that write nothing to disk. Every deployment starts from a known state.

Exclude patterns name the files and folders that survive, such as user uploads. Without them, uploads are gone after the next deployment.

Written by humans and AI in collaboration.

AI use & editorial processEdit on GitHub ↗