← Back to Use Cases
OPERATIONAL CONTROL

CI/CD Breadcrumbs

Pipelines write status per commit/branch; dashboards read without pipeline creds.

The Problem

Your CI/CD pipeline builds and deploys code, but you want a simple dashboard showing build status per commit or branch. You don't want to give dashboard viewers access to CI secrets or build logs, just the high-level status.

Existing CI systems have complex APIs and require authentication even for read-only access. You need something lightweight and public.

The WrenDB Solution

Pipelines write build status to a public stash using their master token. Dashboards, badges, and team members read the status without authentication. Simple, fast, and public by default.

Step-by-Step Guide

1

Create a build status stash

Set up a stash for build statuses:

Terminal
# Create stash
curl -X POST https://wrendb.com/api/stash

{
  "stash_id": "builds789...",
  "master_token": "token-ci123...",
  "message": "Save this token securely..."
}

# Add to your CI environment
export BUILD_STASH_ID="builds789..."
export BUILD_TOKEN="token-ci123..."
2

Update status from CI pipeline

Add status reporting to your pipeline:

.github/workflows/build.yml
name: Build and Test

on: [push, pull_request]

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

      - name: Report build started
        run: |
          curl -X POST https://wrendb.com/api/item/${{ secrets.BUILD_STASH_ID }}/${{ github.sha }} \
            -d '{"status":"running","branch":"${{ github.ref_name }}","started":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}'

      - name: Run tests
        id: tests
        run: npm test

      - name: Report build success
        if: success()
        run: |
          curl -X PUT https://wrendb.com/api/item/${{ secrets.BUILD_STASH_ID }}/${{ github.sha }} \
            -H "Authorization: Bearer ${{ secrets.BUILD_TOKEN }}" \
            -d '{"status":"passed","branch":"${{ github.ref_name }}","completed":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}'

      - name: Report build failure
        if: failure()
        run: |
          curl -X PUT https://wrendb.com/api/item/${{ secrets.BUILD_STASH_ID }}/${{ github.sha }} \
            -H "Authorization: Bearer ${{ secrets.BUILD_TOKEN }}" \
            -d '{"status":"failed","branch":"${{ github.ref_name }}","completed":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}'
3

Create a dashboard (no auth needed)

Build a simple dashboard to display build status:

dashboard.html
<!DOCTYPE html>
<html>
<head>
  <title>Build Dashboard</title>
  <style>
    .build { padding: 1rem; margin: 0.5rem; border: 2px solid black; }
    .passed { background: #90EE90; }
    .failed { background: #FFB6C1; }
    .running { background: #87CEEB; }
  </style>
</head>
<body>
  <h1>Recent Builds</h1>
  <div id="builds"></div>

  <script>
    const STASH_ID = 'builds789...';

    async function loadBuilds() {
      // No auth needed - public read
      const response = await fetch(
        `https://wrendb.com/api/stash/${STASH_ID}/items`
      );
      const data = await response.json();

      const buildsDiv = document.getElementById('builds');
      buildsDiv.innerHTML = '';

      data.items.forEach(item => {
        const build = JSON.parse(item.value);
        const div = document.createElement('div');
        div.className = `build ${build.status}`;
        div.innerHTML = `
          <strong>${item.key.substring(0, 7)}</strong> -
          ${build.branch} -
          ${build.status.toUpperCase()} -
          ${new Date(build.completed || build.started).toLocaleString()}
        `;
        buildsDiv.appendChild(div);
      });
    }

    loadBuilds();
    setInterval(loadBuilds, 10000); // Refresh every 10s
  </script>
</body>
</html>

Why This Works

  • Public visibility - Anyone can see build status without credentials
  • Secure writes - Only CI pipeline can update status with token
  • No database - Just HTTP calls from your pipeline
  • Simple dashboards - Static HTML with JavaScript can display status

Related Use Cases

API Mockups - Store fixture responses for testing Maintenance Switches - Operational flags and switches