v1

Release /

Create a pipeline and release flow

Pipelines on Northflank allow you to create and manage complex workflows, deploying your code in different stages for development, staging, and production.

Combined with release flows, pipelines offer an incredible amount of flexibility to support your development process and manage releases.

Pipelines are specific to projects, and you can only include resources from the project that contains your pipeline. Each pipeline consists of three stages, development, staging, and production, and you can use these in any way you require to suit your workflow.

You can create a release flow for each pipeline stage to manage your releases, including promoting builds, backing up databases, and running migrations. Release flows can be automatically run using Git or webhook triggers, and can replace the CI/CD settings for individual services and jobs.

Click here to create a pipeline.
A pipeline overview in the Northflank application

Create a pipeline

To create a new pipeline either select create new from the pipelines page, or pipeline from the create new menu.

Enter a name to identify the pipeline and click create.

You can also create and manage a pipeline using a pipeline node in the template editor.

Use a pipeline

You can add resources to each stage of your pipeline in whatever configuration best represents your workflow. These resources can then be used in the release flows for each stage of your pipeline to automate your release management.

note

You can only add services and jobs that use a Northflank build service or an external image as the deployment source. This means combined services and jobs that build directly from a Git repository cannot be used in pipelines.

Build services are not added to pipelines, but can be used in release flows and preview environments.

Add resources

Click the add button at the bottom of a stage to view the resources available to add to your pipeline.

Resources that belong to another pipeline cannot be added, and you can filter resources by name using the search function.

Select all the resources you want to add to the stage of the pipeline, and click add.

To move a resource to another stage, remove it from its current stage and add it to the stage you want it to be in.

Remove resources

You can remove a resource from a pipeline by clicking the remove button on the service, addon, or job you want to remove.

This will also remove any nodes related to this resource in your release flows, please make sure you carefully review the effect this will have on your release flows, if any.

Manage pipelines

You can view and delete pipelines from the pipelines page. If you delete a pipeline, it will remove your configured pipeline overview and any release flows it contains. Deleting a pipeline will not affect any of your services, all the deployments, job, and addons added to the pipeline will continue to run as individually configured.

Create a release flow

You can create a release flow for a stage of your pipeline by clicking add release flow in the release header for the specific stage.

Release flows are Northflank templates with specific nodes and handling. You can create and update release flows in a pipeline node in the template editor.

You can create a release flow by using the visual editor to drag and drop nodes, and click on a node to edit its configuration.

Configure settings for a release flow by opening the settings view in the editor, including adding Git triggers and arguments.

Settings for a release flow in the Northflank application

See configure a release flow to learn more about configuring release flows and release flow nodes.

Automatically run a release flow

You can automatically run a release flow using Git triggers, or by using the webhook trigger. You can access values from triggers using references and arguments.

Configure a Git trigger

A release flow will run when a commit is pushed to a branch or pull request that matches a configured Git trigger.

Click add trigger to create a new Git trigger. Enter a reference for your Git trigger, a string by which it can be accessed in the release flow template, and select the repository you want to use.

You can now define pull request and branch rules. Branch rules will run the template when a commit is pushed to a branch matching the given rules. Pull request rules will run the template whenever a pull request is opened for a branch matching the given rules, or a commit is pushed to a branch matching the given rules with an open pull request.

You can also add path rules and ignore flags in order to only run the template on changes to specific files, or to skip runs when a certain commit message is included.

Configure a webhook trigger

You can also use a webhook trigger to run your release flow. Enable the webhook trigger in settings and make either a GET or POST request to it to trigger the release flow. You can include query parameters at the end of the webhook URL to pass values as arguments.

For example:

https://webhooks.northflank.com/release-flows/<TOKEN>?branch=<BRANCH>&sha=<SHA>

will run the release flow and pass the values of branch and sha as arguments to the template.

Manage your release flow with GitOps

You can create and update release flows as part of a template using the pipeline node. You can use the full visual editor to configure the release flows for each stage of a pipeline, and refer to resources and arguments contained in the parent template.

You can then manage the parent template using GitOps, and the release flow will be updated whenever the parent template is run.

Use GitOps to manage an individual release flow

You can enable GitOps to sync the release flow with a Git repository. You can make changes to your release flow by committing changes to it in the repository or by editing it on Northflank, and the changes will be propagated to the other platform automatically. This allows you to maintain your release flows alongside your codebase, or in a separate infrastructure repository.

Enable GitOps and select the repository and branch that contains, or will contain, the release flow. Enter the path to the release flow file relative to the repository root. For example /release-development.json will look for a file called release-development.json in the repository root, while /release/development.json will look for a file called development.json in the directory release.

If a release flow file already exists at the path, it will be loaded into the editor. If no file exists, one will be created with the specification defined in the editor.

It is not necessary, but it is recommended, to save the release flow with the format json so it can be recognised by IDEs and text editors.

Configure template run concurrency

You can choose how a template will behave if it receives more than one request to run at the same time, or receives a request to run while a run is still in progress. You can set the run concurrency on the template's settings page.

  • Allow (default): multiple template runs can be executed in parallel, with no restrictions
  • Queue: each time a template run is triggered it will be added to a queue, and runs will be executed sequentially in order of creation
  • Forbid: if a template is currently pending or running any run requests will be ignored

You may want to queue or forbid simultaneous runs to ensure that resources are not updated with conflicting configurations.

Provide secrets securely to a template

You should not include any secrets, such as API keys, passwords, or other sensitive data in your template.

Instead, you should provide the values via secret groups in your project.

Manage release flows

Each release flow header the pipeline stages show the status of recent runs, a run button to trigger a release flow run, a button to open the list of release flow runs, and an edit button to edit the release flow and its settings.

Learn more in run and manage releases.

You can pause triggers for a release flow in the header of the release flow settings. While paused, Git triggers will be inactive and requests to the webhook will return the HTTP status 202, with a message explaining the trigger is paused. Release flows can still be run manually using the UI or the Northflank API while triggers are paused.

© 2024 Northflank Ltd. All rights reserved.