This is a bash written tool for too simple deployment your rails application.
Don't setup this via root User.
Requirenents
- git
- vim
- curl
- 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
- Go to your app folder location:
$ cd /home/deploy_user/myapp
- Choose your RVM gemset:
$ rvm gemset use my_gemset_name
- Setup deploy process
$ mars s #start
List of jobs which mars will make:
- Bundle install
- Migrate database
- Precompile assets
- Restart passenger
- Restart Redis
- 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
$ mars conf git name email username
#rewriting ~/.gitconfig and connecting gitconfig of mars
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