All Projects → CircleCI-Public → circleci-config-sdk-ts

CircleCI-Public / circleci-config-sdk-ts

Licence: Apache-2.0 license
Generate CircleCI Configuration YAML from JavaScript or TypeScript. Use Dynamic Configuration and the Config SDK together for live generative config.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to circleci-config-sdk-ts

Condition Circle
Checks CircleCI environment before publishing successful build using semantic-release
Stars: ✭ 32 (-45.76%)
Mutual labels:  circleci, ci
Ci Matters
Integration (comparison) of different continuous integration services on Android project
Stars: ✭ 119 (+101.69%)
Mutual labels:  circleci, ci
Aliyungradleconfig
自用的安卓开源项目工程模板。阿里云远程仓库加速,发布到maven仓库、上传到jcenter,代码混淆、资源混淆,持续集成(CI),多渠道自动打包。在天朝使用jcenter、mavenCentral及google三个远程仓库,Gradle Sync太慢?一招教你配置阿里云镜像源。init.d/init.gradle
Stars: ✭ 37 (-37.29%)
Mutual labels:  circleci, ci
build-status
Emacs minor mode that monitors and shows a buffer's build status in the mode line.
Stars: ✭ 26 (-55.93%)
Mutual labels:  circleci, ci
Nevergreen
🐤 A build monitor with attitude
Stars: ✭ 170 (+188.14%)
Mutual labels:  circleci, ci
CI-Utils
Utilities for running Common Lisp on CI platforms
Stars: ✭ 18 (-69.49%)
Mutual labels:  circleci, ci
Cypress Example Docker Circle
Cypress + Docker + CircleCI = ❤️
Stars: ✭ 119 (+101.69%)
Mutual labels:  circleci, ci
lighthouse-circleci-example
An example repo demonstrating Lighthouse testing in CircleCi
Stars: ✭ 21 (-64.41%)
Mutual labels:  circleci, ci
Cistern
A terminal UI for Unix to monitor Continuous Integration pipelines from the command line. Current integrations include GitLab, Azure DevOps, Travis CI, AppVeyor and CircleCI.
Stars: ✭ 161 (+172.88%)
Mutual labels:  circleci, ci
Ci Detector
Detect continuous integration environment and get information of current build
Stars: ✭ 138 (+133.9%)
Mutual labels:  circleci, ci
CIAnalyzer
A tool collecting multi CI services build data and export it for creating self-hosting build dashboard.
Stars: ✭ 52 (-11.86%)
Mutual labels:  circleci, ci
Pupernetes
Spin up a full fledged Kubernetes environment designed for local development & CI
Stars: ✭ 199 (+237.29%)
Mutual labels:  circleci, ci
jt tools
Ruby on Rails Continuous Deployment Ecosystem to maintain Healthy Stable Development
Stars: ✭ 13 (-77.97%)
Mutual labels:  circleci, ci
Cibuildwheel
🎡 Build Python wheels for all the platforms on CI with minimal configuration.
Stars: ✭ 620 (+950.85%)
Mutual labels:  circleci, ci
docker-coala-base
coala base docker image
Stars: ✭ 20 (-66.1%)
Mutual labels:  circleci, ci
Terraform Multienv
A template for maintaining a multiple environments infrastructure with Terraform. This template includes a CI/CD process, that applies the infrastructure in an AWS account.
Stars: ✭ 107 (+81.36%)
Mutual labels:  circleci, ci
developer-ci-benefits
Talk docs—includes CI (Continuous Integration) benefits, description, and setup tips 💡💪
Stars: ✭ 29 (-50.85%)
Mutual labels:  circleci, ci
ci playground
Playground for Cloud CI development for C++
Stars: ✭ 23 (-61.02%)
Mutual labels:  circleci, ci
Monorepo
Showcase of how to manage building projects inside monorepo with Gradle as build tool and CircleCI, Bitbucket Pipelines, Travis CI or GitHub Actions as CI tool.
Stars: ✭ 129 (+118.64%)
Mutual labels:  circleci, ci
Env Ci
Get environment variables exposed by CI services
Stars: ✭ 180 (+205.08%)
Mutual labels:  circleci, ci

CircleCI Config SDK

GitHub CircleCI npm codecov npm GitHub Repo stars

Create and manage your CircleCI configuration files with JavaScript and TypeScript.

Table of Contents

Getting Started

📖 Getting Started Wiki

📖 SDK API Docs

💻 Examples


Installation

Using npm:

$ npm i @circleci/circleci-config-sdk

Using yarn:

$ yarn add @circleci/circleci-config-sdk

Usage

In Browser:

import CircleCI from '@circleci/circleci-config-sdk';

In Node.js:

const CircleCI = require('@circleci/circleci-config-sdk');

Example

Generate a CircleCI config using TypeScript/Javascript, properly typed for full IntelliSense support.

const CircleCI = require('@circleci/circleci-config-sdk');
// Instantiate new Config
const myConfig = new CircleCI.Config();
// Create new Workflow
const myWorkflow = new CircleCI.Workflow('myWorkflow');
myConfig.addWorkflow(myWorkflow);

// Create an executor instance
// Executors are used directly in jobs
// and do not need to be added to the config separately
const nodeExecutor = new CircleCI.executors.DockerExecutor('cimg/node:lts');

// Create Job and add it to the config
const nodeTestJob = new CircleCI.Job('node-test', nodeExecutor);
myConfig.addJob(nodeTestJob);

// Add steps to job
nodeTestJob
  .addStep(new CircleCI.commands.Checkout())
  .addStep(
    new CircleCI.commands.Run({
      command: 'npm install',
      name: 'NPM Install',
    }),
  )
  .addStep(
    new CircleCI.commands.Run({
      command: 'npm run test',
      name: 'Run tests',
    }),
  );

// Add Jobs to Workflow
myWorkflow.addJob(nodeTestJob);

// The `stringify()` function on `CircleCI.Config` will return the CircleCI YAML equivalent.
const MyYamlConfig = myConfig.stringify();

// Save the config to a file in Node.js or the browser. Note, use in the browser requires user interaction.
myConfig.writeFile('config.yml');

MyYamlConfig will hold the following string (A valid CircleCI Config).

version: 2.1
setup: false
jobs:
  node-test:
    docker:
      - image: cimg/node:lts
    resource_class: medium
    steps:
      - checkout: {}
      - run:
          command: npm install
          name: NPM Install
      - run:
          command: npm run test
          name: Run tests
workflows:
  myWorkflow:
    jobs:
      - node-test: {}

Getting Help

This open-source project utilized GitHub issues and project boards to manage requests and support.

If you can not find an answer to your question in an existing issue, you may open a new issue with the appropriate template. Issues are the best way for the CircleCI team and the open-source community to track and interact with your questions.

Resources

Consider checking the following common resources before opening a new issue.

Contributing

This repository welcomes community contributions! See our CONTRIBUTING.md for guidance on configuring your development environment and how to submit quality pull requests.

Related

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].