RPSK = rails project starter kit
This tool is created to simplify the process of creating and deploying rails application.
It generates 3 tools:
- rails application itself (prepared by rails_apps_composer)
- deploy project (capistrano 3 based)
- provisioning project (ansible-based).
Rails application includes:
- devise with basic UI and sign in/sign up functonality
- rubocop with preconfigured config
- some other usefull tools.
Note: All gems will be of last available version.
Capistrano project uses capistrano 3 and is preconfigured to deploy application to provisioned server, defined by ansible scripts.
Ansible-based provisioning tool includes:
- required users (
chef
sudoer and application user) - rvm
- postgresql
- nginx
- monit with web interface accessible at
http://staging-host-FQDN/monit/
- munin with web interface accessible at
http://staging-host-FQDN/munin/
- configuration files required by application
All packages will be installed from apt repos at latest version available there.
General:
Required to run provisioning scripts:
- Ansible
- rvm_io.rvm1-ruby ansible playbook
ansible-galaxy install rvm_io.rvm1-ruby
- 'Blank'-state Ubuntu host with FQDN assigned
To generate a new application it's necessary to simply run ./init.sh
You will be asked to enter:
base dir for project
- It's a directory on your machine, where generated project directories will be putproject name
- Just a name for you projectruby version
- No need to explainstaging server address
- FQDN of staging host, address on which your application will be accessiblestaging server application user
- User who will be in charge of running your application on staging hostinitial provisioning user name
- User who has root/sudo access to your 'blank' state host. Usuallyroot
for Linode, Digitalocean,vagrant
for vagrant boxesgit repository address
- Git repository address which capistrano will try to deploy from
After generation is completed, review group_vars/staging.yml
file from provisioning
directory and change default passwords
To provision staging host, from provisioning
directory, run ./initial.sh
to prepare staging host for provisioning, then ./provision.sh
to perform provisioning.
The last one, you need to deploy your application using capistrano project. After deployment it will be running at http://staging-host-FQDN/
- Provisioning directory includes
Vagrantfile
with two virtual machines, one with Ansible installed, second in 'blank' state, to try provisioning on virtual machine before going live. - Keep provisioning. Keep provisioning scripts up-to-date with your application's requirements.
- Pull-requests are appreciated