CI/CD Integration

Docker

The CLI is available as a Docker image for easy CI/CD integration.

Pull Image

docker pull ghcr.io/jetclient/jetclient-cli:latest

Run with Docker

# Show help
docker run --rm ghcr.io/jetclient/jetclient-cli

# Run tests (mount project directory)
docker run --rm -v $(pwd):/workspace ghcr.io/jetclient/jetclient-cli run .

# With environment
docker run --rm -v $(pwd):/workspace ghcr.io/jetclient/jetclient-cli run . -e production

# Generate JUnit report
docker run --rm -v $(pwd):/workspace ghcr.io/jetclient/jetclient-cli run . \
  -r junit --reporter-out junit=./results.xml

GitHub Actions

name: API Tests

on: [push, pull_request]

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

      - name: Run API tests
        run: |
          docker run --rm \
            -v ${{ github.workspace }}:/workspace \
            ghcr.io/jetclient/jetclient-cli:latest \
            run . -e ci -r junit --reporter-out junit=./results.xml          

      - name: Publish Test Results
        uses: dorny/test-reporter@v1
        if: always()
        with:
          name: API Tests
          path: results.xml
          reporter: java-junit

GitLab CI

api-tests:
  image: ghcr.io/jetclient/jetclient-cli:latest
  script:
    - jetclient run . -e ci -r junit --reporter-out junit=./results.xml
  artifacts:
    when: always
    reports:
      junit: results.xml

Jenkins

pipeline {
    agent {
        docker {
            image 'ghcr.io/jetclient/jetclient-cli:latest'
        }
    }
    stages {
        stage('API Tests') {
            steps {
                sh 'jetclient run . -e ci -r junit --reporter-out junit=./results.xml'
            }
            post {
                always {
                    junit 'results.xml'
                }
            }
        }
    }
}

Environment-Specific Configuration

Use environment variables to configure the CLI in CI/CD:

# GitHub Actions example
env:
  JETCLIENT_ENV: ci,automated
  JETCLIENT_INSECURE: "true"  # Only for self-signed certs in test environments

Pass secrets as runtime variables:

docker run --rm -v $(pwd):/workspace ghcr.io/jetclient/jetclient-cli run . \
  -V "apiKey=$API_KEY" \
  -V "baseUrl=$API_URL"