Skip to content

Latest commit

 

History

History
164 lines (129 loc) · 3.41 KB

README.md

File metadata and controls

164 lines (129 loc) · 3.41 KB

Mars

This is a bash written tool for too simple deployment your rails application.

logo

Don't setup this via root User.

Installing

Requirenents

  1. git
  2. vim
  3. curl
  4. rvm
$ git clone https://github.com/enotikalt/mars.git
$ mv mars ~/.mars
$ touch ~/marsvars && cd .mars && ./mars.bash

.mars folder needs to be in your ubuntu home folder.

Reload your .bash_profile or .profile or .bashrc file to start using it

$ source ~/.bashrc

Test by command

$ mars r #reload

If success - it will not show an error lol:p

Deploy rails application

  1. Go to your app folder location:
$ cd /home/deploy_user/myapp
  1. Choose your RVM gemset:
$ rvm gemset use my_gemset_name
  1. Setup deploy process
$ mars s #start

List of jobs which mars will make:

  1. Bundle install
  2. Migrate database
  3. Precompile assets
  4. Restart passenger
  5. Restart Redis
  6. Restart sidekiq (with daemon-reloading of systemctl)
# Manually you can restart NGINX by command:
$ mars restart-nginx #OPTIONALLY!!! 

These are ADDITIANALS commands for simplify deploy RAILS BASED APP process

$ mars precompile
#This is alias for `assets:precompile` with production environment 
#WARNING: You need to know that assets:precompile also makes `webpacker:compile` even if you don't using sprockets gem!
$ mars migrate
#This is alias for `db:migrate` with production environment
$ cd myapp_location
$ mars restart-passenger
#Alias passenger-config restart-app /home/deployuser/your_app_location
$ mars restart-nginx
#Here you doing restarting Systemd service, so, you may
#shoult enter sudo password
$ mars restart-redis
#Here you doing restarting Systemd service, so, you may
#shoult enter sudo password
#-> Be sure you have `/lib/systemd/system/sidekiq.service` file
#IF NOT - JUST enter this before:
$ mars conf sidekiq
#THEN Setting it UP! Just change your app name and Ruby version with RVM gemset inside `sidekiq.service` file.
#
#
#Yay! Let's restart this now
# 
$ sudo mars restart-sidekiq
#Here you doing restarting Systemd service, so, you may
#shoult enter sudo password

Editing Here are a few commands which allows you to edit some configurations.

$ mars edit vim
#editing file .mars/lib/_vimrc
$ mars edit git
#editing file .mars/lib/_gitconf
$ mars edit core
#editing mars code of core
$ mars edit hello
#editing mars PS1 variable

Configurating

Commands which allows configuration

$ mars conf vim
#installing vim plug
#installing jellybeans colorscheme
#rewriting your ~/.vimrc for connect mars vimrc file with custom configuration
$ mars conf hello
#connecting Mars PS1 (prompt hello message) configuration to your .bashrc 
$ mars r
#reloading shell

bash prompt

$ mars conf git name email username
#rewriting ~/.gitconfig and connecting gitconfig of mars

Additional info

This is how should setup the ubuntu sourcing configuration files. So you know about:p

~/.bash_profile source from ~/.profile source from ~/.bashrc source from ~/.mars/lib/loader.bash