Hello i have a repository with the following structure:
/backend
/frontend
I want to allow Heroku builds and deploy only when changes are made in backend subdirectory.
I have configured heroku build pack : https://github.com/timanovsky/subdir-heroku-buildpack.git
Adding the env PROJECT_PATH=backend
Heroku successfully builds the subdirectory "backend" (when pushing my branch) but the problem is that it is also building and deploying when a changes are made in the "frontend" subdirectory.
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 an app on Heroku. According to the Heroku App deploy guide I followed the below steps to modify the master.
Steps to make the push on Heroku
$ git add .
$ git commit -am "make it better"
$ git push Heroku master
The build of deploy was successful but the changes didn't reflect on the browser. I used hard refresh multiple times but didn't work.
If your app requires a build step to compress and combine assets and you are not seeing recent changes, then it's likely that you are forgetting to run that build step.
If you are using package such as parcel-bundler. you should run it before you deploy it. That would solve the issue.
You can read more on how to run it automatically whenever you deploy your app from here.
https://devcenter.heroku.com/articles/node-best-practices#hook-things-up
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.
How do I deploy my site from github to heroku?
nbp-229-179:portfolio folder admin$ git push heroku master
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
nbp-229-179:portfolio folder admin$
You might want to look into the GitHub integration, which will allow you to link your heroku app with github, not do any git pushes to heroku anymore but have your application automatically deployed.
With pipelines, you can automatically deploy a staging app with every push to the master branch, and manually promote the staging deployment to production.