Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.
/ circle-wait Public archive

Block Circle CI build jobs to constrain parallelism

Notifications You must be signed in to change notification settings

icio/circle-wait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

circle-wait

circle-wait is a CLI utility to block the running of Circle CI jobs in order to maintain a maximum number of running jobs. This is useful when your build interacts with external services with impose a maximum level of parallelism.

The utility is written for node (because the project I wanted to use it with was also written in node.)

To use it, define the CIRCLE_API_KEY in your projects environment variables, so that circle-wait can access the API, then add it as a dependency to your project:

npm install --save circle-wait

Add the build step into your Circle CI build file:

version: 2
jobs:
  builds:
    steps:
      ...

      # Install your dependencies, or at least circle-wait.
      - run: npm install
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}

      # Perform as many local steps as early as possible.
      - run: npm test

      # Do the waiting immediately prior to the step you want to restrain
      # the parallelism of.
      - run:
          name: "Wait for ci"
          command: node_modules/.bin/circle-wait

      - run:
          name: "The thing you want to limit parallelism of"
          command: derp

About

Block Circle CI build jobs to constrain parallelism

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published