The goal was to create a CI/CD pipeline that supported Python packages, Docker images, and OpenShift while following existing enterprise standards.

Why this still matters

The tools have changed, but the central challenge remains: teams need delivery pipelines that make secure, repeatable releases easier without turning every change into a ceremony. The tradeoff between stronger security controls and developer speed is still a design decision worth making explicitly.

Infrastructure

The pipeline used established services for each part of the delivery process:

CategoryToolPurpose
BuildJenkinsBuild and deployment scripts
SecurityVeraCodeApplication security scanning
RepositoryNexusPython packages and Docker images
SecurityNexus IQDependency scanning
RuntimeOpenShiftContainer orchestration and runtime

Consistency with existing Java pipelines was important. The objective was not to create a special path for Python, but to bring Python services into the same secure delivery model.

Testing with Pytest

The test setup used explicit markers so unit and integration tests could be selected independently:

[pytest]
markers =
  unit: unit tests
  integration: tests that reach external dependencies
python_paths = src
env =
  LOGGING_LEVEL=DEBUG

A marked unit test can then be run with:

python -m pytest -m unit

The important practice is to make test categories visible to the pipeline. Fast unit tests can run on every change, while integration tests can be scheduled where their external dependencies are available.

Python packaging

The package used setup.py, setup.cfg, and requirements.txt to support both local development and the packaging process. A setup.cfg can define the source layout and runtime requirements:

[options]
package_dir =
  = src
packages = find:
python_requires = >= 3.8
include_package_data = True

[options.packages.find]
where = src

The resulting artifacts included a Python wheel, a source archive, and a Docker image. A small, standardized entry point made it possible for the same package to run locally and in the target environment.

Takeaway

A Python service can fit well into an established enterprise pipeline when packaging, tests, security scans, and runtime artifacts are treated as first-class parts of the design.