Create Heroku App.json after manual deploy and configuration of App - heroku

I have successfully deployed my app on Heroku, added add-ons, updated env var via the control-panel settings, etc. I am now looking at creating an app.json after the fact. Is it possible to query Heroku in some way to have an app.json generated from the hosted application that I've created?

I found the answer via another SO post: Heroku provides an App.json-creation tool. Simply log into Heroku, navigate to your app and add "/app-json" to the end.
For example:
https://dashboard.heroku.com/apps/your-app-name/app-json

Related

Heroku pipeline drops buildpack settings for Review Apps

I'm currently using Heroku Pipeline feature for automatically detecting, building and deploying pull requests for review.
✓ Create new review apps for new pull requests automatically
URL pattern
Pattern: Random pipeline-xxxxxx-xxxxxx.herokuapp.com
The problem is that my app needs a combination of 2 buildpacks in a specific order in order to boot properly.
The main/production app has this settings and it works fine(e.g. after each time a PR is merged).
From what I see Review Apps doesn't have a concept of buildpack settings and it tries to autodetect it each time.
What I've tried:
Open the latest Review App, set buildpacks, rebuild or push a new commit. It works fine in that Pull Request/branch/Review App but for each new PR this process has to be repeated manually.
Is there any way to overcome this issue?
In case you have a similar issue, one approach that you can use(that worked for me)
app.json Heroku's convention file where you can list your buildpacks among many other settings.

How to set app.json manifest items from the CLI?

Is it possible to set app.json manifest items manually? (i.e. for an app that's already built?)
In case this is an XY problem, what I am interested in is setting success_url via the heroku CLI (rather than in app.json)
Some of these items of the manifest like addons, buildpacks, env, name ... can be changed for apps that's already built using Heroku CLI or Heroku Platform API.
Looking at the Heroku CLI Commands and Heroku Platform API, there is no way to change success_url after the app is built even if you update app.json manually and rebuild the app because the app.json is only used to orchestrate the first time setup of the application.

Heroku - access errors - how to select app

I am trying to get heroku setup locally on my new laptop to be able to access an existing heroku account that has two existing rails apps on it. I was able to install heroku cli locally and I was able to login to heroku. If I run "heroku apps" it lists my two apps. But two things I need help with:
1) I can't remember how to tell heroku which app the git repo in the current folder on my laptop should work with on heroku server. in other words, how do i "select" which app i want to current work with after logging into heroku.
2) when I tried running the "heroku config" command to list existing config vars after logging it it gave me some kind of error message. need some suggestions on what might be causing that too.
Sorry to not include screen shots of errors but on a different company right now. hopefully you can at least help me answer the first question.
Thanks,
Edward
ps. I found this Q&A, does the answer here apply to my question (1)?
How to link a folder with an existing Heroku app
The cause turned out to be that I needed to add the heroku app location as a remote repo using the heroku cli from within my local git repo I had created. I used the following command:
heroku git:remote -a thawing-inlet-61413
where "thawing-inlet-61413" is the name of the app. You can get this by running:
heroku apps
and it will list them.
reference: https://devcenter.heroku.com/articles/git#creating-a-heroku-remote

How can I set Heroku config vars programmatically from inside the app running on Heroku?

I have an app running on Heroku with a small handful of settings that I want to change from time to time, and I'd like to use Heroku config vars to store these settings so they persist durably.
I know I can modify the settings from the Heroku dashboard or the Heroku CLI, but I'd like to modify them from within the app UI.
I can't seem to figure out how to modify the app's Heroku config from within the app code. If I simply modify the dyno's environment, for example, those changes do not persist to the app's config.
You can use Heroku Platform API for this. Especially this part. There is also a ruby client

How can i create a clone of an existing app on heroku from another heroku app as separate app?

I have a main app on heroku and another app A on git in location github:a.
I want to create, when it is necessary, copies of A as A1,A2,A3...AN as separate apps on heroku from my main app automatically with different parameters.
How can i do that?
Edit: This process should be done by my main app automatically.
Updating this answer due to Heroku command DEPRECATION:
heroku fork has been deprecated as a core command as of 12/01/2017.
You will need to install the heroku-fork plugin to continue using this command.
heroku plugins:install heroku-fork
Here is a link to the Github plugin repo.
Use heroku fork to copy an existing application, including add-ons, config vars, and Heroku Postgres data.
See this KB page: Forking Applications.
Heroku toolbelt now provides a fork method to clone an existing application, see my answer here :
how to clone a project on heroku
There is a new feature on Heroku called Review Apps. One can create copies of the app manually or set up automatic copies from new PRs on Github.
Read more at: https://devcenter.heroku.com/articles/github-integration-review-apps
Simply create new applications and push your code to them. If you need to copy data, checkout the pgbackups transfers.
For management purposes, check out this dev center article.
To do this programatically, you'll need to look at the Heroku gem, and then figure out a way of getting something to git push to the appropriate remote. I would be surprised if this was possible to be honest.

Resources