Build Pipelines

A build pipeline is a sequence of tasks that are executed during tag, snap and build commands.

Your custom dev environment controls the build pipeline using the `build` method:

// my-env.bit-env.ts
import { HarmonyEnv } from '@bitdev/harmony.harmony-env';

class MyEnv extends HarmonyEnv {
  build() {
    return Pipeline.from([
      TypescriptTask.from({
        tsconfig: this.tsconfigPath,
        types: resolveTypes(__dirname, [this.tsTypesPath]),
      }),
      EslintTask.from({
        tsconfig: this.tsconfigPath,
        configPath: this.eslintConfigPath,
        pluginsPath: __dirname,
        extensions: this.eslintExtensions,
      }),
      JestTask.from({
        config: this.jestConfigPath,
      }),
    ]);
  }
}
CopiedCopy

To debug your build pipeline issues, for instance CI errors when running snap or tag, run the following command to locally execute a build pipeline:

$bit
Copiedcopy
See command synopsis
Build output

Once build has completed, you can access build outputs in the directory provided in the command output.

build output can be found in path: .../capsules/3cb1fe9e599417540367a45ebfd35e0c8adcbf14
CopiedCopy

Build artifacts

During bit tag or bit snap build artifacts output by some build tasks are persisted. You can list the available artifacts from any previous snap or tag and fetch them:

$bit
Copiedcopy
See command synopsis

Create a new build task

To customize your build pipeline, you can create a new build task - for instance to run accessibility testing, generate custom outputs, basically anything you want.

Start by running the following command to create a new build task:

$bit
Copiedcopy
See command synopsis

Integrate to your build pipeline by adding to the build tasks array. Follow this guide to dive deeper.

Release pipelines

In addition to the standard tasks run when snapping/tagging components (packaging, versioning, etc), add the snap() and/or tag() functions to your env to configure additional release tasks.

See Create a new build task above for details on how to create a new task.

tip

Teams often use snap for staging environment related deployments and tag for production.

// in your *.bit-env.ts file
  tag() {
    return Pipeline.from([])
  };
  snap() {
    return Pipeline.from([])
  };
CopiedCopy