Parse Jenkins pipeline builds and create DCI (Distributed CI) jobs from them.
This tool fetches build data from Jenkins, downloads artifacts, identifies OpenShift components, and prepares job metadata for DCI integration.
- Python 3.x
- Access to Jenkins API
- DCI credentials (remoteci)
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtExport your DCI credentials (typically by sourcing your dcirc.sh file):
source ~/dcirc.shRequired environment variables:
| Variable | Description |
|---|---|
DCI_CS_URL |
DCI Control Server URL (defaults to https://api.distributed-ci.io) |
DCI_CLIENT_ID |
Your DCI client ID |
DCI_API_SECRET |
Your DCI API secret |
python3 ./parse-job.py <job_name> <jenkins_url>| Argument | Description |
|---|---|
job_name |
Name for the job (used for cache directory) |
jenkins_url |
Jenkins job URL (e.g., https://jenkins.example.com/job/my-pipeline/) |
| Option | Description |
|---|---|
-v, --verbose |
Enable debug logging for troubleshooting |
--no-cache |
Ignore cached data and fetch fresh from Jenkins (remove the .cache folder) |
python3 ./parse-job.py ocp-ztp-deployment https://jenkins.example.com/job/ocp-ztp-deployment/- Fetches job metadata and build history from Jenkins API
- For each build:
- Downloads build data and Blue Ocean pipeline nodes
- Downloads configured artifacts (see
settings.py) - Identifies the OpenShift component from build logs
- Builds a DCI job structure with status, duration, and tasks
├── parse-job.py # Main entry point
├── cli.py # Command-line argument parsing
├── clean.py # Cache management
├── http_client.py # HTTP utilities
├── settings.py # Configuration (artifact filters, DCI settings)
├── dci/
│ ├── client.py # DCI API client
│ ├── component.py # OpenShift component detection
│ ├── files.py # DCI file operations
│ ├── job.py # DCI job building
│ └── tasks.py # DCI task handling
├── jenkins/
│ ├── artifacts.py # Artifact downloading
│ └── nodes.py # Blue Ocean nodes API
└── tests/
└── test_component.py # Component detection tests
Build data is cached in .cache/<job_name>/ to avoid repeated API calls. Use --no-cache to force a fresh fetch.