How do you build and test an Execution Environment in CI?
AdvancedProductionTesting, CI/CD and Quality
Answer
The EE is the runtime for every job, so it gets the same pipeline as any container image: build, test, scan, push, promote.
# execution-environment.yml
version: 3
images:
base_image:
name: quay.io/centos/centos:stream9
dependencies:
ansible_core:
package_pip: ansible-core==2.18.6
ansible_runner:
package_pip: ansible-runner
galaxy: requirements.yml
python: requirements.txt
system: bindep.txt
ansible-builder build -t registry.example.com/ee-platform:1.8.0 -f execution-environment.yml
podman run --rm registry.example.com/ee-platform:1.8.0 ansible-galaxy collection list
trivy image registry.example.com/ee-platform:1.8.0
Then run the Molecule or smoke tests with the new image before pushing. Tag immutably (1.8.0, plus the Git SHA), never deploy latest, and roll the new tag through dev and staging job templates first.
More on Testing, CI/CD and Quality
What does a testing pyramid look like for Ansible code?BeginnerHow do you roll out `ansible-lint` profiles across a team without blocking everyone?IntermediateWhen do you use `skip_list`, `warn_list` and `# noqa`?IntermediateHow do you set up pre-commit hooks for an Ansible repo?BeginnerHow is a Molecule scenario laid out, and what does `molecule test` actually run?IntermediateDocker, Podman or real VMs as the Molecule driver: how do you choose?Advanced