Skip to content

Setup Jenkins #592

@rustyrazorblade

Description

@rustyrazorblade

Summary

Set up a local Jenkins instance via Docker Compose with pipeline configuration stored in the repo. Each database target gets its own independent Jenkins job. Pipelines accept a PR number or branch name as a parameter so they can be triggered against any branch under test.

Docker Compose Setup

Add a jenkins/docker-compose.yml:

services:
  jenkins:
    image: jenkins/jenkins:lts
    ports:
      - "8080:8080"
    volumes:
      - jenkins_home:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock

volumes:
  jenkins_home:

Start with:

cd jenkins
docker compose up -d

Repo Layout

jenkins/
  docker-compose.yml
  docs/
    setup.md
  end-to-end-test/
    Jenkinsfile
  end-to-end-test-<target>/
    Jenkinsfile

Each Jenkins job is configured with:

  • Pipeline script from SCM
  • Script Path: jenkins/<pipeline-name>/Jenkinsfile

Jenkinsfile Structure

Pipelines are parameterized to accept a branch name or PR number:

pipeline {
    agent any
    parameters {
        string(name: 'BRANCH', defaultValue: 'main', description: 'Branch name or PR number (e.g. main, pr/123)')
    }
    stages {
        stage('Checkout') {
            steps {
                git branch: "${params.BRANCH}", url: 'https://github.com/<org>/easy-db-lab.git'
            }
        }
        stage('End-to-End Test') {
            steps {
                sh 'bin/end-to-end-test <options here>'
            }
        }
    }
}

For PR branches, pass refs/pull/<number>/head as the branch name. The docs should cover this distinction.

Tasks

  • Add jenkins/docker-compose.yml
  • Add jenkins/docs/setup.md covering Jenkins startup, initial admin password, plugin installation, job configuration, and how to trigger a run against a PR or branch
  • Define the list of pipelines and their corresponding bin/end-to-end-test arguments
  • Add a Jenkinsfile for each pipeline under jenkins/<pipeline-name>/
  • Configure Jenkins jobs (one per pipeline), each pointing to the appropriate Script Path
  • Verify parameterized branch/PR checkout works correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions