How to install plugins on Redmine hosted on Heroku.com - ruby

Just pushed redmine to the heroku platform,
though I can't get the backlog-plugin to work, it works just fine locally.
I have pushed the local database to heroku aswwell.

Heroku's public directory is not writable. But a default Redmine assumes/requires so, as on start of the app server it copies static assets from the plugins (like images, javascripts, css) to the public/plugin_assets directory. On Heroku, this obviously fails. And as backlogs relies heavily on javascript, it's really noticeable.
A common work-around is to copy these assets manually before deploying. This can be done by running your config locally once and checking the copied assets into source control which is then deployed to Heroku.
Notice that public/plugin_assets is included into the default .gitignore, so you need to remove that from there obviously.

Related

How to update the code of Laravel that is deployed on live server?

The Laravel project made based on vuejs UI is deployed on the server. Now I need to change the code and worked fine on the local machine. But the problem arose that I have to zip all the files and again upload. This seemed tedious. Also when I uploaded it, the application seemed not changed as on the local machine. What should I do? I also don't have a node installed on my Cpanel so that I was unable to run npm run dev.
The preferred way is to use a Version Control System (VCS) like Git.
VCS
Version control systems are software tools that help software teams manage changes to source code over time. Consider uploading your project to a Github repository.
If you Google this, you’ll find tutorials that can explain it much better than we can in an answer here.
Note: You require SSH access to the server in order to run Git commands. Having SSH access will also solve your problem of not being able to run commands like npm run dev. Consider deploying your repository on a Virtual Private Server (VPS).
(S)FTP
There are several ways of deploying. One of them being, manually transferring files using SFTP or FTP. However, as you've mentioned, this is a tedious process.

Cant deploy app to Heroku node modules too big

My node modules by itself take up 500MB.
Heroku only allows 500MB. My complete app is about 700MB. What do web developers do to deploy their app and bypass this problem? It seems create-react-app downloads so much node modules to where it is almost impossible to deploy the app.
Try adding /node_modules to your .gitignore.

How do you deploy build artifacts to Heroku from Codeship?

In starting a new project, I put together the skeleton for a Node app that has tests and generates some build artifacts, like asset compilation and compression. I have the tests running in Codeship so successful builds initiate a deploy to Heroku. They've made it all super easy, except I can't find any way to deploy built files, just a copy of what's in the repo.
Has anyone done this successfully? I feel like writing a custom deploy script to rebuild the assets after the tests and manually deploy them would be working against the existing toolset, and I know can't possibly be the first person to want to do this...
Turns out that Codeship doesn't keep anything, in fact, different servers do the deployment than the testing. It seems that the best-practice here is to recreate the assets on the Heroku side with a custom buildpack, which, directly after the git pull, does the dependency installation and compiles the app slug.

Laravel, Composer, Git workflow

I am new to Laravel, Laravel Homestead, Composer, and the development workflow associated with commiting changes to a Git repository and then pulling those changes to a development/production server. So far after much trial and error, I have managed to:
Set up my local Homestead environment with vagrant.
Create a new Laravel application
Run Composer to fetch dependencies
Access the application locally.
Create a Git repository for my application, commit changes, and push to an origin master branch.
Clone the repository on my remote server (shared hosting on 1and1) and pull the changes in.
For a long time, I couldn't understand why when I pulled the changes to the remote site, I would get PHP errors, but the local site ran just fine. It came down to the fact that the Laravel .gitignore file was ignoring the /vendor directory, which Laravel requires to function. Some Google-fu searches indicate that some people simply run composer update / (composer install ?) on their production servers. (I don't have access to Composer on my shared hosting server, so I am unable to do this)
My question to the community - what do you feel is the best workflow for my given situation? remove the /vendor directory from the .gitignore file? Something else?
Replies are much appreciated.
It looks like you are using GIT as a deployment tool which I dont think is a good idea.
Composer update/install is just for managing dependecies. Some servers dont allow you to run scripts from console or running them is complicated. In this situation you can run composer locally before deployment and send your code to server with all dependencies.
Here are some things that you should keep in mind when designing your workflow:
Use GIT to keep source code and configurations
Use composer to manage dependecies (downloaded dependencies should't be under version control in your GIT repository. Vendor directory and its contetnt is a dependency too)
For deployment use one of deployment tools eg. https://github.com/rocketeers/rocketeer
use the -f flag to forcefully include the vendor directory while using git add.
You are on the right track here, and many will do what you are doing.
The real trouble comes when you are doing multiple server deployments (load balanced, auto-scaling).
Typically what I've seen is a shell script that you would include and run whenever something happens that would require these commands to be run.
Inside of this shell script would be the commands that you want completed every time a new server instance is booted up.
You can do this with a number of tools for a single server environment as well.
I might look into continuous integration tools like Travis CI, Jenkins, etc. If this is a major headache of yours.
Otherwise, it might be overkill.... then just keep doing what you are doing.
adding the vendor directory to your git repo is against best practices.
This is also a decent option involving webhooks:
http://losstopschade.de/post/96967373358
Look at Deploy Laravel Webapp to 1and1

heroku: setup local development with an addon

I'd like to develop a heroku app with the neo4j addon, and i've followed the instructions here but I'm lost as to how to integrate the heroku-like environment variables into my local development environment.
My major goals:
Make things behave as similarly as possible to the deployed app.
Allow me to run automated test suites locally.
Allow me to run the app locally, for quick development iteration.
The only heroku helpcenter article I've found (here) that deals with this seems to recommend always deploying, but this means I have to check-in and push every little edit I make, syntax errors and all, and doesn't allow for running automated tests locally.
It seems like there should be a way for me to edit my Foreman Procfiles to get the desired behavior, but I don't see how I can do that without affecting the deployed processes as well.
This article seems to be what I needed, although I'm still not sure how I was supposed to find it: https://devcenter.heroku.com/articles/config-vars#local-setup
In summary, you can do heroku config > .env to install the production environment locally, then edit the file as needed. Foreman then uses this file to set environment variables.
The article recommends adding the .env file to .gitignore, but as far as I can tell, checking it in is safe since it seems heroku seems to already override it.

Resources