Setup Redmine & plugins on local machine then deploy to Linux server, possible? - ruby-on-rails

I am new to Ruby on Rails. My questions is:
Is it possible to setup Redmine and install the plugins on my local machine (macOS Sierra), test the Redmine application on localhost, once everything has been done successfully, then only deploy it on a Linux server?
If it is possible, which part of the code should I modify in order to deploy it on Linux server successfully? (Both of my local machine and Linux server are running MySQL database)

Yes it is possible and you don't need to change any part of the Redmine code to do so. Deployment of Rails apps is often done with a tool called Capistrano (http://capistranorb.com/), which executes through ssh on your server, checks out the code and does any additional installation steps necessary. This approach requires you to have your app (Redmine and plugins in your case) in a git repository (or subversion etc). In the simplest case, fork redmine on github and add any plugins as git submodules.
As you're unfamiliar with the platform I'd suggest to start with a simple rails app that you create locally. once you have worked out deployment of that to a remote server, tackle Redmine.
Sounds like a lot of upfront effort but it's worth it since it enables you to work on your local machine, make changes and then deploy the changed code with a single command.

If the Redmine installation on your local host has the same installation path as on the production server, then you can just copy the installation files to the production server. You will also have to copy the database to the production server.
If the installation path is different on your local host and production server, then you will have to install the Redmine and plugin on your production server

Related

docker, vagrant sandboxes in php development

I have a missunderstanding and i want to find the best approach of a development sandbox environment for a PHP project.
I have a github repo that will host the code , .php, .js (will using webpack with babel), .scss files and different machines for development (windows, mac, ubuntu) .
I want to be able to pull the code from git hub , run a command (like vagrant up) and start a VM / container / sandbox with apache2 , php, nodejs that will run to parse .scss files and .js files into one and then be able to start the server on every platform without having to run gulp locally on developers PC, and then have the XAMPP installed with the correct path for apache2 http folder.
What would be the best approach ? To use vagrant VM with a file config on the repo or docker containers ?
I just want to simplify the development experience and to have this automated tools that start a server, compile sass and babel js.
Thank you
While I am a big Docker fan, it isn't always the right tool for the job. Docker has principals like immutability and single-service-per-container that probably won't work well for what you're looking to do without a learning curve.
There is a great open-source Vagrant tool called PuPHPet that make configuring a development environment straightforward.
https://puphpet.com/
From the PuPHPet web site you can configure an image with Apache2, PHP, and NodeJS via their wizard and it will generate a Vagrant file that you to run locally on your workstation. This way you can have all the software you need, without having to deal with installing/maintaining it yourself. It also supports installing databases, queues, and mail applications, should you need them.
For your scenario, I would clone the code from Github onto your workstation (not the VM) and mount it using Synced Folders against Vagrant, but still directly accessible by your IDE.

Deploying Rails github with a SharedServer

I am trying to deploy a Rails application online. My host right now is dream host. Although i am not to sure how to deploy my apps. At the moment i am on a shared server, but i am considering upgrading to a VPS, but the questions remains! Do i need Git hub or not. If i need to have git hub to make it private do i have to pay or an alternative exist.
What I meant by not to sure on how to deploy rails is that I have a localhost provided with webrick and with database.yml settup otherwise everything else is dark for me.
You can use capistrano to deploy you application to shared host or VPS via SSH.
https://help.github.com/articles/deploying-with-capistrano.

How to publish code to local phusion passenger install from development folder?

On my local dev machine I am coding on (ubuntu), I am using the built in rails server (webrick):
rails s
I want to sometimes test things out on a local copy of phusion passenger that I am going to install.
How can I automate pushing the files to my phusion passenger server?
Would a simple script that copies the contents of the folder suffice?
Is it easier to setup capistrano?
Copying the folder would suffice (assuming all of your environment details are the same).
Personally I would just clone my git repository (not sure if you are using source control) into the appropriate folder.

What's the simplest deploy/rollback scheme for a Rails app stored in CVS and destined for a Linux server?

I have a Rails app that is stored in CVS because that is our corporate standard. It needs to be deployed to a single production server that is running Rails using Apache and Phusion Passenger.
About the production server:
RedHat Enterprise Linux 5.1
The app is used internally at our company, not hosted externally.
I have root access and can install necessary software.
I have ssh access to the box, and can also run cvs there if needed.
Current Solution:
I have been using a patched version (a couple of CVS fixes) of capistrano for this, but it's overkill. (I've looked at vlad the deployer, but it does not support CVS.) I want something simpler, with fewer dependencies/patches.
Desired Solution:
I want deployment to be a single command that checks out the tip of the CVS tree and deploys it.
I want rollback to be a single command that reverts to the previously installed version.
A couple of Rakefile tasks, or a shell script would be fine.
Releases need to be uniquely identifiable--either via timestamp, CVS tag, or some sort of version number.
Capistrano is the current gold standard for Rails application deployment; if you already have it working, why do you want to change it?

Ruby on Rails - Capistrano and SVN on Windows. Setup help

I have Subversion setup and running on my local network with windows and svnserve. I'd like to use Capistrano to deploy to a remote ubuntu server but am a bit on unsure on what I need to do to get the client end to work on windows. My understanding is that the remote server needs to be able to tunnel into my subversion server. I've read over a few tutorials but either they or I get all turned around about when they are talking about my local system, my svn server, or my remote system and of course almost none of them talk about capistrano and windows together.
Do I need to setup Apache to serve my subversion repository? I'd rather not but if I must what are the steps?
I found this tutorial but I have no idea if it will enable ssh access to the repository
You could try having capistrano checkout your code locally, zip and send it to the server. This isn't as efficient has having the server access svn because it has to send the entire codebase every time, but it will save you the trouble of exposing your repository to the outside.
From this page on the capistrano website, under Deployment Strategies:
set :deploy_via, :copy
set :copy_strategy, :export
set :copy_compression, :zip
You will need a command line zip utility available to make this work. The Info-Zip FTP site has one available.
I'm not a Windows person, but my understanding is that in Capistrano's normal state, it executes all of its commands on the server. That is why it needs to be able to pull the code via SVN from your machine.
Looking at that tutorial, it appears as though it is using Apache as the mechanism to allow a client(in this case Capistrano) to pull source code from your Windows machine. This will work for what you want to do.
You don't have to setup Apache in order to accomplish this, you could probably setup an SSH server on your Windows machine, though that is out of my realm of knowledge. :-)

Resources