Guides

Pull-request previews

Each pull request on your repository can run as its own copy of your app at its own address, removed when the pull request closes. They start only while your server has the memory free, and never hand live data to code from a fork.

What a preview is

When someone opens a pull request on your app’s repository (on GitHub, GitLab or Bitbucket), 1ClickOps can run that version beside your live app, on the same server, at its own address. Every push to the pull request updates it. When the pull request is merged or closed, the preview is removed.

A preview’s address is not secret and has no password. Anyone who has the link can open it.
Previews come with Pro and Team.

On or off

Open your app, then Versions and staging, and find Pull Request Previews. Owners and admins choose for each app. Until someone chooses:

  • On when the app has a staging environment: previews use staging’s settings and databases, never live data.
  • On when the app has no settings at all, like a plain website.
  • Off otherwise. A preview would run with your live database, real keys and background jobs.

A preview never runs your database update command.

Pull requests from forks

A pull request from a fork, someone else’s copy of your repository, never gets a preview. Its code would run on your server with your app’s settings, and anyone can open one.

How many previews

As many as your server has memory for, up to 10 open at once for one app. Each runs as one copy and can use at most 1 CPU and 1 GB of memory, so a runaway pull request cannot starve your live site. Before a new one starts:

  • It is counted at the most it may use, 1 GB, whatever the live app uses.
  • 512 MB, or a tenth of the server if that is more, stays free for everything already there.
  • New previews on one server start one at a time, each counting the ones still starting.

While previews are on, an open preview is updated when its pull request changes; the check is only for new ones.

When a pull request gets no preview

You are told why, under Pull requests without a preview on the previews card and on the app’s history: previews are off, the pull request comes from a fork, your plan does not include previews, the server lacks the memory, or the app already has 10 open. Close or merge another one, or push to the pull request again later.

A preview is for looking at a change before it goes live. To share visitors across copies, see running more than one copy of an app.

Something unclear or wrong on this page? Email support@1clickops.com.