Skip to main content
Use the DevHelm CLI in any CI system that can install npm packages. This page shows patterns for common CI providers.

Requirements

  • Node.js 18+ on the CI runner
  • DEVHELM_API_TOKEN set as a CI secret
  • A devhelm.yml config file in your repository

Standard workflow

npm install -g devhelm
devhelm validate devhelm.yml
devhelm deploy -f devhelm.yml --yes

GitLab CI

deploy-monitoring:
  image: node:20
  stage: deploy
  only:
    changes: [devhelm.yml]
  script:
    - npm install -g devhelm
    - devhelm validate devhelm.yml
    - devhelm deploy -f devhelm.yml --yes
  variables:
    DEVHELM_API_TOKEN: $DEVHELM_API_TOKEN

plan-monitoring:
  image: node:20
  stage: test
  only:
    refs: [merge_requests]
    changes: [devhelm.yml]
  script:
    - npm install -g devhelm
    - devhelm validate devhelm.yml
    - devhelm plan -f devhelm.yml
  variables:
    DEVHELM_API_TOKEN: $DEVHELM_API_TOKEN

Jenkins

pipeline {
    agent { docker { image 'node:20' } }
    environment {
        DEVHELM_API_TOKEN = credentials('devhelm-api-token')
    }
    stages {
        stage('Validate') {
            when { changeset 'devhelm.yml' }
            steps {
                sh 'npm install -g devhelm'
                sh 'devhelm validate devhelm.yml'
            }
        }
        stage('Deploy') {
            when {
                allOf {
                    changeset 'devhelm.yml'
                    branch 'main'
                }
            }
            steps {
                sh 'devhelm deploy -f devhelm.yml --yes'
            }
        }
    }
}

CircleCI

version: 2.1
jobs:
  plan:
    docker: [{ image: cimg/node:20.0 }]
    steps:
      - checkout
      - run: npm install -g devhelm
      - run: devhelm validate devhelm.yml
      - run: devhelm plan -f devhelm.yml

  deploy:
    docker: [{ image: cimg/node:20.0 }]
    steps:
      - checkout
      - run: npm install -g devhelm
      - run: devhelm deploy -f devhelm.yml --yes

workflows:
  monitoring:
    jobs:
      - plan:
          filters:
            branches:
              ignore: main
      - deploy:
          filters:
            branches:
              only: main

Bitbucket Pipelines

pipelines:
  pull-requests:
    '**':
      - step:
          name: Plan monitoring config
          image: node:20
          script:
            - npm install -g devhelm
            - devhelm validate devhelm.yml
            - devhelm plan -f devhelm.yml
  branches:
    main:
      - step:
          name: Deploy monitoring config
          image: node:20
          script:
            - npm install -g devhelm
            - devhelm deploy -f devhelm.yml --yes

Version pinning

For reproducible builds, pin the CLI version:
npm install -g devhelm@0.2.0

Gating merges

Use --dry-run --detailed-exitcode as a required status check:
devhelm deploy -f devhelm.yml --dry-run --detailed-exitcode
Exit 10 means changes are pending — use this to require review before merging config changes.

Next steps

GitHub Actions

Official setup-devhelm action with caching.

Multi-environment

Deploy staging and production separately.