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.
Bitbucket Pipelines has a feature called cache which allows one step to produce an artifact which can used by later steps:
https://support.atlassian.com/bitbucket-cloud/docs/cache-dependencies/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should consider that each step runs on a different container, possibly on different host.
The simplest option would be to upload the created image (in step #1) to a repository and pull it / use it as a runner in the next step.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.