Skip to content

Commit

Permalink
Merge branch 'release/rel-20241213000632'
Browse files Browse the repository at this point in the history
  • Loading branch information
taketo1113 committed Dec 12, 2024
2 parents fd00676 + 6773834 commit cc90309
Show file tree
Hide file tree
Showing 81 changed files with 1,070 additions and 879 deletions.
20 changes: 20 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Usage .env
# SAMPLE_VAR=XXXXXX
#

# DB
STATUS_MONITORING_DATABASE_USERNAME_DEV=root
STATUS_MONITORING_DATABASE_PASSWORD_DEV=
STATUS_MONITORING_DATABASE_USERNAME=sindan
STATUS_MONITORING_DATABASE_PASSWORD=
#STATUS_MONITORING_DATABASE_HOSTNAME=

#MYSQL_SOCKET=/var/lib/mysql/mysql.sock
#REDIS_URL=

## for production env
# Secret
#SECRET_KEY_BASE=

# environments
RAILS_LOG_LEVEL=debug
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI

on:
pull_request:
push:
branches: [ master, develop ]

jobs:
scan_ruby:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Scan for common Rails security vulnerabilities using static analysis
run: bin/brakeman --no-pager

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Lint code for consistent style
run: bin/rubocop -f github

test:
runs-on: ubuntu-latest

services:
mysql:
image: mysql
env:
MYSQL_ROOT_PASSWORD:
MYSQL_ROOT_HOST: '%'
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping -h 127.0.0.1" --health-interval 20s --health-timeout 10s --health-retries 10
redis:
image: redis
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Install dependencies for npm
run: yarn install

- name: Run tests
env:
RAILS_ENV: test
REDIS_URL: redis://localhost:6379/0
SINDAN_DATABASE_USERNAME_DEV: root
SINDAN_DATABASE_PASSWORD_DEV:
SINDAN_DATABASE_HOSTNAME: 127.0.0.1
MYSQL_SOCKET:
run: bin/rails db:test:prepare spec

10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Temporary files generated by your text editor or operating system
# belong in git's global ignore instead:
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`

# Ignore bundler config.
/.bundle
vendor/bundle

# config
config/database.yml

# Ignore all environment files (except templates).
/.env*
!/.env*.erb
!/.env.example

# Ignore all logfiles and tempfiles.
/log/*
Expand Down
8 changes: 8 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Omakase Ruby styling for Rails
inherit_gem: { rubocop-rails-omakase: rubocop.yml }

# Overwrite or add rules to create your own house style
#
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
# Layout/SpaceInsideArrayLiteralBrackets:
# Enabled: false
12 changes: 10 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
source "https://rubygems.org"

gem "rails", "7.1.5"
gem "rails", "7.2.2.1"

gem "mysql2"

gem "puma", ">= 5.0"

gem "devise"

gem "dotenv-rails"

gem "sprockets-rails"
gem "jsbundling-rails"

Expand Down Expand Up @@ -39,7 +41,13 @@ gem "bootsnap", require: false

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri windows ]
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"

# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
gem "brakeman", require: false

# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
gem "rubocop-rails-omakase", require: false
end

# Use Capistrano for deployment
Expand Down
Loading

0 comments on commit cc90309

Please sign in to comment.