This repository provides CI/CD pipeline integration with Gerrit for automated firmware testing.
- Gerrit repository linked with FirmwareCI (Integration Guide)
Automates firmware binary job-request to FirmwareCI, handling authentication, upload, and job creation with Gerrit metadata.
Displays FirmwareCI job results directly in Gerrit's Checks tab with real-time status updates.
-
Set required environment variables:
export FWCI_TOKEN="your-token" export FWCI_WORKFLOW_ID="your-workflow-id" export BINARIES="Binary=path/to/firmware.bin" export COMMIT_HASH="$(git rev-parse HEAD)"
-
Run job-request:
./job-request-script.sh
Variable | Description |
---|---|
FWCI_TOKEN |
FirmwareCI authentication token |
FWCI_WORKFLOW_ID |
Workflow ID to execute |
BINARIES |
Key-value pairs of template names to binary paths |
COMMIT_HASH |
Git commit hash |
Variable | Description |
---|---|
CHANGE_ID |
Gerrit change ID |
PROJECT |
Gerrit project name |
CHANGE_NUMBER |
Gerrit change number |
CURRENT_REVISION |
Current revision |
PATCHSET |
Patchset number |
Variable | Description |
---|---|
FWCI_EMAIL |
Account email (instead of token) |
FWCI_PASSWORD |
Account password (instead of token) |
FWCI_API |
API URL (default: https://api.firmwareci.9esec.dev:8443) |
Modify the CONFIG
object in checks-plugin.js
:
const CONFIG = Object.freeze({
PLUGIN_VERSION: "1.0.0",
API_VERSION: "3.12.0",
FIRMWARE_CI_API_URL: "https://api..com/app",
POLLING_INTERVAL_SECONDS: 60,
});
stage('FirmwareCI Testing') {
environment {
FWCI_TOKEN = credentials('fwci-token')
FWCI_WORKFLOW_ID = 'your-workflow-id'
BINARIES = 'Binary=build/firmware.bin'
COMMIT_HASH = sh(script: 'git rev-parse HEAD', returnStdout: true).trim()
CHANGE_ID = env.GERRIT_CHANGE_ID
PROJECT = env.GERRIT_PROJECT
CHANGE_NUMBER = env.GERRIT_CHANGE_NUMBER
PATCHSET = env.GERRIT_PATCHSET_NUMBER
}
steps {
sh './job-request-script.sh'
}
}
- Gerrit 3.12+
- Gerrit repository linked with FirmwareCI (Integration Guide)
- Deployment script configured with Gerrit metadata
cp checks-plugin.js /path/to/gerrit/plugins/firmware-ci-checks.js
- Authentication fails: Verify
FWCI_TOKEN
is valid - File not found: Check
BiNARIES
paths exist and are accessible - No results in Checks tab: Verify Gerrit metadata variables are set in the script