Skip to content

Commit

Permalink
Refactor/pg migration (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach authored Mar 15, 2023
1 parent 602b105 commit 7cd9fa8
Show file tree
Hide file tree
Showing 78 changed files with 1,565 additions and 722 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run StandardRB
uses: andrewmcodes/standardrb-action@v0.0.2
env:
Expand All @@ -13,8 +13,15 @@ jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run Brakeman Static Analysis
uses: devmasx/brakeman-linter-action@v1.0.0
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run spec
run: bash ./spec
21 changes: 19 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,28 @@
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
/rethinkdb_data
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

/public/assets

# Ignore master key for decrypting credentials and more.
/config/master.key

# Ignore Byebug command history file.
.byebug_history
*.DS_Store
config/master.key
config/master.key

1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-3.1.3
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG RUBY_VER="3.1"
FROM ruby:$RUBY_VER-alpine AS build-env

ARG PACKAGES="git libxml2 libxslt build-base curl-dev libxml2-dev libxslt-dev zlib-dev tzdata"
ARG PACKAGES="git libxml2 libxslt build-base curl-dev libxml2-dev libxslt-dev zlib-dev tzdata libpq-dev"

RUN apk update && \
apk upgrade && \
Expand Down Expand Up @@ -43,7 +43,7 @@ WORKDIR $APP_DIR
ENV BUNDLE_APP_CONFIG="$APP_DIR/.bundle"

# install packages
ARG PACKAGES="tzdata libxml2 libxslt libc6-compat"
ARG PACKAGES="tzdata libxml2 libxslt libc6-compat libpq-dev"
RUN apk update \
&& apk upgrade \
&& apk add --update --no-cache $PACKAGES
Expand All @@ -57,6 +57,9 @@ ENV USER=appuser
# See https://stackoverflow.com/a/55757473/12429735RUN
RUN adduser -D -g "" -h "/nonexistent" -s "/sbin/nologin" -H -u "${UID}" "${USER}"
RUN chown appuser:appuser -R /app/tmp

# NOTE:: this should not be used, instead use `RAILS_MASTER_KEY` env var
RUN chown appuser:appuser -R /app/config/
RUN bundle binstubs bundler --force

# Use an unprivileged user.
Expand Down
42 changes: 23 additions & 19 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rails", "~> 6.0", ">= 6.0.5.1"
gem "rails", "~> 7.0.4"

# We don't use the mail gem
gem "net-smtp", require: false
gem "net-imap", require: false
gem "net-pop", require: false

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false

# High performance web server
gem "puma"

# Database
gem "nobrainer", git: "https://github.com/place-labs/nobrainer.git", branch: "fix/ensure-fix-table-duplicate"
gem "pg"
gem "redis"

# Authentication
gem "doorkeeper", "~> 5.4"
gem "doorkeeper", "~> 5.6"
gem "doorkeeper-jwt"
gem "doorkeeper-rethinkdb", git: "https://github.com/place-labs/doorkeeper-rethinkdb.git"
gem "jwt"
gem "omniauth", "~> 1.9"
gem "omniauth-ldap2"
gem "omniauth-oauth2"
gem "omniauth-saml"

# Uploads
gem "condo", git: "https://github.com/cotag/Condominios.git", branch: "rethink-update"
gem "condo-rethinkdb", git: "https://github.com/place-labs/condo-rethinkdb.git"
# Uploads (rethink update looks like a rails compatibility update)
gem "condo", git: "https://github.com/cotag/Condominios.git", branch: "rails7"
gem "condo_active_record", git: "https://github.com/cotag/condo_active_record.git"

# Model support
gem "addressable"
Expand All @@ -38,7 +39,7 @@ gem "email_validator"
gem "lograge"
gem "logstash-event"
gem "mono_logger"
gem "sentry-raven"
gem "sentry-ruby"
gem "opentelemetry-sdk"
gem "opentelemetry-exporter-otlp"
gem "opentelemetry-instrumentation-all"
Expand All @@ -50,19 +51,22 @@ gem "rbtrace"
gem "yajl-ruby"

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem "byebug", platform: :mri
gem "pry-rails", platform: :mri
gem "web-console", platform: :mri
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
end

group :development do
gem "listen", "~> 3.0"
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"
gem "pry-rails"
end

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
# gem 'spring'
# gem 'spring-watcher-listen', '~> 2.0.0'
group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara"
gem "selenium-webdriver"
gem "webdrivers"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data" # , platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
Loading

0 comments on commit 7cd9fa8

Please sign in to comment.