Skip to content

Latest commit

 

History

History
157 lines (116 loc) · 3.2 KB

File metadata and controls

157 lines (116 loc) · 3.2 KB
title CI/CD Integration - Jarvy
description Use Jarvy in CI/CD pipelines to ensure consistent tool versions across local development and CI environments.

CI/CD Integration

Jarvy works in CI pipelines the same way it works locally. Run jarvy setup in your CI job and every build gets the same tools your developers use.

GitHub Actions

Use the official setup-jarvy action:

name: CI
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Jarvy
        uses: bearbinary/jarvy/.github/actions/setup-jarvy@main
        with:
          method: cargo       # or "path" to build from workspace

      - name: Provision tools
        run: jarvy setup --ci

      - name: Verify environment
        run: jarvy doctor --format json

Action Inputs

Input Default Description
method cargo Install method: cargo (from crates.io) or path (build locally)
version latest Jarvy version to install
path . Source path when method=path
locked true Honor Cargo.lock

GitLab CI

stages:
  - setup
  - build

provision:
  stage: setup
  image: rust:latest
  script:
    - cargo install jarvy
    - jarvy setup --ci
    - jarvy doctor

CircleCI

version: 2.1

jobs:
  build:
    docker:
      - image: cimg/rust:1.85
    steps:
      - checkout
      - run:
          name: Install Jarvy
          command: cargo install jarvy
      - run:
          name: Provision tools
          command: jarvy setup --ci

Azure Pipelines

trigger:
  - main

pool:
  vmImage: ubuntu-latest

steps:
  - script: |
      curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
      source $HOME/.cargo/env
      cargo install jarvy
    displayName: Install Jarvy

  - script: jarvy setup --ci
    displayName: Provision tools

  - script: jarvy --version
    displayName: Show Jarvy version

Generate CI Configs

Jarvy can generate CI configuration files for you:

# Generate a GitHub Actions workflow
jarvy ci-config github

# Generate GitLab CI config
jarvy ci-config gitlab

# Preview without writing
jarvy ci-config circleci --dry-run

Supported providers: github, gitlab, circleci, azure, bitbucket, travis, jenkins, buildkite, teamcity, appveyor.

CI Behavior

When Jarvy detects a CI environment (CI=true), it automatically:

  • Switches to non-interactive mode (no prompts)
  • Disables telemetry
  • Disables auto-update checks
  • Skips services auto-start (unless start_in_ci = true)

You can override these defaults:

# Force CI mode
jarvy setup --ci

# Force interactive mode in CI
jarvy setup --no-ci

Drift Detection in CI

Use jarvy drift check as a CI gate to ensure environments match the config:

# GitHub Actions example
- name: Check for drift
  run: jarvy drift check --format json
  # Exit code 1 = drift detected, fails the job

CI Environment Info

# Show detected CI environment
jarvy ci-info

Output includes: provider name, build ID, branch, commit SHA, PR number (if applicable), and which environment variables were detected.