You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.