---
title: "CI/CD | Speedscale Docs"
description: "Integrate proxymock into your CI/CD pipeline to enhance deployment confidence with automated traffic replay and testing before production release."
canonical: "https://docs.speedscale.com/proxymock/guides/cicd/"
---

[Documentation index](https://docs.speedscale.com/proxymock/llms.txt) | [Markdown](https://docs.speedscale.com/proxymock/guides/cicd/index.md) | [Canonical page](https://docs.speedscale.com/proxymock/guides/cicd/)

# CI/CD

Use proxymock to validate AI-assisted code changes with recorded traffic. Run replay checks in CI after the build and unit tests, and validate the deployed application in its delivery environment before promoting it to production.

![AI code, AI code review, CI validation, continuous delivery with validation in place, then production](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMzgwIiBoZWlnaHQ9IjMzMCIgdmlld0JveD0iMCAwIDEzODAgMzMwIiByb2xlPSJpbWciIGFyaWEtbGFiZWxsZWRieT0idGl0bGUgZGVzYyI+PHRpdGxlIGlkPSJ0aXRsZSI+QUktYXNzaXN0ZWQgU0RMQzwvdGl0bGU+PGRlc2MgaWQ9ImRlc2MiPkFJIGNvZGUsIEFJIGNvZGUgcmV2aWV3LCBDSSB2YWxpZGF0aW9uLCBjb250aW51b3VzIGRlbGl2ZXJ5IHdpdGggdmFsaWRhdGlvbiBpbiBwbGFjZSwgdGhlbiBwcm9kdWN0aW9uLjwvZGVzYz48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImJnIiB4Mj0iMSIgeTI9IjEiPjxzdG9wIHN0b3AtY29sb3I9IiMwNzE3MjIiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMxMTJkNDIiLz48L2xpbmVhckdyYWRpZW50PjxsaW5lYXJHcmFkaWVudCBpZD0iZ2F0ZSIgeDI9IjEiIHkyPSIxIj48c3RvcCBzdG9wLWNvbG9yPSIjMTc0YjUxIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMTIzNDQ3Ii8+PC9saW5lYXJ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BmaWxsPSJub25lIiBzdHJva2U9IiM5YmM2ZTUiIHN0cm9rZS13aWR0aD0iMS45IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik00IDI0TDE0IDE0TTEzIDI4TDIzIDE4TTE0IDE0QzE3IDUgMjQgMiAzMiAyQzMyIDEwIDI5IDE3IDIwIDIwWk02IDI1TDIgMzNMMTEgMjkiLz48L2c+PHRleHQgeD0iMTIwMyIgeT0iMjEzIiBmb250LXNpemU9IjIyIiBmb250LXdlaWdodD0iNjAwIiBmaWxsPSIjZjNmOWZjIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIj5Qcm9kdWN0aW9uPC90ZXh0PjwvZz48L3N2Zz4=)

[Open diagram full size](https://docs.speedscale.com/img/diagrams/ai-sdlc-pipeline.svg)

Adding anything to your CI/CD pipeline generally involves the same 3 steps:

1.  Adding a step to your **pipeline** (see [#1. The Pipeline](https://docs.speedscale.com/proxymock/guides/cicd/#1-the-pipeline))
2.  Executing the right **script** to perform a desired action (see [#2. The Script](https://docs.speedscale.com/proxymock/guides/cicd/#2-the-script))
3.  Authentication (see [#3. The API Key](https://docs.speedscale.com/proxymock/guides/cicd/#3-the-api-key))

<a id="prerequisites"></a>

## Prerequisites

In order to integrate **proxymock** into your CI/CD you will need:

*   Access to modify your CI/CD pipeline
*   Your **proxymock** API key
*   A paid **proxymock** account (see [proxymock.io](https://proxymock.io/pricing) for pricing details)
*   Pre-recorded traffic files (see [recording](https://docs.speedscale.com/proxymock/getting-started/quickstart/quickstart-cli/#recording) to record from your app)

<a id="1-the-pipeline"></a>

## 1\. The Pipeline

These pipeline examples contain the minimal configuration needed to run **proxymock** with your application.

Examples build a Go binary using `go build` using the golang container image. Your image can be anything you choose as long as **proxymock** has access to your application.

**GitHub**

```yaml
name: CI with proxymock
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    container: golang:1.25
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Build and test with proxymock
        run: |
          go build -o myapp .
          ./proxymock.sh # <--- proxymock script - see below
```

**GitLab**

```yaml
stages:
  - build

# build Go application and test with proxymock
build:
  stage: build
  image: golang:1.25
  script:
    - go build -o myapp .
    - ./proxymock.sh # <--- proxymock script - see below
```

**Jenkins**

```groovy
#!groovy

pipeline {
  agent {
    docker { image 'golang:1.25' }
  }
  stages {
    stage('Build and Test') {
      steps {
        sh 'go build -o myapp .'
        sh './proxymock.sh' // <--- proxymock script - see below
      }
    }
  }
  post{
    success{
      echo "======== pipeline executed successfully ========"
    }
    failure{
      echo "======== pipeline execution failed ========"
    }
  }
}
```

**Azure DevOps**

```yaml
trigger:
  - main

pool:
  vmImage: "ubuntu-latest"

container: golang:1.25

steps:
  - script: |
      go build -o myapp .
      ./proxymock.sh # <--- proxymock script - see below
    displayName: 'Build and test with proxymock'
```

**Google Cloud Deploy with Skaffold**

Add the verify block to your existing Skaffold deploy.

```yaml
apiVersion: skaffold/v4beta13
kind: Config
manifests:
  rawYaml:
    - k8s-deploy.yaml
deploy:
  kubectl: {}
build:
  artifacts:
  - image: myapp
    docker:
      dockerfile: Dockerfile
verify:
  - name: speedscale
    container:
      name: speedscale
      image: golang:1.25
      command: ["/bin/bash"]
      args: ["-c", "go build -o myapp . && ./proxymock.sh"] # <--- proxymock script - see below
```

See [https://skaffold.dev/docs/references/yaml/](https://skaffold.dev/docs/references/yaml/) for spec details.

**AWS CodeBuild**

```yaml
version: 0.2

phases:
  install:
    runtime-versions:
      golang: 1.25
  build:
    commands:
      - go build -o myapp .
      - ./proxymock.sh # <--- proxymock script - see below

artifacts:
  files:
    - myapp
```

**Bitbucket Pipelines**

```yaml
image: golang:1.25

pipelines:
  default:
    - step:
        name: Build and test with proxymock
        script:
          - go build -o myapp .
          - ./proxymock.sh # <--- proxymock script - see below
```

**TeamCity**

```kotlin
import jetbrains.buildServer.configs.kotlin.*
import jetbrains.buildServer.configs.kotlin.buildSteps.script

object Build : BuildType({
    name = "Build and Test"
    
    requirements {
        contains("docker.server.version")
    }
    
    steps {
        script {
            name = "Build and test with proxymock"
            dockerImage = "golang:1.25"
            scriptContent = """
                go build -o myapp .
                ./proxymock.sh # <--- proxymock script - see below
            """.trimIndent()
        }
    }
})
```

**CircleCI**

```yaml
version: 2.1

jobs:
  speedscale:
    docker:
      - image: "golang:1.25"
    steps:
      - checkout
      - run:
          name: Build Go application
          command: go build -o myapp .
      - run:
          name: Run proxymock tests
          command: ./proxymock.sh # <--- proxymock script - see below
```

See a full [config.yml](https://github.com/kenahrens/spd-replay/blob/main/.circleci/config.yml) for more context.

<a id="2-the-script"></a>

## 2\. The Script

Let's fill in the **proxymock.sh** script shown above. Be sure to customize the user settings at the top of the script.

warning

The script expects the `SPEEDSCALE_API_KEY` environment variable to be set (securely) for authentication. See [The API Key](https://docs.speedscale.com/proxymock/guides/cicd/#3-the-api-key).

```sh
#!/usr/bin/env bash

# set the port your application will listen on, where traffic will be replayed
APP_PORT=8080
# set the command to run your application.  ensure this command has all of the
# correct flags and that the environment has all of the configuration needed to
# run your application properly
APP_COMMAND="./my-example-app --log-level debug" # CHANGE ME!

# the path to pre-recorded proxymock traffic
PROXYMOCK_IN_DIR="proxymock"
# optionally, run mock server
RUN_MOCK_SERVER=true

###########################
### USER SETTINGS ABOVE ###
###    SCRIPT BELOW     ###
###########################

# log file paths
REPLAY_LOG_FILE="proxymock_replay.log"
APP_LOG_FILE="proxymock_app.log"
MOCK_LOG_FILE="proxymock_mock.log"

set -e
set -o pipefail 2>/dev/null || true

validate() {
  if [ -z "$SPEEDSCALE_API_KEY" ]; then
  	echo "ERROR: SPEEDSCALE_API_KEY environment variable is not set"
  	exit 1
  fi

  if [ ! -d "$PROXYMOCK_IN_DIR" ]; then
  	echo "ERROR: $PROXYMOCK_IN_DIR does not exist - make sure you have pre-recorded traffic to mock / replay"
  	exit 1
  fi
}

install_proxymock() {
  echo "Installing proxymock..."

  sh -c "$(curl -Lfs https://downloads.speedscale.com/proxymock/install-proxymock)"
  export PATH=${PATH}:${HOME}/.speedscale

  # initialize with API key
  proxymock init --api-key "$SPEEDSCALE_API_KEY"
}

run_mock_server() {
  echo "Starting mock server..."

  proxymock mock \
    --verbose \
    --in "$PROXYMOCK_IN_DIR/" \
    --log-to "$MOCK_LOG_FILE" &
}

run_replay() {
  print_logs() {
    if [ -f "$MOCK_LOG_FILE" ]; then
      echo "=== proxymock mock server logs ==="
      cat $MOCK_LOG_FILE
    fi
    echo "=== proxymock replay logs ==="
    cat $REPLAY_LOG_FILE
    if [ -f "$APP_LOG_FILE" ]; then
      echo "=== application logs ==="
      cat $APP_LOG_FILE
    fi
  }
  trap print_logs EXIT

  # start proxymock replay, with your app, to run your app and replay test traffic
  # against it
  proxymock replay \
    --in "$PROXYMOCK_IN_DIR" \
    --test-against localhost:$APP_PORT \
    --log-to $REPLAY_LOG_FILE \
    --app-log-to $APP_LOG_FILE \
    --fail-if "latency.max > 1500" \
    -- $APP_COMMAND
}

main() {
  validate
  install_proxymock

  if [ "$RUN_MOCK_SERVER" = "true" ]; then
    run_mock_server
  fi

  run_replay
}

main
```

<a id="3-the-api-key"></a>

## 3\. The API Key

**proxymock** requires a valid API key to run. Your API key is created when you first run `proxymock init` and is stored in a config file, at `$HOME/.speedscale/config.yaml` by default.

To make it easy, once [registered](https://docs.speedscale.com/proxymock/guides/initialize/) you can get your API key directly with some command line magic:

```sh
SPEEDSCALE_CONFIG_FILE=$(proxymock version | grep 'Config File' | awk '{print $3}')
SPEEDSCALE_API_KEY=$(cat $SPEEDSCALE_CONFIG_FILE | grep apikey | awk '{print $2}')
echo $SPEEDSCALE_API_KEY
```

info

If this does not produce an API key make sure you are registered first with `proxymock init`.

Make `SPEEDSCALE_API_KEY` available to your pipeline as an environment variable so **proxymock** can be initialized when the pipeline runs.

<a id="need-help"></a>

## Need Help?

Let us know on the [community Slack](https://slack.speedscale.com/) if instructions for your deploy system are not included here.

<a id="drive-proxymock-over-rest"></a>

## Drive proxymock over REST

To script the steps with HTTP and JSON instead of CLI flags, run `proxymock mcp run --http` in the job and call its [REST API](https://docs.speedscale.com/proxymock/guides/rest-api/). Each operation answers with a structured result, and a replay answers with its exit code and score, so a step can fail the build with one `jq` check.

<a id="gate-on-application-results"></a>

## Gate on application results

Use [replay verdicts](https://docs.speedscale.com/proxymock/guides/replay-verdicts/) to distinguish request completion from correct application behavior. Save a baseline replay, then use `--baseline <directory> --fail-on-new-mismatch` to fail on new per-request regressions. For incident recordings, `--verify-fix` checks that recorded failures are fixed without collateral regressions.

Preserve the replay output directory as a CI artifact, including `replay-verdict.json`. These modes need response output and cannot be combined with `--no-out` or `--load-test`. Require essential [blueprints](https://docs.speedscale.com/proxymock/guides/blueprints/) with `--require-blueprint <name>`.

<a id="gate-on-a-cloud-replay"></a>

## Gate on a cloud replay

To run the replay in a Kubernetes cluster through Speedscale cloud instead of on the CI runner, start it and then wait on its report. The status command's exit code is the result:

```bash
REPORT_ID=$(proxymock cloud replay \
  --cluster "$CLUSTER" \
  --namespace "$NAMESPACE" \
  --workload "$WORKLOAD" \
  --snapshot-id "$SNAPSHOT_ID" \
  --output json | jq -r '.reportID')

proxymock cloud replay status "$REPORT_ID" --wait --timeout 30m
```

While it waits, the status command prints each status change and each replay event as it appears, including the operator's suggested fixes, then the goals with expected and actual values. Add `--output json` to get one JSON document on stdout instead.

Decide what each code means for your pipeline. A missed goal is a test result and should fail the build. A replay that could not produce a verdict is an environment problem you may want to retry or alert on instead:

```bash
proxymock cloud replay status "$REPORT_ID" --wait --timeout 30m
case $? in
  0) echo "replay passed" ;;
  1) echo "replay missed its goals"; exit 1 ;;
  4 | 5 | 124) echo "replay produced no verdict, see the report"; exit 1 ;;
  *) echo "proxymock failed"; exit 1 ;;
esac
```

<a id="exit-codes"></a>

## Exit codes

Exit codes are defined per command, so the same number can mean different things in different commands. Any code not listed for a command means a configuration or operational failure.

<a id="proxymock-replay"></a>

### `proxymock replay`

| Exit | Meaning |
| --- | --- |
| `0` | The replay ran and every gate passed |
| `1` | A test config goal missed, or a `--fail-if` condition was true |
| `2` | With `--verify-fix`: the fix was not confirmed |
| `3` | With `--fail-on-new-mismatch`: a pair failed differently than in `--baseline`. With `--verify-fix`: a collateral regression |

See [Replay Verdicts](https://docs.speedscale.com/proxymock/guides/replay-verdicts/) for how each gate decides.

<a id="proxymock-cloud-replay-status"></a>

### `proxymock cloud replay status`

| Exit | Meaning |
| --- | --- |
| `0` | The replay passed. Without `--wait`, also a replay that is still running |
| `1` | Missed Goals: the replay ran and failed its goals |
| `2` | Usage error: bad flags or arguments |
| `4` | The replay ended in Error or was Canceled, so there is no verdict |
| `5` | The report could not be read: not signed in, a network failure, an unknown report ID, or proxymock could not start because its config could not be loaded or it could not connect to Speedscale cloud |
| `124` | `--wait` stopped at `--timeout` while the replay was still running |

Code `3` is not used here. It stays reserved for the replay gates above, so a script that checks for `3` never mistakes a cloud replay result for a new mismatch.

<a id="always-exit-zero"></a>

### Always exit zero

The global `--exit-zero` flag makes any proxymock command exit `0`. Use it for informational steps only, never in a job that gates on the exit code.
