Coding

Deploy php application using Mina

Deploy php app with Mina

All means are good when it comes to deliver final product fast while keeping sustainable quality. Sometimes that may result in strange combinations of various technologies, programming languages and frameworks. That is what happened to me. It was the time when the world went crazy from blazing ReactJs. I had to setup a forum system that worked with existing at that time ruby-powered website. To tell the truth, that was pretty interesting experience that probably will not give me anything in the future, but at least this gave the birth to this post.

I am a ruby developer and i am too lazy to put my hands deep enough into PHP world. I would rather prefer doing PHP staff using familiar ruby tools. That is what i did with deployment of the forum. I used phpBB by the way. Why? Just because i worked with this engine long time ago and there were no particular requirements from the customer. Anyway. Since i already used Mina to deploy a ruby-powered website, that was obvious to use this tiny cute library to deploy phpBB as well.

Although it may sound quite an easy task, i found some non-trivial obstacles that i had to overcome. Lets start with directory structure. phpBB is not a rails app. Thanks cap. It has some quite different philosophy of where to put what, so we need to create 3 so called shared folders:

shared/cache
shared/files
shared/images/upload_icons

Next step will be to set proper ‘current path‘ variable:

set :current_path, ‘htdocs’

Basically here we just adjust rails to apache reality. If you are brave enough to configure Apache you may change this ugly htdocs to something more pleasing to your eyes. Finally we just need to define proper tasks for deployment process:

desc “Deploys the current version to the server.”
task :deploy => :environment do
  deploy do
    invoke :’git:clone’
    invoke :’deploy:link_shared_paths’
    invoke :’deploy:cleanup’
  end
end

You can find complete version of mina configuration in my gist. This is not a rocket science, however doing this for the first time, especially not setting foot on this ground for a long time, can be quite a tricky task. Hope this will save someone’s nerves. Good luck.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copy Protected by Chetan's WP-Copyprotect.
%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close