So, I'm trying to deploy a .jar file on Heroku. When I try to deploy it I get this error:
JAR file must have a .jar or .war extension.
I don't know what's going on, I downloaded the java plugin, I downloaded the Heroku CLI plugin.Idk what to do, here's the deploy command.
heroku deploy:jar C:\Users\My Name\Desktop\Tester Bot2\myfile.jar --app mybotapp
You need to escape backslashes and use quotation marks for your path:
heroku deploy:jar "C:\\Users\\My Name\\Desktop\\Tester Bot2\\myfile.jar" --app mybotapp
Related
When I deploy a Laravel 9 project to production, Laravel replies:
Spatie\LaravelIgnition\Exceptions\ViewException: Vite manifest not found at: /var/www/.../public/build/manifest.json in file /var/www/.../vendor/laravel/framework/src/Illuminate/Foundation/Vite.php on line 139
It turns out the files in /public/build folder are not committed in the git repository, thus missing on production server.
Should I?
Install npm on production server and run npm run build to generate the manifest files, or
Include the manifest files (e.g. manifest.json) of /public/build folder into my repository and pull them in production server ...
You can add buildpacks (scripts that are run when your app is deployed. They are used to install dependencies for your app and configure your environment) on Heroku which will allow you to run npm. Well, easy does it on Heroku.
But if you happen to be on Fortrabbit, where you can't run npm or vite in ssh. The simplest way is to build your assets locally (npm run build or vite build) and push them to production.
Make sure you comment the public/build folder in .gitignore before pushing it to production. This might work for a lot (almost) of servers including Heroku without adding buildpacks.
Should this fail, make sure your APP_ENV is set to production APP_ENV=production or anything else except local as the documentation of vite states.
I've one repo sunixi and it has two projects sun-angular(angular) and sun-admin(spring boot) in ts-admin i'm building ts-angular via executions and moving dist into resources/static of sun-admin project after that i'm building the sun-admin. On local enviroment it is working fine but how can i do same in heroku deployment.
structure of repo
sunixi
---sun-angular
---sun-admin
in sun-admin i'm setting workingDirectory as ../sun-angular but while deploying to heroku i'm getting
Cannot run program "npm" (in directory "/tmp/build_02607c07/sun-angular"): error=2, No such file or directory
If you are using a monorepository strategy, an option is to use subdir buildpack to select where is the path of your folder: https://github.com/timanovsky/subdir-heroku-buildpack
If you want to deploy backend and frontend in the same heroku app, the project folder should contains a npm package. Otherwise, i will not work.
I have a template of a clojurescript application from https://github.com/Day8/re-frame-template. So I want to deploy that template without any modifications to Heroku. So I followed the instructions on the README
lein clean lein cljsbuild once min. Then I follow the instructions on Heroku as well on deploying clojure on https://devcenter.heroku.com/categories/clojure-support
But when I check if the application runs all I get is an application error.
So my questions are:
How does one build and deploy a clojurescript app to heroku?
What is the difference in deploying a clojurescript app vs a clojure app
Do I need a clojure server in order to run clojurescript?
How does one even run a standalone clojurescript app on the desktop?
How is the generated app.js related to running a clojurescript app?
I have found it pretty easy to deploy and run a clojure app on Heroku as well as a standalone applicaton on my desktop, I was hoping the same would be true for clojurescript.
Edited:
The error is here: https://floating-depths-33030.herokuapp.com/
To clear the topic for future people finding heroku + clj/cljs, following is a list of working examples. The clojure support on heroku means you can have Clojure webapp deployed. But cljs (like re-frame) actually is pure javascript, have nothing to do with heroku clojure support.
https://github.com/kawasima/back-channeling
https://github.com/zerg000000/table-tmpl
To deploy a re-frame application to Heroku one needs a clojure server, this is where ring comes in. In order to add ring one needs to add +handler while creating a new re-frame project as so:
lein new re-frame <project-name> +handler
This will create a project with a configuration that allows it to be deployable to Heroku.
Steps to deploy to Heroku:
lein clean
lein with-profile prod uberjar
git init
git add .
git commit -m "first commit"
git push heroku master
heroku ps:scale web=1
heroku open
This is application is now readily accessible.
I can not understand what I need to change to make it.
I created a demo project from this blogpost with app.json and Procfile:
web: fsharpi-heroku WebsahrperSuaveHerokuExample1.sln
Next, I tried to deploy it to Heroku in accordance with these recommendations:
heroku create websahrper-with-suave-example --buildpack https://github.com/SuaveIO/mono-script-buildpack.git
heroku git:remote -a websahrper-with-suave-example
git push heroku master
There was an error in Heroku when building the project:
...
Import process completed.
-----> packages.config found, installing dependencies with nuget
Cannot open assembly 'install': No such file or directory.
! Push rejected, failed to compile SuaveFramework app
Could you suggest me a solution if there is one?
Have you tried here:
https://github.com/SuaveIO/heroku-getting-started
Fork it and click the Deploy to Heroku button.
Don't have the rep to comment on the above, but ademar's solution should cover as well as long as you don't have a file named "app.fsx"
The heroku buildpack checks to see if there is a script, then checks for a solution:
https://github.com/SuaveIO/mono-script-buildpack/blob/master/bin/compile#L66
Just make sure there is a .sln file in the project directory (can be empty, just needs to be present) or fork the buildpack and just make it default run mono $YOURPROJECT in the compile step.
When using an sln instead of a script, you need to change your Procfile to:
web: mono Path/execName.exe
I got a task to deploy my app on Heroku.
My app is a tar.gz file that I extract and a command line I need to run.
How can that be deployed to Heroku?
All I can find in the documentation is git repository references.
Heroku uses git as it's deployment mechanism. You will have to extract your tar file locally, initialize a git repo within the directory, and then deploy that to Heroku.