3.10.2 • Published 25 days ago

@jameslnewell/buildkite-pipelines v3.10.2

Weekly downloads
-
License
MIT
Repository
github
Last release
25 days ago

@jameslnewell/buildkite-pipelines

Generate Buildkite pipelines from code.

CI/CD

Installation

NPM:

npm install @jameslnewell/buildkite-pipelines

Yarn:

yarn add --dev @jameslnewell/buildkite-pipelines

Usage

Define your pipeline in code.

./.buildkite/pipeline.js

const {Pipeline, CommandStep} = require('@jameslnewell/buildkite-pipelines');

module.exports = new Pipeline().addStep(
  new CommandStep().setLabel('👋 Greeting').addCommand('echo "Hello World!"'),
);

Generate and upload your pipeline in a Buildkite step.

./.buildkite/pipeline.yml

steps:
  - commands:
      - buildkite-pipelines ./.buildkite/pipeline.js | buildkite-agent pipeline upload
    plugins:
      - docker#v3.11.0:
          image: jameslnewell/buildkite-pipelines

Transpiling Typescript

Define your pipeline in code.

./.buildkite/pipeline.ts

import {Pipeline, CommandStep} from '@jameslnewell/buildkite-pipelines';

export default new Pipeline().addStep(
  new CommandStep().setLabel('👋 Greeting').addCommand('echo "Hello World!"'),
);

Generate and upload your pipeline in a Buildkite step.

./.buildkite/pipeline.yml

steps:
  - commands:
      - yarn global add ts-node
      - buildkite-pipelines -r ts-node/register ./.buildkite/pipeline.ts | buildkite-agent pipeline upload
    plugins:
      - docker#v3.11.0:
          image: jameslnewell/buildkite-pipelines

Why?

This library is a very thin wrapper around Buildkite's yaml syntax for defining a pipeline. As such the value of this library is unlikely to be realised for simple one-file pipelines.

Consider using this library when:

  • you're dynamically generating the pipeline and you require a programming language
  • your pipeline is split across multiple yaml files and you're unable to use yaml anchors and aliases for composition across them
  • you can't possibly live without typings

Related projects

Development

  1. Setup a pipeline - use the command for setting up a docker agent here
3.10.1

25 days ago

3.10.2

25 days ago

3.10.0

3 months ago

3.9.0

3 months ago

3.8.0

4 months ago

2.0.3

10 months ago

2.2.0

9 months ago

2.0.2

10 months ago

2.4.0

9 months ago

2.6.0

9 months ago

2.8.0

9 months ago

2.0.1

10 months ago

2.0.0

10 months ago

3.4.0

8 months ago

3.2.0

8 months ago

3.0.1

9 months ago

3.6.0

7 months ago

3.0.0

9 months ago

2.3.0

9 months ago

2.5.0

9 months ago

2.7.0

9 months ago

2.5.1

9 months ago

2.1.0

9 months ago

3.3.1

8 months ago

3.3.0

8 months ago

3.1.1

8 months ago

3.1.0

9 months ago

3.7.0

6 months ago

3.5.1

8 months ago

3.5.0

8 months ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago