Pipelines
Pre-built pipelines you can import directly into your .gitlab-ci.yml.
Each pipeline includes jobs, stages, and sensible defaults. Override any variable to customise behaviour.
Available pipelines
| Pipeline | Description |
|---|---|
| Default | YAML linting and pre-commit hooks for any project |
| Docker | Build and publish images with BuildKit and registry layer caching |
| Kubernetes | Deploy to Kubernetes with Helm, DigitalOcean, or Google Cloud |
| Node.js | Install, lint, test, build, and publish Node.js projects (coming soon) |
| Python | Install, lint, test, and publish Python projects (coming soon) |
| Terraform / OpenTofu | Manage infrastructure as code (coming soon) |
Usage
Add an include block to your .gitlab-ci.yml:
include:
- project: hosst/gitlab-pipelines
file: pipelines/docker.yamlMultiple pipelines can be combined:
include:
- project: hosst/gitlab-pipelines
file: pipelines/docker.yaml
- project: hosst/gitlab-pipelines
file: pipelines/kubernetes-helm.yamlRecommended setup
Rather than referencing this project directly from every repository, create a dedicated pipeline project in your GitLab group and centralise configuration there. This gives you a single place to pin versions, set organisation-wide defaults, and roll out changes across all applications at once.
1. Create a pipelines project in your GitLab group (e.g. myorg/pipelines).
2. Add an application.yaml that includes the pipelines you need and sets shared variables:
# myorg/pipelines — application.yaml
include:
- project: hosst/gitlab-pipelines
file: pipelines/default.yaml
- project: hosst/gitlab-pipelines
file: pipelines/docker.yaml
- project: hosst/gitlab-pipelines
file: pipelines/kubernetes-helm.yaml
variables:
GOOGLE_PROJECT: myorg-staging
GOOGLE_KUBERNETES_CLUSTER: myorg-cluster
GOOGLE_REGION: europe-west4
KUBERNETES_CLUSTER: $GOOGLE_KUBERNETES_CLUSTER
SLACK_MESSAGE_CHANNEL: deployments
SLACK_MESSAGE_BRANDING: "by <https://gitlab.com/myorg/pipelines|myorg>"
# Allow quality jobs to fail without blocking the pipeline
precommit:
allow_failure: true
yamllint:
allow_failure: true
hadolint:
allow_failure: true
# Clear runner tags if you use custom runners instead of GitLab SaaS runners
.docker_buildx:
tags: []
# Use a separate cloud project and cluster for production
production:
variables:
GOOGLE_PROJECT: myorg-production
GOOGLE_KUBERNETES_CLUSTER: myorg-prod-cluster3. In each application repository, include only your pipeline project:
# .gitlab-ci.yml
include:
- project: myorg/pipelines
file: application.yamlPer-project overrides still work normally by setting variables in .gitlab-ci.yml:
include:
- project: myorg/pipelines
file: application.yaml
variables:
DOCKER_BUILD_TARGETS: deps build