Skip to main content

ol-concourse-lib

A Python DSL for programmatically building Concourse CI/CD pipelines.

Instead of writing YAML files by hand, use typed Python classes to construct type-safe pipeline definitions that serialize to valid Concourse pipeline YAML.

Installation

pip install ol-concourse-lib
# or with Pulumi job builder support:
pip install "ol-concourse-lib[pulumi]"

Quick Start

from ol_concourse.lib.models.pipeline import Identifier
from ol_concourse.lib.resources import git_repo, registry_image
from ol_concourse.lib.resource_types import packer_build
from ol_concourse.lib.jobs.infrastructure import packer_jobs
import yaml, json

# Build a pipeline fragment for packer AMI builds
code = git_repo(
    name=Identifier("packer-templates"),
    uri="https://github.com/myorg/packer-templates",
    branch="main",
)

fragment = packer_jobs(
    dependencies=[],
    image_code=code,
    node_types=["web", "worker"],
)

pipeline = fragment.to_pipeline()
print(yaml.dump(json.loads(pipeline.model_dump_json())))

API

Models (ol_concourse.lib.models)

  • Pipeline — root pipeline definition
  • Job, Resource, ResourceType — core pipeline components
  • GetStep, PutStep, TaskStep, InParallelStep — step types
  • TaskConfig, Command, Input, Output — task configuration
  • PipelineFragment — composable pipeline unit

Builder Functions

Module Functions
ol_concourse.lib.resources git_repo, registry_image, github_issues, schedule, s3_object, …
ol_concourse.lib.resource_types packer_build, packer_validate, pulumi_provisioner_resource, github_issues_resource, github_deployments_resource, release_resource_type, …
ol_concourse.lib.jobs.infrastructure packer_jobs, pulumi_jobs_chain, pulumi_job
ol_concourse.lib.containers container_build_task
ol_concourse.lib.notifications notification (Slack)
ol_concourse.lib.tasks instance_refresh_task, block_for_instance_refresh_task

Regenerating Pipeline Models

models/pipeline.py is generated from the Concourse pipeline JSON schema:

pip install datamodel-code-generator
datamodel-codegen \
    --url https://raw.githubusercontent.com/nicholasdille/concourse-jsonschema/main/concourse.json \
    --output src/ol_concourse/lib/models/pipeline.py \
    --output-model-type pydantic_v2.BaseModel

License

BSD-3-Clause — Copyright MIT Open Learning

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ol_concourse-0.13.0.tar.gz (59.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ol_concourse-0.13.0-py3-none-any.whl (55.3 kB view details)

Uploaded Python 3

File details

Details for the file ol_concourse-0.13.0.tar.gz.

File metadata

  • Download URL: ol_concourse-0.13.0.tar.gz
  • Upload date:
  • Size: 59.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for ol_concourse-0.13.0.tar.gz
Algorithm Hash digest
SHA256 ac292ee8c92221e07839346c214ff32fc9a26294fd557392c5e07b197c9b6454
MD5 abe9ff5e9c36b9d80221a7b3c6d3d0a7
BLAKE2b-256 6819386b41708f79ce4023bf18dbaf9704caf3d7787ada33c1067be3e6b680ef

See more details on using hashes here.

File details

Details for the file ol_concourse-0.13.0-py3-none-any.whl.

File metadata

  • Download URL: ol_concourse-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 55.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for ol_concourse-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0b259159773cd0bbe1d1a0cbbc9f96f18dd3c8e7967a98d758b22b876528cfc
MD5 6b68789c88c5b3c6589b4302f4c59860
BLAKE2b-256 d6cdaf880d3f2446895cfa60d87599a9b9e858e8a04ce8907a928f5d63de10d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page