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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Halyna Berezovskathank you about the answer. I just followed the article and now it's working perfectly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.