2022-12-09 23:22:52 +01:00
|
|
|
require 'mina/rails'
|
|
|
|
require 'mina/git'
|
|
|
|
require 'mina/rbenv' # for rbenv support. (https://rbenv.org)
|
|
|
|
|
|
|
|
# Basic settings:
|
|
|
|
# domain - The hostname to SSH to.
|
|
|
|
# deploy_to - Path to deploy into.
|
|
|
|
# repository - Git repo to clone from. (needed by mina/git)
|
|
|
|
# branch - Branch name to deploy. (needed by mina/git)
|
|
|
|
|
2023-01-28 21:53:17 +01:00
|
|
|
set :application_name, 'residency'
|
2023-01-24 09:49:16 +01:00
|
|
|
#set :domain, 'www.rubydesign.fi'
|
2022-12-09 23:22:52 +01:00
|
|
|
set :domain, '192.168.129.10'
|
2023-01-28 21:53:17 +01:00
|
|
|
set :deploy_to, '/home/feenix/residency'
|
|
|
|
set :repository, "https://github.com/HubFeenixMakers/residency.git"
|
2022-12-09 23:22:52 +01:00
|
|
|
set :branch, 'main'
|
|
|
|
|
|
|
|
# Optional settings:
|
|
|
|
set :user, 'feenix' # Username in the server to SSH to.
|
|
|
|
# set :port, '30000' # SSH port number.
|
|
|
|
# set :forward_agent, true # SSH forward_agent.
|
|
|
|
|
|
|
|
# Shared dirs and files will be symlinked into the app-folder by the 'deploy:link_shared_paths' step.
|
|
|
|
# Some plugins already add folders to shared_dirs like `mina/rails` add `public/assets`, `vendor/bundle` and many more
|
|
|
|
# run `mina -d` to see all folders and files already included in `shared_dirs` and `shared_files`
|
2023-01-12 21:35:07 +01:00
|
|
|
set :shared_dirs, fetch(:shared_dirs, []).push('tmp/pids' , 'tmp/sockets' , 'public/uploads')
|
2022-12-09 23:22:52 +01:00
|
|
|
set :shared_files, fetch(:shared_files, []).push('config/master.key')
|
|
|
|
|
2023-01-15 21:00:26 +01:00
|
|
|
set :force_migrate , true
|
|
|
|
|
2022-12-09 23:22:52 +01:00
|
|
|
# This task is the environment that is loaded for all remote run commands, such as
|
|
|
|
# `mina deploy` or `mina rake`.
|
|
|
|
task :remote_environment do
|
|
|
|
# If you're using rbenv, use this to load the rbenv environment.
|
|
|
|
# Be sure to commit your .ruby-version or .rbenv-version to your repository.
|
|
|
|
invoke :'rbenv:load'
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
# Put any custom commands you need to run at setup
|
|
|
|
# All paths in `shared_dirs` and `shared_paths` will be created on their own.
|
|
|
|
task :setup do
|
|
|
|
# command %{rbenv install 2.5.3 --skip-existing}
|
|
|
|
# command %{rvm install ruby-2.5.3}
|
|
|
|
# command %{gem install bundler}
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Deploys the current version to the server."
|
|
|
|
task :deploy do
|
|
|
|
# uncomment this line to make sure you pushed your local branch to the remote origin
|
|
|
|
# invoke :'git:ensure_pushed'
|
|
|
|
deploy do
|
|
|
|
# Put things that will set up an empty directory into a fully set-up
|
|
|
|
# instance of your project.
|
|
|
|
invoke :'git:clone'
|
|
|
|
invoke :'deploy:link_shared_paths'
|
|
|
|
invoke :'bundle:install'
|
|
|
|
invoke :'rails:assets_precompile'
|
2023-01-15 21:00:26 +01:00
|
|
|
invoke :'rails:db_migrate'
|
2022-12-09 23:22:52 +01:00
|
|
|
invoke :'deploy:cleanup'
|
|
|
|
|
|
|
|
on :launch do
|
|
|
|
in_path(fetch(:current_path)) do
|
|
|
|
invoke :'passenger:restart'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# you can use `run :local` to run tasks on local machine before of after the deploy scripts
|
|
|
|
# run(:local){ say 'done' }
|
|
|
|
end
|
|
|
|
|
|
|
|
namespace :passenger do
|
|
|
|
desc "Restart Passenger"
|
|
|
|
task :restart do
|
|
|
|
command %{
|
|
|
|
echo "-----> Restarting passenger"
|
|
|
|
#{echo_cmd %[touch tmp/restart.txt]}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|