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

How to run a node project using postgress db (populated by a seed file) in the bitbucket pipeline ?

Hi, 

I have a node project using postgres db via sequelize. My purpose is to run integration tests within pipeline.   

Installation phase goes well, but then it complains that it doesn't find the table where to push seed file (predefined record, which can be pushed to the table). Issue is that tables have not yet been created as those are created when the project starts after npm start command. Tried to add npm start after npm install, but then it just runs continuously.
How to make this work, is there a way to make npm start to run on background ?
I would appreciate example :)
pipelines:
default:
- step:
image: node
script:
- npm install
- npm run seed
- npm test
services:
- postgres
definitions:
services:
postgres:
image: postgres
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres

1 answer

0 votes
Riley Venable (Atlas Bench)
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 20, 2023

You can try adding the command "npm start &" to your bitbucket-pipelines.yml file after the "npm install" command. This will run the "npm start" command in the background, allowing the "npm run seed" and "npm test" commands to run afterwards.

Suggest an answer

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

Atlassian Community Events