kathytbui / viewing_party

Starter repo for a backend module 3 project.
0 stars 1 forks source link

Travis CI failing to deploy to Heroku #33

Closed ajtran303 closed 4 years ago

ajtran303 commented 4 years ago

Our production environment hasn't updated in the last three pull requests

The build logs show the same messages:

Preparing deploy
No stash entries found.
API request failed.
Message: Couldn't find that app.
Reference: 
failed to deploy

Edit: this may not be the strat, see followup posts below

I think we can fix it with some command line prompts:

  1. manually deploy main branch
  2. set the ENV vars
    git branch main
    git push origin heroku
    figaro heroku:set -e production
ajtran303 commented 4 years ago

But I actually don't know how to debug the Travis build log so I may be off the mark.

ajtran303 commented 4 years ago

Builds triggered from Pull Requests will never trigger a deploy.

https://docs.travis-ci.com/user/deployment/heroku/

ajtran303 commented 4 years ago
# .travis.yml

langauge: ruby
rbenv:
- 2.5.3
addons:
  postgresql: 9.6
script:
- bundle exec rails db:{create,migrate} RAILS_ENV=test
- bundle exec rspec
deploy:
  provider: heroku
  api_key:
    secure: SECURE_KEY
  app: 
  run: rails db:migrate
  on:
    repo: Kathybui732/viewing_party
    branch: main

app: key is not paired with a value. That would totally explain Message: Couldn't find that app.

This StackOverflow post says that we should use the randomly-generated app name with dashes for the key-value pair.

ajtran303 commented 4 years ago

app: key is not paired with a value. That would totally explain Message: Couldn't find that app.

This StackOverflow post says that we should use the randomly-generated app name with dashes for the key-value pair.

I think this is the strategy. Add the app name. Check out the comment in this snippet:

# .travis.yml

  app: your-app-name # optional if it's the same as your repo name

Our Heroku app name is definitely not the same as our repo name! So that makes it not optional. Definitely need to pair a value to that key.

But now I wonder - how did our app get deployed at all the first time around? Was the name changed or deleted or anything? I don't think so....