Hello everyone!
Today I discovered bitbucket pipelines and I find it very interesting.
But I have a basic performance problem, probably very common.
I have a script that looks like the following code:
image: docker/compose:1.29.2
pipelines:
default:
- step:
name: Setup
script:
- cp .env.local .env
- docker-compose up -d
- echo Setup done
services:
- docker
- step:
name: Run migrations
script:
- docker-compose run project alembic upgrade head
- echo Migrations done
services:
- docker
- step:
name: Run tests
script:
- docker-compose run project python -m pytest -rP -vv -x
- echo Tests done
services:
- docker
What is the problem? The second step returns Error: No such container
I realized I need to setup the container for each step, but there is any way to do this?
This is a good way to implement what I want??
image: docker/compose:1.29.2
pipelines:
default:
- step:
name: Run migrations
script:
- cp .env.local .env
- docker-compose up -d
- docker-compose run project alembic upgrade head
- echo Migrations done
services:
- docker
- step:
name: Run tests
script:
- cp .env.local .env
- docker-compose up -d
- docker-compose run project python -m pytest -rP -vv -x
- echo Tests done
services:
- docker
Just for context: the docker compose has a mysql, a firestore emulator, and an image that installs certain python packages.