Release Pipelines
A release pipeline puts environments in order, for example Development, QA, UAT and Staging, and names the databases a release runs on at each stage. Open Release Pipelines under Change Management to see the board of a pipeline and, under Pipelines, every pipeline as its stages in order, with what each stage runs on and its settings. Release Managers and admins create and change pipelines; other roles can open them to read.
The Board
Board shows one pipeline at a time (choose it beside the heading): a column for releases pending sign-off, one for releases not promoted yet, and one for each stage, holding the releases whose furthest completed stage it is. Each release shows its version and the state of its next stage, for example UAT: Needs approval or QA: Running, with the reason on hover, or All stages completed. The board refreshes every few seconds while the page is open; selecting a release opens it in Releases.
Creating a Pipeline
New Pipeline opens the editor. Give the pipeline a name (unique, up to 100 characters) and, if you like, a description, then Add Stage for each environment in the order a release moves through them. When your environments already run one after another (their Runs Only After settings), the editor offers Start From This Order, which adds a stage for each of them in that order with the connections each holds. Earlier and Later move a stage; Remove takes it out. Save Pipeline saves it, and a refusal is shown in the editor with its reason.
Each stage has:
- Environment: each environment can be one stage of a pipeline.
- Runs On: Chosen databases (instances in that environment, each with one of its databases in that environment, or the connection's own when a grouping there holds it) or A grouping assigned to that environment, which runs on every database the grouping holds at the time the stage runs, so a database added to the grouping later, or created later and matching its pattern, is included. The stage does not run while a picked database is gone or a server of the grouping cannot be reached, and says why. Show Databases under the grouping lists the databases it holds now, and the Promote dialog lists the databases the stage will run on before it starts.
- Requires approval: the stage needs an approval before it runs. An environment that requires approval always does, and the box says so.
- Promotes on its own: the stage starts by itself once the stage before it completed and its approval is in place.
- Wait After the Stage Before: minutes that must pass after the stage before it completed (0 to 10,080).
- Databases at a Time and If a Database Fails: how the stage runs its databases, as in Running on Several Databases.
Rules
- An environment that runs only after another needs that environment as an earlier stage.
- A stage's databases must be in its environment, and none may be listed twice. A stage's grouping must be assigned to the stage's environment.
- Every stage runs the same scripts, so all the databases of a pipeline must be one kind (PostgreSQL and its compatible engines count as one, as do MySQL and its compatible engines).
- An environment, grouping or connection a pipeline uses cannot be deleted; the refusal names the pipelines.
When something changes after a pipeline was saved (a database moved to another environment, a grouping emptied or moved, an environment's Runs Only After changed), its card says what needs attention. Creating, changing and deleting a pipeline is recorded in the Audit Log.
A Release on a Pipeline
Choose the pipeline in Pipeline when you create or edit a release; a release on a pipeline needs no target environment or target, and its card and detail name the pipeline. Signing the release off records the pipeline's stages with it, so a later change to the pipeline does not change a release already signed off; changing the release's pipeline returns it to pending sign-off. A pipeline that needs attention cannot be used for a sign-off until it is fixed.
A release on a pipeline is promoted stage by stage instead of run with Execute. Each stage runs every script on each of its databases (in place of the scripts' own targets), with the stage's Databases at a Time and If a Database Fails, and is recorded as a run of that stage. A stage can start when:
- the stage before it completed on every database since the release was signed off;
- its approval, when it requires one, is approved (request it from the release for that stage's environment);
- its wait after the stage before has passed;
- its databases are still where the pipeline put them (otherwise the promotion is refused and says to change the pipeline and sign the release off again).
Any change to the release's scripts returns it to pending sign-off, and after the new sign-off it starts again from the first stage. A pipeline that releases follow cannot be deleted.
Promoting from the Release
The detail of a signed-off release on a pipeline shows its Stages in order, each with its state: Waiting (for an earlier stage), Needs approval, Waiting for approval, Waiting out its time, Ready, Running, Completed or Failed, and for a run on several databases how many failed or were not run. Select a stage to see why it cannot start yet, when it completed or can start, its last run and the databases it runs on now. Release Managers and admins see:
- Promote to the stage, on a ready stage: the dialog lists its databases and asks for the execution mode, then shows each database's progress; Close and keep running leaves it running.
- Retry Failed Databases, on a stage that failed on some of several databases: runs it again on just those databases.
- Request Approval, on a stage that needs approval; an Approver signs it in Approvals.
- Run Again, on a completed stage.
The release card shows the furthest stage the release reached, for example Stage: QA (2 of 4), or Not promoted yet. The detail of a release on a pipeline has no Execute.
Promoting Scripts from Migration Scripts
Release Managers and admins see Promote Scripts on Migration Scripts, and Promote in a script's detail (which starts with that script chosen). Choose the pipeline and the scripts (find them by name; each says whether it is approved), and the release name (it starts as Promote and the first script's name); the version is generated. Approvers and above can Sign it off now when every chosen script is approved. Create Release makes the release on the pipeline and opens it in Releases, ready to promote.
A script that is in a release on a pipeline shows on its card the furthest stage it reached, for example Stage: QA (2 of 4) (the release and pipeline on hover), and its detail names the release and the pipeline. When a script is in several such releases, the one that went furthest through its pipeline counts.
What the Pipeline Does by Itself
Every 30 seconds the server checks each signed-off release on a pipeline (one server does it at a time when several serve the same database):
- When its next stage needs approval and nothing has been requested for it since the release was signed off, it requests the approval itself (requested by pipeline, with the reason), and Approvers, Release Managers and admins are notified as for any request. A rejected request is not requested again; request it from the release.
- When its next stage Promotes on its own and is ready (the stage before it completed, its approval is approved and its wait has passed), it starts that stage with the stage's settings in transactional mode, started by pipeline. The first stage of a pipeline that promotes on its own starts once the release is signed off.
When a stage completes or fails, Release Managers and the release's creator are notified (Release reached or Release failed in the environment, with the number of databases or the reason), and the release's stages and the board update at once in every open browser.