Skip to content

Running a script before deployment

Cyril Rohr edited this page Mar 13, 2026 · 2 revisions

Use the pre_script input to run a local bash script inline over SSH before PullPreview runs the selected deployment target.

This works for both deployment targets:

  • before docker compose up for deployment_target: compose
  • before the Helm release install or upgrade for deployment_target: helm

pre_script is resolved relative to app_path.

Before the script runs, PullPreview sources /etc/pullpreview/env, so your script can use values such as:

  • PULLPREVIEW_URL
  • PULLPREVIEW_PUBLIC_DNS
  • PULLPREVIEW_PUBLIC_IP
  • PULLPREVIEW_DEPLOYMENT_TARGET
  • PULLPREVIEW_NAMESPACE
  • PULLPREVIEW_RELEASE_NAME
  • PULLPREVIEW_FIRST_RUN

That makes pre_script useful for:

  • first-run seeding
  • target-specific setup
  • migrations or other one-off preparation steps

See also Environment variables.

Clone this wiki locally