How to deploy vuejs + adonis-api only project on heroku? - heroku

First thing i am very new in Vue, adonis and heroku. so please tell me all the steps in answer
i have a project build in vuejs(frontend) and adonisjs api-only and i want to deploy this project on heroku with postgresql database.
What i am done till now:-
1). create a heroku account
2). create a project on heroku
3). upload frontend dist/ folder on heroku using these command
git add --all
git commit -m "initial commit"
git push heroku master
And my frontend run perfectly but i don't know how to deploy backend and how to create database
in heroku.
my working directories are

To deploy the back-end application you can do the same steps as you did for the other application.
Here's what's changing:
Add database with heroku add-ons (https://elements.heroku.com/addons/heroku-postgresql)
! When adding the add-on new heroku environment variables are created. (If they do not appear, see below)
Interesting things to know:
To execute Adonis commands : node ace <your_command> (node ace migration:run)
I advise you to use the heroku environment variables. Don't forget to add the variable ENV_SILENT = true to avoid errors because of the.env file.
Get connection db informations: (on your postgresql add-on):
Some additional information
Personal project deployed on heroku (.gitlab-ci.yml) : https://gitlab.com/CrBast/website
Interesting article : https://scotch.io/tutorials/deploying-adonisjs-apps-to-heroku
If my explanations are not clear, don't hesitate to tell me :)

Related

heroku finds an old project that i ave deleted on my heroku homepages

When I try to disable static files on Heroku it keeps linking to a previous project. However, I deleted all my Heroku projects so there are none in my account.
How is this possible and how do I fix it? The heroku CLI seems to be trying to find vast-depths-55781 but the project I just created is immense-ridge-40969:
Heroku determines which app it should use based on your configured Git remotes.
Run git remote -v to see which ones you have set up; I suspect you'll see one pointing to vast-depths-59781. Remove it by its name, e.g.
git remote remove heroku
You could manually add a remote for your new app (or have just changed the previous one's URL), but Heroku provides a dedicated command for setting this up:
heroku git:remote --app immense-ridge-40969
Now heroku commands should default to the new app in that folder. (You can always provide the --app argument to tell heroku to operate against a different app if you wish.)

How to OPEN Sonarqube Server on Heroku ( -> buildpack https://github.com/NayaraCaetano/heroku-buildpack-sonarqube.git)

What worked so far: I installed sonarqube locally with mvn sonar:sonar I get the results on localhost:9000.
Now I want to do the same thing for our app that is hosted on heroku. I could successfully install the buildpack from NayaraCaetano with
heroku buildpacks:set https://github.com/ https://github.com/NayaraCaetano/heroku-buildpack-sonarqube.git/heroku-buildpack-sonarqube.git -a ourAppName
On heroku I saw that the buildpack was added.
Not working / unclear
So how am I now able to open the sonarqube findings from heroku, I didn't find any documentation on this but not shure if I am missing the point of what this buildpack is supposed to do
In the end we were able to use sonarcloud.io. Since our heroku app was anyway connected to github we just created an account at sonarcloud that was connected to our master branch.
It's not really the solution i hoped for, but it meet our goal to constantly monitor our code coverage on every commit to the master branch.

How can I deploy a shiny app to Heroku

I have a shiny app and want to deploy it to Heroku. I tried to follow the steps as mentioned in:
https://github.com/btubbs/heroku-buildpack-shiny
I created a git Git repository and put the R files into it. Then, I created an app in heroku and tell Heroku to use a custom buildpack for my app. But, I was not be able to enable Heroku websockets support.
Error is:
Couldn't find that feature.
I can't figure out how to deal with this problem. Is there any other way to deploy the shiny app to Heroku?
Have you seen https://github.com/virtualstaticvoid/heroku-docker-r?
Check out the example shiny app too. To specify additional dependencies, you can still use init.R.
To deploy using Docker, you might have to move your current Heroku app to a container stack. This can be done with the heroku stack:set CLI command:
$ heroku stack:set container
Here's a minimal example. Basically:
Create run.R file with the following
library(shiny)
port <- Sys.getenv('PORT')
shiny::runApp(
appDir = getwd(),
host = '0.0.0.0',
port = as.numeric(port)
)
Commit to git
Create a new heroku app with
heroku create --buildpack https://github.com/virtualstaticvoid/heroku-buildpack-r.git
git push heroku master
That's all there is to it.
Another way would be to deploy using Docker. I am not an expert, but it took me a couple of days to deploy an app using this soluation. Many tutorials exist and could bring you to achieving this.

Deploying Angular-fullstack app on Heroku using Codeship

I'm trying to deploy a website via CodeShip unto Heroku. The site is built with Yeoman's Angular-Fullstack generator, which is pushed to GitHub. Codeship detects the push, builds the entire thing and then the trouble start.
Angular-Fullstack is set up so that the dist/ folder contains the entire Heroku app, so blindly deploying everything will not work on Heroku.
Locally, I can use the Heroku toolbelt to login, add a remote inside the dist folder, and then use grunt buildcontrol to deploy the entire thing unto Heroku.
But in Codeship there are a few caveats:
* I cannot install the Heroku toolbelt with wget because it needs sudo and Codeship doesn't support that
* If I could, I couldn't login to Heroku using the CLI because I cannot interact with the shell in Codeship
* I cannot go into the dist/ folder and after adding the remote, simply push to Heroku because I need to enter my credentials.
Is there a way that I missed here? I'd like to let Codeship handle everything from building to deployment to Heroku (only on the master branch).
Figured it out!
I skipped the step where I was trying to install the Heroku Toolbelt, and just added the repo on Heroku as remote:
git remote add heroku ssh://git#heroku.com/[your-heroku-app-name].git
Codeship has public keys available for every build. So, I added that publick key to my Heroku account.
Then I noticed that Git was still trying to push using HTTPS instead of SSH, so I added this to the deployment script:
git config --global url.ssh://git#heroku.com/.insteadOf https://git.heroku.com/
This made sure that Git uses the SSH url for Heroku. I then let Codeship build the entire project and push it with grunt buildcontrol:heroku.

Setting up an existing Heroku application on a new machine

I've an existing project that works fine on another machine, but I've just upgraded and from within the project development directory, everytime I run a heroku command I have to post-fix it with --app
I feel like I've missed an application setup stage, but I can't figure out what, as everytime it states:
Run this command from an app folder or specify which app to use with --app APP.
Help appreciated.
You can solve this by adding the Heroku app to your .git/config folder.
If you are in the root of your project, run the following command:
git remote add heroku git#heroku.com:appname.git
This will set a line in your .git/config file which the heroku command line tool uses to figure out what app you're using :)
In other words, your local repo doesn't have Heroku app URL configured against an app name
Similarly what we do with git remote add ( we pass git URL as a destination for push/pulling of code )
that how our git know which repo/URL to hit (push/pull from )
Heroku also follows the same method/process.
All you have to do is add Heroku app URL (so that ur Heroku command have a reference for app URL )
it will know against which URL you are running your command against
To confirm if remote named Heroku has been set for your app:
git remote -v
if not configured or if you want it for an existing app
heroku git:remote -a app_name
it's a way to link your folder to the Heroku app
The Heroku recommended way:
heroku git:remote -a my-heroku-app-id -r what-i-want-to-call-it
Source: https://devcenter.heroku.com/articles/git
Run this command from an app folder or specify which app to use with --app APP
The other answers address the first part of that statement, it is perfectly acceptable to run heroku commands in any directory. For example I have a customer facing front end project /front-end and a rails based /back-end project. I often work in the /front-end directory and if I have to connect to the production database I'll run heroku run rails c -a back-end. After I exit irb then I'm back in my desired directory.

Resources