Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@versionone/ctm-pipeline-builder-sdk

Package Overview
Dependencies
Maintainers
5
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@versionone/ctm-pipeline-builder-sdk

Create VersionOne Continuum pipeline definitions with javascript!

  • 1.2.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-56%
Maintainers
5
Weekly downloads
 
Created
Source

Continuum Pipeline Builder JS SDK

Use this JavaScript library to build Continuum Pipeline Definitions with code!

Continuum pipeline definitions are declarative in nature providing a configuration as code approach. Some people prefer their imperative programming languages and want to write code over configuration.

Meet PipelineBuilder.

Consider the example where a pipeline conditionally sets the status of a work item in your favorite ALM tool. The pipeline may look something like this:

{
    name: "pipeline as code",
    description: "description",
    phases: [
        {
            name: "phase name",
            stages: [
                {
                    name: "stage name",
                    steps: [
                        {
                            name: "",
                            plugin: {
                                args: {
                                    action: {
                                        args: {
                                            current_status: "None",
                                            instance_name: "VersionOne",
                                            number: "D-1234",
                                            status: "Ready"
                                        },
                                        label: 'VersionOne - Set Workitem Status',
                                        method: 'set_workitem_status',
                                        module: 'main',
                                        name: 'v1plugin'
                                    },
                                    else_action: {
                                        args: {
                                            current_status: "None",
                                            instance_name: "VersionOne",
                                            number: "D-1234",
                                            status: "Done"
                                        },
                                        label: 'VersionOne - Set Workitem Status',
                                        method: 'set_workitem_status',
                                        module: 'main',
                                        name: 'v1plugin'
                                    },
                                    expression: "epic.isClosed"
                                },
                                label: 'Utility - Conditional',
                                method: 'conditional',
                                module: 'utility',
                                name: 'utility'
                            },
                            when: "always"
                        }
                    ]
                }
            ]
        }
    ]
}

This pipeline expressed conditional logic in a declarative way, which is very different from what we would see in most programming languages. The aid of a graphical user interface may have helped us reason about some of the details of this pipeline, However some may want to express this same pipeline with code. Let's do it!

import { create_stage, create_phase, create_pipeline, plugins } from './../src/pipeline';
const { utility, v1 } = plugins;

const set_to_ready = v1.set_workitem_status('S-12345', 'Ready', 'None', 'VersionOne', 'always');
const set_to_done = v1.set_workitem_status('S-12345', 'Done', 'None', 'VersionOne', 'always');

const pipeline = create_pipeline('pipeline as code', 'description', [
    create_phase('phase name', [
        create_stage('stage name', [
            utility.conditional('epic.isClosed', set_to_ready, set_to_done, 'always')
        ])
    ])
]);

Development

Install Node.js

Install Node Modules
npm install
Run Linter
npm run lint
Run Tests
npm t

Keywords

FAQs

Package last updated on 15 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc