Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,550
Community Members
 
Community Events
184
Community Groups

Pipeline parallel steps that aren't self-contained. Or running background processes/jobs.

Edited

I'm trying to run firebase emulators in a Bitbucket pipeline and simultaneously run commands that would interact with them.

Whilst the emulators are running, new commands cannot be ran. I haven't been able to find a method to run the emulators in the background.

I've tried:

  • Starting processes in the background using '&'
  • Terminal multiplexers like tmux

Bitbucket offers parallel steps (Parallel step options), but these are self-contained. There is no way to pass information between the two containers.

How can I run two processes at the same time? If this is by design, how can I pass information between parallel steps? And if this is intended behaviour, what is the justification?

1 answer

1 accepted

0 votes
Answer accepted

I solved this another way.

I created a new docker image and ran it as a service like so: https://support.atlassian.com/bitbucket-cloud/docs/databases-and-service-containers/

 

Dockerfile:

FROM node:bullseye

COPY .firebaserc /.firebaserc
COPY entrypoint.sh /entrypoint.sh
COPY firebase.json /firebase.json
RUN apt update
RUN apt install -y openjdk-17-jdk-headless
ENTRYPOINT ["/entrypoint.sh"]

 entrypoint.sh

#!/bin/bash

npm i -g firebase-tools
npx firebase-tools emulators:start --token "$TOKEN"

Note: TOKEN is stored as a repository variable and generated using:

firebase login:ci

 

Then modify your bitbucket-pipelines.yml to include:

definitions:
  services:
    emu:
      image: <username>/<image name>
      variables:
        TOKEN: $TOKEN

and the emu service under step:

- step:
script:
...
services:
- emu

 

I hope that helps someone!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events