Files
qt6-migration-pipeline/external-dependencies/postgresql/Jenkinsfile
T
torstenandCopilot 505b05cfaa Add external dependencies CI/CD pipelines with SBOM generation
- Create external-dependencies directory structure with per-package pipelines
- Add DEPENDENCIES-INVENTORY.md with comprehensive dependency tracking
- Create ubuntu-26.04-build-container base image with all dependencies
- Add per-package Jenkinsfiles: log4qt, grantlee, googletest, postgresql, qt6-framework, kdreports
- Add SBOM generation script (generate-sbom.sh) for CycloneDX, SLSA v1.0, and license reports
- Integrate SBOM generation into all Jenkins pipelines
- Add external-dependencies/README.md with usage and security documentation
- Exclude proprietary license files (rti_license.dat) from git tracking

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Entire-Checkpoint: 01M6KNFNMSPW4SY4J4SQTTPVBP
2026-11-04 16:15:13 +00:00

95 lines
2.9 KiB
Groovy

pipeline {
agent any
environment {
PG_VERSION = '16'
HARBOR_REGISTRY = 'harbor.sl.defence-elec.de/proxydockerhub'
IMAGE_NAME = 'postgresql'
IMAGE_TAG = "${PG_VERSION}"
}
options {
timeout(time: 15, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '10'))
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build PostgreSQL Container') {
steps {
script {
dir('external-dependencies/postgresql') {
sh """
docker build \
--build-arg PG_VERSION=${PG_VERSION} \
-t ${HARBOR_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG} \
.
"""
}
}
}
}
stage('Verify PostgreSQL') {
steps {
script {
sh """
docker run --rm ${HARBOR_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG} bash -c '
psql --version
'
"""
}
}
}
stage('Generate SBOM') {
steps {
script {
dir('external-dependencies/postgresql') {
sh """
mkdir -p sbom
# Set environment variables for SBOM generation
export GIT_URL="${env.GIT_URL}"
export GIT_COMMIT="${env.GIT_COMMIT}"
export BUILD_NUMBER="${env.BUILD_NUMBER}"
export DOCKERFILE_PATH="external-dependencies/postgresql/Dockerfile"
# Generate CycloneDX SBOM, SLSA provenance, and license report
bash ../scripts/generate-sbom.sh postgresql ${PG_VERSION} ./sbom
"""
}
}
}
}
stage('Push to Registry') {
steps {
script {
withCredentials([usernamePassword(
credentialsId: 'harbor-credentials',
usernameVariable: 'HARBOR_USER',
passwordVariable: 'HARBOR_PASSWORD'
)]) {
sh """
echo ${HARBOR_PASSWORD} | docker login ${HARBOR_REGISTRY} -u ${HARBOR_USER} --password-stdin
docker push ${HARBOR_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}
docker logout ${HARBOR_REGISTRY}
"""
}
}
}
}
}
post {
always {
cleanWs()
}
}
}