v1

Getting Started /

Set up a pipeline

Pipelines on Northflank allow you to create and manage complex continuous integration and continuous delivery (CI/CD) workflows.

Essentially, pipelines manage the process of building, deploying and promoting images in different stages.

Together with the configuration options of build and deployment services, pipelines offer an incredible amount of flexibility to support your development process requirements.

Create a pipeline

To create a pipeline:

  1. Choose pipeline from the create new drop-down menu in the top right corner of the dashboard
  2. Enter a name
  3. Click create pipeline
Image of the pipeline creation screen

Create a build service

You can configure most aspects of a build service after it is created - except the name.

  1. Choose service from the create new drop-down menu in the top right corner of the dashboard
  2. Basic information: select build service and enter a name
  3. Repository: select the repository from the drop-down list and choose the branch you want to build from
  4. Repository: enter your pull request and branch build rules, or leave blank to build all new commits. You can set multiple rules, and you can add rules for both pull requests and branches.
  5. Build options: choose Dockerfile if you have a custom Dockerfile in your registry, or buildpack to automatically build your application. If your Dockerfile and/or build context are not root, specify the relative paths.
  6. Environment variables (optional): you can set runtime variables and build arguments here, if required
  7. Resources: set the compute plan to suit your build
  8. Click create service

Create deployment services

You can configure most aspects of a deployment service after it is created - except the name.

  1. Choose service from the create new drop-down menu in the top right corner of the dashboard
  2. Basic information: select deployment service and enter a name
  3. Deployment: select the source to deploy an image from, either from a Northflank build service, or an external image
  4. Deployment: if you are deploying from Northflank, choose a build service and branch to deploy from. If you are deploying an external image, enter the external image path and select credentials (if it is a private image).
  5. Environment variables (optional): you can set runtime variables and build arguments here, if required
  6. Networking (optional): add any required public or private ports
  7. Resources: set the compute plan and number of instances to suit your deployment
  8. Advanced (optional): you can configure health checks and a Docker CMD override, if required
  9. Click create service

Add deployment services to your pipeline

To create an effective pipeline you will need to add multiple deployment services.

  1. Select the pipeline you want to use from the project pipelines page
  2. If the pipeline sidebar is not open, click the button on the right of the screen to show it
  3. Click and drag the deployment service from the pipeline sidebar to the stage you want to add it to
Image of a pipeline with deployment services in stages

Removing a deployment service from a pipeline will not unlink its build service or external image, nor pause the deployment service. You can edit or disable the deployment service itself from its own dashboard.

Deploy a build to your pipeline

  1. Find the build service you want to deploy from in the pipeline sidebar and click on it to open the build selection menu.
  2. Choose from the list of builds, or from a branch or pull request, then deploy build
  3. Choose the deployment service(s) you want to use in the pipeline and select deploy build . If you do not have a built image for that branch or pull request, you will need to manually start a build or set up build rules in the build service.
  4. Close the menu when finished or go back to select another build to deploy
  1. Find the build service you want to deploy from in the pipeline sidebar and click on it to open the build selection menu
  2. Filter by branch or pull request, then link the desired branch or pull request
  3. Choose the deployment service(s) to link to and select link branch or pull request . If the linked branch or pull request has a built image it will be deployed, otherwise you will need to manually start a build or set up build rules in the build service.
  4. Close the menu when finished or go back to select another build to deploy
Image of linking a branch to a deployment service in a pipeline

You can manage your pipeline's stages by adding deployment services to different stages.

You can move a deployment service to a different stage by clicking the options button on the deployment service in the pipeline and selecting the move to [stage] option for the stage you want to move it to.

Linking Deployment services

To link deployment services navigate to the pipeline you want to edit:

  1. Click the link button on the first deployment service in the chain you want to create (for example to link a service in development to a service in staging, click the button on the service in development)
  2. Your selected deployment service will now be highlighted in green
  3. Click on the deployment service(s) in the next stage you want to link it to
  4. Click again on the link button on the first deployment service you were linking from, or outside the deployment cards, to exit the link editor for that service

Please note:

  • You must have at least two deployment services added to different, but adjacent, stages
  • Links can only be made between service in adjacent stages
  • Moving a deployment service to another stage will break its current links

Unlinking Deployment services

To unlink deployment services navigate to the pipeline you want to edit:

  1. Click the link button on the first deployment service in the chain you want to unlink (for example to unlink a service in staging that is linked to a service in production, click the button on the service in staging)
  2. Your selected deployment service will now be highlighted in green
  3. Click the unlink button on the deployment service(s) you want to unlink
  4. Click again on the link button on the first deployment service you were linking from, or outside the deployment cards, to exit the link editor for that service

You can remove all links from deployment service by clicking the options button on the deployment service in the pipeline and select unlink all.

Promote builds

You can promote a build from a deployment service in one stage to a linked deployment service in a subsequent stage by clicking the promote button on the previous service in the link.

This will replace the currently deployed build on the linked deployment service.

© 2022 Northflank Ltd. All rights reserved.