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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to use mysql service inside my custom service in bitbucket-pipelines


The below one is the bitbucket-pipelines.yml 

nameRunning Rspec        
          - bundler
          - yarn


          - apt-get update
          - curl -sL | bash -
          - apt-get update && apt-get install -y nodejs
          - curl -sS | apt-key add -
          - apt-get update
          - apt-get install -y yarn
          - apt-get install -y mutt
          - cp Gemfile.CI Gemfile
          - bundle install
          - yarn install
          - rspec
          - mysql
          - elasticsearch
          - docker
image: customservice


 I need some way to connect my customservice to mysql service.

CustomService will start a rails container on spinning a container.

while starting the container it needs to connect to mysql service. I have tried configuring the host as, localhost, mysql in the database.yml. But nothing worked

Please help me if I am doing something wrong.

1 answer

1 accepted

0 votes
Answer accepted

How about running this directly via docker in the script section?
Also take note that there is a limitation that there is no mechanism waiting for the service startup.

Thanks for the reply.

My Customservice was able to connect to MySQL on localhost.

For that, I need to put some sleep time before I start the rails server.

Like Radek Antoniuk likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

487 views 16 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you