Hello everyone,
I having an issue with Bamboo using Docker to spin up a Python container install some packages then run unit tests.
I am using Bamboo YAML spec files for configuring the pipeline. In the Spec file I defined Docker to use the Python image at the plan level.
When the pipeline runs Bamboo spins up the Python container and runs the Build stage to install python packages, but for the Test stage Bamboo spins up another Python container that doesn't have my dependencies and tests fail.
I must be misunderstanding or doing something wrong. Any guidance or assistance would be much appreciated.
Expectation:
- Bamboo Spins up Python container
- pulls code
- install packages
- run tests
All inside the same isolated container.
Example Spec File:
---
version: 2
plan:
project-key: AN
key: PYAPP
name: py app testing
docker:
image: python:3.7
volumes:
${bamboo.tmp.directory}: ${bamboo.tmp.directory}:z
${bamboo.working.directory}: ${bamboo.working.directory}:z
use-default-volumes: false
stages:
- Build environment:
- Build
- Test Ansible Role:
- Test
Build:
tasks:
- script:
- pip install pytest
- pip install -e .
Test:
tasks:
- script:
- pytest