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.

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 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.

You can create a release flow by using the visual editor to drag and drop nodes, clicking into a node to edit its configuration. You can also create a release flow as code, if you are familiar with templates and the Northflank API.

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

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://api-platform.northflank.com/webhooks/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.

Enable GitOps for your template

You can enable GitOps to sync the template with a Git repository. You can make changes to your template 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 templates alongside your codebase, or in a separate infrastructure repository.

Enable GitOps and select the repository and branch that contains, or will contain, the template code. Enter the path to the template relative to the repository root. For example /template.json will look for a file called template.json in the repository root, while /platform/backend.json will look for a file called backend.json in the directory platform.

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

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

Learn more about GitOps on Northflank.

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.

  • 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 define argument keys in your template and provide the values in argument overrides, which are stored securely on the Northflank platform, encrypted at rest.

You can configure argument overrides for a template which will override any arguments with the same key. If the key specified in the overrides object does not exist in the arguments object, it will be inserted.

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.