Infraista DocsDocs
Developer toolsPipelines

Create a pipeline

Connect GitHub, GitLab or Bitbucket, pick a repository and a starting point, review the pipeline file and save it as a commit, a pull request or a draft.

A new pipeline takes four steps: connect a repository, choose a starting point, review the YAML and choose where the file lives. The file is saved as .infraista/pipeline.yml in the repository.

Before you start: you need permission to manage pipelines (Owners, Admins and Developers by default). Managed runners are billed per minute after the monthly free minutes; see Runners and billing.

1. Connect a repository

Go to Pipelines and select New pipeline. Under Git provider, pick a tab:

ProviderHow you connectRepositories you see
GitHubConnect GitHub installs the Infraista app on the account or organization you chooseThe ones you gave the app access to
GitLabConnect GitLab opens gitlab.com's consent screen; select AuthorizeProjects where you're a Maintainer or Owner
GitLab self-managedEnter your Instance address (https, reachable from the internet) and an Access token with the api scopeProjects the token can reach
BitbucketConnect Bitbucket opens Bitbucket's consent screenRepositories where you're an Admin

For self-managed GitLab, a group access token (role Maintainer) is best: it keeps working when people leave.

New pipeline, step 1: the Git provider tabs and the Connect repository panelNew pipeline, step 1: the Git provider tabs and the Connect repository panel

Then select the repository. Infraista looks at its root files (Dockerfile, package.json and so on) and for an existing pipeline file. Missing a GitHub repository? Select Change which repositories Infraista can read in your GitHub settings.

When the pipeline is created, Infraista adds a webhook to the repository so pushes and pull requests start runs (on GitHub, the app's own webhook does this).

2. Choose a starting point

  • Use the pipeline file in this repo if .infraista/pipeline.yml already exists.
  • Start from a template: plain YAML you can change later. A Suggested template matches what was found in the repository.
TemplateWhat it does
Node.js, Python, GoInstall, lint or vet, and test
Docker imageBuild the repository's Dockerfile and push the image (to your Container Registry, with no secrets, when you have one)
Deploy to a server over SSHOn every push to the default branch, copy the code to your server and run your deploy commands
Build an image, deploy it over SSHBuild and push the image, then pull and run it on your server
Build an image, run it as containers on a serverRun the image as an API on a port, a worker and a scheduler, with migrations in between
Build and deploy per branchmain to production, staging and dev to their own servers
Deploy with a deploy agentFor a server Infraista can't reach over SSH
Test, then buildParallel checks in a test stage, then a build stage that waits for them
Start from scratchOne job that checks out the code and runs a command

The image templates that use your Container Registry appear once you have one.

If the template builds a Docker image and the repository has no Dockerfile, you can have Dockerfile Studio write one and include it in the same pull request.

3. Review the YAML

The file opens in the editor, in Visual (stages as columns and jobs as cards) or YAML view. It's checked as you type, with errors on their lines. Under Key settings:

  • Pipeline name: letters, digits, dots, dashes and underscores. It's shown on commits as infraista/<name>.
  • Runner size: the default for jobs that don't name one.
  • When it runs: Run on push to, Pull requests into, and Nightly at 02:00 UTC.

The pipeline file reference explains every key.

4. Choose where the file lives

OptionWhat happens
Test first, commit later (recommended)Nothing is written to the repository yet. Run the file from the editor with Test run, and commit it from there when it works
Commit to the repo on a new branch and open a pull requestYour team reviews the file like any change. The first run starts on the pull request
Commit directly to the default branchFastest. The pipeline runs right away if the file runs on pushes to that branch

Select Create pipeline (or Save and open the editor for a draft).

Check that it worked

The pipeline appears under Pipelines. Its first run starts with the next push or pull request the file matches, or select Run pipeline to start one now. See Runs and logs.

Test changes before committing

Open the pipeline's Editor tab, change the file and select Test run. It runs the editor's text on the latest commit of a branch, without committing anything:

  • By default deploy steps don't deploy: each checks that its target exists and is reachable instead, image builds don't push, and jobs don't use environments (so no approvals).
  • Turn deploys on to run the file exactly as written.

Test runs don't report a status on the commit. Saving from the editor commits to the branch or opens a pull request, like step 4.

If something goes wrong

  • "That GitHub installation is already connected to another Infraista account." Each installation belongs to one organization. Install the app on another account, or disconnect it in the other organization first.
  • A self-managed GitLab instance isn't accepted. It must use https and be reachable from the internet.
  • No runs start. Check the triggers in the file match the branch you pushed to, and that the commit message doesn't contain a skip marker such as [skip ci]. See Triggers.

On this page