Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Running migration on heroku Edited

Hi guys, I have a doubt about how I can run the migration on Heroku after deploy using pipe, can you help me with that?

This is my pipelines.yml:

image: ruby:2.4.2

pipelines:
default:
- step:
caches:
- bundler
- yarn
script:
- curl -sL https://deb.nodesource.com/setup_10.x | bash -
- apt-get install -y --force-yes nodejs
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- apt-get update && apt-get install -y yarn
- yarn install
- export DATABASE_URL=postgresql://caiena:caiena@localhost/alpop_test
- bin/ci
- bin/webpack
- rspec
- cd ..
- tar czfv application.tgz build/
- mv application.tgz build/
- cd build
artifacts:
- application.tgz
services:
- redis
- postgres
- step:
name: Deploy to production
deployment: production
script:
- pipe: atlassian/heroku-deploy:0.1.1
variables:
HEROKU_API_KEY: $HEROKU_API_KEY
HEROKU_APP_NAME: $HEROKU_APP_NAME
ZIP_FILE: "application.tgz"


definitions:
caches:
bundler: ./vendor
yarn: ./node_modules
services:
redis:
image: redis
postgres:
image: postgres
environment:
POSTGRES_DB: alpop_test
POSTGRES_USER: caiena
POSTGRES_PASSWORD: caiena

1 answer

0 votes

Hi @Eduardo de Vila

Thank you for your question!

Currently the pipe support only deploy command.

Other commands you could run directly with the heroku cli.

 

Cheers,
Oleksandr Kyrdan

I see, is it possible to run the Heroku CLI from the pipelines? If it is possible, can you send me an example?

@Eduardo de Vila yes, for sure, you just execute bash code, just like you installed heroku cli locally to linux (follow https://devcenter.heroku.com/articles/heroku-cli#other-installation-methods) and follow also heroku doc depending on what you exactly need https://devcenter.heroku.com/articles/heroku-cli#getting-started.

Perhaps, if you need to login, you will need to create some secured repository variables for that to not expose this in the pipeline

Regards, Galyna

Like Eduardo de Vila likes this

@Galyna Zholtkevychthank you about the answer. I just followed the article and now it's working perfectly.

Like Galyna Zholtkevych likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

2,317 views 50 18
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