Skip to content

Commit

Permalink
update capistrano deployment to work with ruby 3.0
Browse files Browse the repository at this point in the history
- Mange ruby version with .ruby-version.  This simplifies management of ruby versions
  across various github actions and capistrano scripts.
- add capistrano-rbenv to simplify deployments to ubuntu system
- remove capistrano-yarn,  It is no longer in use.
  • Loading branch information
alexskr committed Aug 26, 2023
1 parent b024e13 commit 58f6b73
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 71 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/brakeman-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ jobs:
# Customize the ruby version depending on your needs
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'

- name: Setup Brakeman
env:
BRAKEMAN_VERSION: '5.4.0' # SARIF support is provided in Brakeman version 4.10+
BRAKEMAN_VERSION: '6.0.1' # SARIF support is provided in Brakeman version 4.10+
run: |
gem install brakeman --version $BRAKEMAN_VERSION
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7 # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: get-deployment-config
uses: actions/checkout@v3
Expand All @@ -75,7 +74,7 @@ jobs:
mkdir -p ~/.ssh
ssh-keyscan -H ${{ secrets.SSH_JUMPHOST }} > ~/.ssh/known_hosts
shell: bash
- uses: miloserdow/capistrano-deploy@master
- uses: miloserdow/capistrano-deploy@v3
with:
target: ${{ env.TARGET }} # which environment to deploy
deploy_key: ${{ secrets.DEPLOY_ENC_KEY }} # Name of the variable configured in Settings/Secrets of your github project
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ config/deploy/*
/public/assets/
nohup.out

.ruby-version

# Ignore editor files
.idea
*.swp
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.8
3 changes: 1 addition & 2 deletions Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ require 'capistrano/deploy'
# https://github.com/capistrano/rails
#
# require 'capistrano/rvm'
# require 'capistrano/rbenv'
require 'capistrano/rbenv'
# require 'capistrano/chruby'
require 'capistrano/bundler'
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
#require 'capistrano/rails/assets'
#require 'capistrano/rails/migrations'
require 'capistrano/rails'
require 'capistrano/yarn'
require 'capistrano/locally'

# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ end
group :development do
# Capistrano Deployment
gem 'bcrypt_pbkdf', '>= 1.0', '< 2.0', require: false # https://github.com/miloserdow/capistrano-deploy/issues/42
gem 'capistrano', '~> 3.11', require: false
gem 'capistrano', '~> 3.17', require: false
gem 'capistrano-bundler', require: false
gem 'capistrano-rbenv', require: false
gem 'capistrano-locally', require: false
gem 'capistrano-passenger', require: false
gem 'capistrano-rails', '~> 1.4', require: false
gem 'capistrano-yarn', require: false
gem 'ed25519', '>= 1.2', '< 2.0', require: false # https://github.com/miloserdow/capistrano-deploy/issues/42
gem 'html2haml'
gem 'listen'
Expand Down
129 changes: 70 additions & 59 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,22 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.4)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
airbrussh (1.4.1)
airbrussh (1.4.2)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
autoprefixer-rails (10.4.13.0)
execjs (~> 2)
base64 (0.1.1)
bcrypt_pbkdf (1.1.0)
bootstrap (4.1.3)
autoprefixer-rails (>= 6.0.3)
popper_js (>= 1.12.9, < 2)
sass (>= 3.5.2)
brakeman (5.4.1)
brakeman (6.0.1)
builder (3.2.4)
capistrano (3.17.2)
capistrano (3.17.3)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
Expand All @@ -102,12 +103,13 @@ GEM
capistrano (~> 3.0)
capistrano-passenger (0.2.1)
capistrano (~> 3.0)
capistrano-rails (1.6.2)
capistrano-rails (1.6.3)
capistrano (~> 3.1)
capistrano-bundler (>= 1.1, < 3)
capistrano-yarn (2.0.2)
capistrano (~> 3.0)
capybara (3.39.0)
capistrano-rbenv (2.2.0)
capistrano (~> 3.1)
sshkit (~> 1.3)
capybara (3.39.2)
addressable
matrix
mini_mime (>= 0.1.3)
Expand All @@ -123,7 +125,7 @@ GEM
crass (1.0.6)
cube-ruby (0.0.3)
daemons (1.4.1)
dalli (3.2.4)
dalli (3.2.5)
date (3.3.3)
diff-lcs (1.5.0)
domain_name (0.5.20190701)
Expand All @@ -132,7 +134,7 @@ GEM
erubi (1.12.0)
erubis (2.7.0)
eventmachine (1.2.7)
excon (0.99.0)
excon (0.102.0)
execjs (2.8.1)
faraday (2.0.1)
faraday-net_http (~> 2.0)
Expand All @@ -147,7 +149,7 @@ GEM
flamegraph (0.9.5)
globalid (1.1.0)
activesupport (>= 5.0)
graphql (2.0.21)
graphql (2.0.26)
graphql-client (0.18.0)
activesupport (>= 3.0)
graphql
Expand All @@ -162,22 +164,23 @@ GEM
http-accept (1.7.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
i18n (1.13.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
iconv (1.0.8)
jquery-rails (4.5.1)
jquery-rails (4.6.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
json (2.6.3)
language_server-protocol (3.17.0.3)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.20.0)
loofah (2.21.3)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
nokogiri (>= 1.12.0)
lz4-ruby (0.3.3)
mail (2.8.1)
mini_mime (>= 0.1.1)
Expand All @@ -187,15 +190,15 @@ GEM
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mime-types (3.4.1)
mime-types (3.5.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0218.1)
mini_mime (1.1.2)
minitest (5.18.0)
mime-types-data (3.2023.0808)
mini_mime (1.1.5)
minitest (5.19.0)
multi_json (1.15.0)
multipart-post (2.3.0)
mysql2 (0.5.5)
net-imap (0.3.4)
net-imap (0.3.7)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -206,28 +209,31 @@ GEM
net-ssh (>= 2.6.5, < 8.0.0)
net-smtp (0.3.3)
net-protocol
net-ssh (7.1.0)
net-ssh (7.2.0)
netrc (0.11.0)
newrelic_rpm (9.2.0)
newrelic_rpm (9.4.2)
nio4r (2.5.9)
nokogiri (1.14.3-x86_64-darwin)
nokogiri (1.15.4-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.14.3-x86_64-linux)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
oj (3.14.3)
oj (3.16.0)
open_uri_redirections (0.2.1)
parallel (1.23.0)
parser (3.2.2.1)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
popper_js (1.16.1)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
psych (3.3.4)
public_suffix (5.0.1)
racc (1.6.2)
rack (2.2.7)
rack-mini-profiler (3.1.0)
public_suffix (5.0.3)
racc (1.7.1)
rack (2.2.8)
rack-mini-profiler (3.1.1)
rack (>= 1.2.0)
rack-test (2.1.0)
rack (>= 1.3)
Expand All @@ -246,11 +252,13 @@ GEM
bundler (>= 1.15.0)
railties (= 6.1.5.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
rails_autolink (1.1.8)
actionview (> 3.1)
activesupport (> 3.1)
Expand All @@ -269,45 +277,47 @@ GEM
rdoc (6.3.3)
recaptcha (5.9.0)
json
regexp_parser (2.8.0)
regexp_parser (2.8.1)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.5)
rexml (3.2.6)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.5)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.1)
rspec-rails (6.0.3)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
rspec-core (~> 3.11)
rspec-expectations (~> 3.11)
rspec-mocks (~> 3.11)
rspec-support (~> 3.11)
rspec-support (3.12.0)
rubocop (1.50.2)
rspec-core (~> 3.12)
rspec-expectations (~> 3.12)
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.12.1)
rubocop (1.56.1)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.0.0)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
ruby_parser (3.20.0)
ruby_parser (3.20.3)
sexp_processor (~> 4.16)
sass (3.7.4)
sass-listen (~> 4.0.0)
Expand All @@ -321,7 +331,7 @@ GEM
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
select2-rails (4.0.13)
sexp_processor (4.16.1)
sexp_processor (4.17.0)
spawnling (2.1.5)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
Expand All @@ -330,18 +340,18 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sshkit (1.21.4)
sshkit (1.21.5)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stackprof (0.2.25)
temple (0.10.0)
temple (0.10.2)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.2.1)
tilt (2.1.0)
timeout (0.3.2)
thor (1.2.2)
tilt (2.2.0)
timeout (0.4.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
Expand All @@ -350,28 +360,29 @@ GEM
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.4.2)
websocket-driver (0.7.5)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
will_paginate (3.3.1)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.7)
zeitwerk (2.6.11)

PLATFORMS
arm64-darwin-22
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
bcrypt_pbkdf (>= 1.0, < 2.0)
bootstrap (~> 4.1.0)
brakeman
capistrano (~> 3.11)
capistrano (~> 3.17)
capistrano-bundler
capistrano-locally
capistrano-passenger
capistrano-rails (~> 1.4)
capistrano-yarn
capistrano-rbenv
capybara
chart-js-rails
cube-ruby
Expand Down Expand Up @@ -410,4 +421,4 @@ DEPENDENCIES
will_paginate (~> 3.0)

BUNDLED WITH
2.3.22
2.4.18
Loading

0 comments on commit 58f6b73

Please sign in to comment.