Skip to content

Commit

Permalink
chore: set staging and improve some code
Browse files Browse the repository at this point in the history
  • Loading branch information
loqimean committed Sep 23, 2024
1 parent 6993c52 commit ab5ecfc
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
ruby-version: 3.2.5
bundler-cache: true
cache-version: 1
- name: Run rubocop
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
ruby-version: 3.2.5
bundler-cache: true

- uses: actions/setup-node@v1
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-3.2.2
ruby-3.2.5
2 changes: 0 additions & 2 deletions Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ require "capistrano/bundler"
require "capistrano/rails/assets"
require "capistrano/rails/migrations"
require "capistrano/passenger"
require "capistrano/yarn"
require "capistrano/rails_tail_log"
require "capistrano/rails"
require "capistrano/rbenv"
require "dotenv"

set :rbenv_type, :user
set :rbenv_ruby, "2.7.2"

Dotenv.load

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.2.2
FROM ruby:3.2.5

ENV BUNDLER_VERSION=2.2.8

Expand Down
9 changes: 5 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "3.2.2"
ruby "3.2.5"

gem "mutex_m", "0.1.2"
gem "cancancan", "~> 3.3"
Expand All @@ -25,7 +25,7 @@ gem "babosa"

gem "dentaku", "~> 3.1"

gem "rugged", "1.6.3"
# gem "rugged", "1.6.3"

gem "net-smtp"

Expand All @@ -38,7 +38,7 @@ gem "rails-i18n", "~> 7.0.0"
gem "image_processing", "~> 1.2"

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", ">= 1.4.4", require: false
gem "bootsnap", require: false
gem "tailwindcss-rails", "~> 2.0"

gem "active_storage_validations"
Expand Down Expand Up @@ -66,7 +66,7 @@ end
group :development do
gem "letter_opener"
gem "listen", "~> 3.3"
gem "pronto"
# gem "pronto"
# gem 'pronto-rubocop', require: false
gem "rack-mini-profiler", "~> 2.0"
gem "spring"
Expand All @@ -79,6 +79,7 @@ group :development do
gem "capistrano-yarn"
gem "capistrano-rails-tail-log"
gem "ed25519"
gem "bcrypt_pbkdf"
end

# group :ci do
Expand Down
38 changes: 7 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ GEM
babosa (2.0.0)
base64 (0.2.0)
bcrypt (3.1.20)
bcrypt_pbkdf (1.1.1)
bigdecimal (3.0.2)
bindex (0.8.1)
bootsnap (1.9.3)
msgpack (~> 1.0)
bootsnap (1.18.4)
msgpack (~> 1.2)
bootstrap (5.3.2)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 2.11.8, < 3)
Expand Down Expand Up @@ -222,19 +223,13 @@ GEM
fuubar (2.5.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
gitlab (4.17.0)
httparty (~> 0.18)
terminal-table (~> 1.5, >= 1.5.1)
globalid (1.2.1)
activesupport (>= 6.1)
hashie (5.0.0)
hotwire-rails (0.1.3)
rails (>= 6.0.0)
stimulus-rails
turbo-rails
httparty (0.20.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
image_processing (1.12.2)
Expand Down Expand Up @@ -290,14 +285,11 @@ GEM
meta-tags (2.20.0)
actionpack (>= 6.0.0, < 7.2)
method_source (1.0.0)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.1115)
mini_magick (4.11.0)
mini_mime (1.1.5)
mini_portile2 (2.8.5)
minitest (5.25.1)
msgpack (1.4.2)
msgpack (1.7.2)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
Expand All @@ -324,9 +316,6 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
octokit (4.21.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
omniauth (1.9.2)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
Expand All @@ -350,14 +339,6 @@ GEM
racc
pg (1.5.4)
popper_js (2.11.8)
pronto (0.11.2)
gitlab (>= 4.4.0, < 5.0)
httparty (>= 0.13.7, < 1.0)
octokit (>= 4.7.0, < 8.0)
rainbow (>= 2.2, < 4.0)
rexml (>= 3.2.5, < 4.0)
rugged (>= 0.23.0, < 2.0)
thor (>= 0.20.3, < 2.0)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -491,7 +472,6 @@ GEM
ffi (~> 1.12)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
rugged (1.6.3)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
Expand All @@ -504,9 +484,6 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
selenium-webdriver (4.10.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
Expand Down Expand Up @@ -619,8 +596,9 @@ DEPENDENCIES
annotate
any_login
babosa
bcrypt_pbkdf
bigdecimal (= 3.0.2)
bootsnap (>= 1.4.4)
bootsnap
bootstrap
breadcrumbs_on_rails
cancancan (~> 3.3)
Expand Down Expand Up @@ -663,7 +641,6 @@ DEPENDENCIES
omniauth-google-oauth2
paper_trail (~> 15.0)
pg (~> 1.1)
pronto
pry-rails
puma (~> 5.0)
rack-mini-profiler (~> 2.0)
Expand All @@ -679,7 +656,6 @@ DEPENDENCIES
rubocop-performance
rubocop-rails
rubocop-rspec
rugged (= 1.6.3)
sass-rails (>= 6)
selenium-webdriver
shoulda-matchers
Expand All @@ -696,7 +672,7 @@ DEPENDENCIES
webdrivers (~> 5.3.1)

RUBY VERSION
ruby 3.2.2p53
ruby 3.2.5p208

BUNDLED WITH
2.4.18
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The latest version from the release branch 'master' is automatically deployed to

# Required to install

- Ruby 3.2.2
- Ruby 3.2.5
- Ruby on Rails 7.1.2
- PostgreSQL 12
- Puma as a web server
Expand Down
4 changes: 4 additions & 0 deletions config/database.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ development:
<<: *default
database: zero_waste_development

staging:
<<: *default
database: zero_waste_staging

test:
<<: *default
database: zero_waste_test
Expand Down
2 changes: 1 addition & 1 deletion config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
set :branch, :master
# set :branch, :master

# Default value for :scm is :git
# set :scm, :git
Expand Down
5 changes: 5 additions & 0 deletions config/deploy/production.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "capistrano/yarn"

set :user, "deploy"

server "185.233.37.137", user: fetch(:user), roles: ["app", "db", "web"], primary: true, port: 22
Expand All @@ -12,3 +14,6 @@

set :stage, :production
set :rails_env, "production"

set :branch, :master
set :rbenv_ruby, "2.7.2"
17 changes: 17 additions & 0 deletions config/deploy/staging.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set :user, "bitnami"

server "3.120.151.175", user: fetch(:user), roles: ["app", "db", "web"], primary: true, port: 22

set :passenger_restart_with_touch, true
set :deploy_to, "/home/#{fetch(:user)}/#{fetch(:application)}"
set :ssh_options, {
keys: ["~/.ssh/id_rsa"],
forward_agent: false,
auth_methods: ["publickey"]
}

set :stage, :staging
set :rails_env, "staging"

set :branch, :develop
set :rbenv_ruby, "3.2.5"

0 comments on commit ab5ecfc

Please sign in to comment.