Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
run-rails-master-hook
/log
42 changes: 42 additions & 0 deletions Capfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Load DSL and set up stages
require "capistrano/setup"

# Include default deployment tasks
require "capistrano/deploy"

# Load the SCM plugin appropriate to your project:
#
# require "capistrano/scm/hg"
# install_plugin Capistrano::SCM::Hg
# or
# require "capistrano/scm/svn"
# install_plugin Capistrano::SCM::Svn
# or
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git

# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
# https://github.com/capistrano/rvm
# https://github.com/capistrano/rbenv
# https://github.com/capistrano/chruby
# https://github.com/capistrano/bundler
# https://github.com/capistrano/rails
# https://github.com/capistrano/passenger
#
require "capistrano/rvm"
# require "capistrano/rbenv"
# require "capistrano/chruby"
# require "capistrano/bundler"
# require "capistrano/rails/assets"
# require "capistrano/rails/migrations"
# require "capistrano/passenger"

# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }

require 'capistrano/puma'
install_plugin Capistrano::Puma
install_plugin Capistrano::Puma::Systemd
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
source 'https://rubygems.org'

gem "rack", "~> 2.2"
gem "puma", "~> 4.3"
gem "puma", "~> 6.0"

gem "capistrano3-puma"
gem "capistrano-rvm"
41 changes: 39 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,53 @@
GEM
remote: https://rubygems.org/
specs:
airbrussh (1.5.3)
sshkit (>= 1.6.1, != 1.7.0)
base64 (0.3.0)
capistrano (3.19.2)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-bundler (2.1.1)
capistrano (~> 3.1)
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
capistrano3-puma (7.0.0)
capistrano (~> 3.7)
capistrano-bundler
puma (>= 6.1, < 8.0)
concurrent-ruby (1.3.5)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
logger (1.7.0)
net-scp (4.1.0)
net-ssh (>= 2.6.5, < 8.0.0)
net-sftp (4.0.0)
net-ssh (>= 5.0.0, < 8.0.0)
net-ssh (7.3.0)
nio4r (2.7.4)
puma (4.3.12)
ostruct (0.6.3)
puma (6.6.1)
nio4r (~> 2.0)
rack (2.2.20)
rake (13.3.0)
sshkit (1.24.0)
base64
logger
net-scp (>= 1.1.2)
net-sftp (>= 2.1.2)
net-ssh (>= 2.8.0)
ostruct

PLATFORMS
ruby

DEPENDENCIES
puma (~> 4.3)
capistrano-rvm
capistrano3-puma
puma (~> 6.0)
rack (~> 2.2)

BUNDLED WITH
Expand Down
27 changes: 27 additions & 0 deletions bin/cap
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'cap' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("capistrano", "cap")
27 changes: 27 additions & 0 deletions bin/capify
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'capify' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("capistrano", "capify")
12 changes: 12 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# config valid for current version and patch releases of Capistrano
lock "~> 3.19.2"

set :application, "rails-master-hook"
set :repo_url, "https://github.com/rails/rails-master-hook.git"

set :deploy_to, "/home/rails/rails-master-hook-deploy"

set :keep_releases, 5

set :puma_bind, "tcp://0.0.0.0:9292"
set :puma_systemctl_user, :system
11 changes: 11 additions & 0 deletions config/deploy/production.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
DOCS_SERVER_IP = '138.197.6.175'

set :ssh_options, port: 987
server DOCS_SERVER_IP, user: 'rails', roles: %w(web)

set :rvm_ruby_version, '3.3.4'
set :rvm_custom_path, '/home/rails/.rvm'

set :puma_service_unit_env_vars, %w[
RUN_FILE=/home/rails/rails-master-hook/run-rails-master-hook
]
2 changes: 1 addition & 1 deletion config/puma.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
daemonize true
pidfile "puma.pid"
threads 1, 1
bind "tcp://0.0.0.0:9292"