mina works

This commit is contained in:
Torsten 2022-03-29 18:48:48 +03:00
parent 8e0fed4893
commit 5de9bc5690
4 changed files with 70 additions and 66 deletions

View File

@ -27,9 +27,7 @@ end
group :development do group :development do
gem "web-console" gem "web-console"
gem "rack-mini-profiler" gem "rack-mini-profiler"
gem "capistrano", "~> 3.17", require: false gem "mina"
gem 'capistrano-rbenv' , require: false
gem "capistrano-rails", require: false
end end
group :test do group :test do

View File

@ -68,25 +68,10 @@ GEM
tzinfo (~> 2.0) tzinfo (~> 2.0)
addressable (2.8.0) addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
bindex (0.8.1) bindex (0.8.1)
bootsnap (1.11.1) bootsnap (1.11.1)
msgpack (~> 1.2) msgpack (~> 1.2)
builder (3.2.4) builder (3.2.4)
capistrano (3.17.0)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-bundler (2.0.1)
capistrano (~> 3.1)
capistrano-rails (1.6.2)
capistrano (~> 3.1)
capistrano-bundler (>= 1.1, < 3)
capistrano-rbenv (2.2.0)
capistrano (~> 3.1)
sshkit (~> 1.3)
capybara (3.36.0) capybara (3.36.0)
addressable addressable
matrix matrix
@ -139,6 +124,9 @@ GEM
marcel (1.0.2) marcel (1.0.2)
matrix (0.4.2) matrix (0.4.2)
method_source (1.0.0) method_source (1.0.0)
mina (1.2.4)
open4 (~> 1.3.4)
rake
mini_mime (1.1.2) mini_mime (1.1.2)
minitest (5.15.0) minitest (5.15.0)
msgpack (1.4.5) msgpack (1.4.5)
@ -153,8 +141,6 @@ GEM
net-protocol (0.1.2) net-protocol (0.1.2)
io-wait io-wait
timeout timeout
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-smtp (0.3.1) net-smtp (0.3.1)
digest digest
net-protocol net-protocol
@ -163,6 +149,7 @@ GEM
nio4r (2.5.8) nio4r (2.5.8)
nokogiri (1.13.3-x86_64-linux) nokogiri (1.13.3-x86_64-linux)
racc (~> 1.4) racc (~> 1.4)
open4 (1.3.4)
passenger (6.0.12) passenger (6.0.12)
rack rack
rake (>= 0.8.1) rake (>= 0.8.1)
@ -228,9 +215,6 @@ GEM
activesupport (>= 5.2) activesupport (>= 5.2)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
sqlite3 (1.4.2) sqlite3 (1.4.2)
sshkit (1.21.2)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stimulus-rails (1.0.4) stimulus-rails (1.0.4)
railties (>= 6.0.0) railties (>= 6.0.0)
strscan (3.0.1) strscan (3.0.1)
@ -261,13 +245,11 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
bootsnap bootsnap
capistrano (~> 3.17)
capistrano-rails
capistrano-rbenv
capybara capybara
debug debug
haml-rails haml-rails
importmap-rails importmap-rails
mina
net-ssh net-ssh
passenger (>= 5.3.2) passenger (>= 5.3.2)
rack-mini-profiler rack-mini-profiler

View File

@ -1,41 +1,75 @@
# config valid for current version and patch releases of Capistrano require 'mina/rails'
lock "~> 3.17.0" require 'mina/git'
require 'mina/rbenv' # for rbenv support. (https://rbenv.org)
set :application, "gateway" # Basic settings:
set :repo_url, "https://github.com/rubydesign/gateway.git" # 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)
# Default branch is :master set :application_name, 'gateway'
set :branch, :main set :domain, 'web-server.local'
set :deploy_to, '/home/feenix/gateway'
set :repository, "https://github.com/rubydesign/gateway.git"
set :branch, 'main'
# Default deploy_to directory is /var/www/my_app_name # Optional settings:
set :deploy_to, "/home/feenix/gateway" set :user, 'feenix' # Username in the server to SSH to.
# set :port, '30000' # SSH port number.
# set :forward_agent, true # SSH forward_agent.
# Default value for :format is :airbrussh. # Shared dirs and files will be symlinked into the app-folder by the 'deploy:link_shared_paths' step.
# set :format, :airbrussh # 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`
# set :shared_dirs, fetch(:shared_dirs, []).push('public/assets')
# set :shared_files, fetch(:shared_files, []).push('config/database.yml', 'config/secrets.yml')
# You can configure the Airbrussh format using :format_options. # This task is the environment that is loaded for all remote run commands, such as
# These are the defaults. # `mina deploy` or `mina rake`.
# set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto 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'
# Default value for :pty is false # For those using RVM, use this to load an RVM version@gemset.
# set :pty, true # invoke :'rvm:use', 'ruby-2.5.3@default'
end
# Default value for :linked_files is [] # Put any custom commands you need to run at setup
append :linked_files, 'config/master.key' # All paths in `shared_dirs` and `shared_paths` will be created on their own.
#"config/database.yml", task :setup do
# command %{rbenv install 2.5.3 --skip-existing}
# command %{rvm install ruby-2.5.3}
# command %{gem install bundler}
end
# Default value for linked_dirs is [] desc "Deploys the current version to the server."
append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "tmp/webpacker", "public/system", "vendor", "storage" 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:db_migrate'
invoke :'rails:assets_precompile'
invoke :'deploy:cleanup'
# Default value for default_env is {} on :launch do
# set :default_env, { path: "/opt/ruby/bin:$PATH" } in_path(fetch(:current_path)) do
command %{mkdir -p tmp/}
command %{touch tmp/restart.txt}
end
end
end
# Default value for local_user is ENV['USER'] # you can use `run :local` to run tasks on local machine before of after the deploy scripts
# set :local_user, -> { `git config user.name`.chomp } # run(:local){ say 'done' }
end
# Default value for keep_releases is 5 # For help in making your deploy script, see the Mina documentation:
# set :keep_releases, 5 #
# - https://github.com/mina-deploy/mina/tree/master/docs
# Uncomment the following to require manually verifying the host key before first deploy.
# set :ssh_options, verify_host_key: :secure
set :rbenv_ruby, '3.0.3'

View File

@ -1,10 +0,0 @@
# The server-based syntax can be used to override options:
# ------------------------------------
server "web-server.local",
user: "feenix",
roles: %w{web app db},
ssh_options: {
# auth_methods: %w(publickey)
# password: "please use keys"
}