Build code from a Git repository
Northflank offers different methods for building code from a Git repository:
- You can manually or automatically build commits on specified branches or pull requests from a linked Git repository using a build service
- You can build and deploy commits on a branch from a linked Git repository with continuous integration and delivery in a combined service
- You can build commits on a branch from a linked Git repository manually or on a regular schedule using a job
Enabling CI will allow you to automatically build code when a new commit is pushed to a linked branch from your repository, or specific branches and/or pull requests. Built code can then be continuously deployed and added to a pipeline to create complex workflows.
You'll need an account on a Git provider that is linked to Northflank to get started.
To build and run code from one branch on a repository you can use:
- a combined service
- a build service linked to a deployment service
- a cron or manual job
Create a new service or job, select the repository you want to build from, then select the branch.
Once created your service will build an image for every new commit to the branches or pull requests it is monitoring, as long as CI is enabled.
You can manually trigger a build by navigating to the branch or pull request to build from and selecting a commit to build.
You can find the list of branches and pull requests in the build service menu, or by clicking the build button in the build service header.
Northflank will begin building your commit, which may take several minutes. You can monitor the progress from the builds page and click through to view the logs for the build.
You can use a build service to build and run code from specific branches and/or pull requests by specifying build rules when creating a build service. You can edit the build rules of an existing build service on the build options page.
A build service will not build any branches or pull requests without specified build rules. By default, a build service will build from all pull requests (
*) and the
Example build rules:
|Builds every branch or pull request|
|Builds the branch or pull request called master|
|Builds every branch or pull request starting with release/|
|Builds only the branch or pull request feature/test|
If you have a single repository with multiple services, or your repository is structured so that your build context is not the root, you can specify the build context when creating or editing your services.
You can specify the set of files to be used in the build process by referring to a specific subdirectory relative to the root of your repository.
To build all files from the root, use
/ as the build context or refer to a subdirectory such as
Learn more about contexts .
Run an image continuously
Deploy a built image as a continuously-running service.
Run an image once or on a schedule
Run an image manually or on a cron schedule.
Inject build arguments
Pass secrets and configuration settings to your builds.
Build a repository using a Dockerfile
Configure your application build process using a Dockerfile.
Build a repository using Buildpacks
Build your application automatically using Buildpack stacks.
Add path ignore rules
Ignore specific files and directories when building your repository.