Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Nov 2, 2023
1 parent 27a8192 commit 31f49a6
Show file tree
Hide file tree
Showing 298 changed files with 13,120 additions and 12,295 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: "Ruby on Rails CI"

on:
push:
pull_request_target:
types: [ opened, reopened ]
env:
API_URL: ${{ secrets.API_URL }}
API_KEY: ${{ secrets.API_KEY }}
BIOMIXER_URL: ${{ secrets.BIOMIXER_URL }}
FAIRNESS_URL: ${{ secrets.FAIRNESS_URL }}
ANNOTATOR_URL: ${{ secrets.ANNOTATOR_URL }}
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: 'bp_user'
steps:
- name: Checkout code
uses: actions/checkout@v3
# Add or replace dependency steps here
- name: Install Ruby and gems
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: 2.7.5
bundler-cache: true
# Add or replace database setup steps here
- name: set up config file
run: cp config/database.yml.sample config/database.yml
- name: Set up database schema
run: RAILS_ENV=test bin/rails db:setup
# Add or replace test runners here
- name: Run tests
run: RAILS_ENV=test bin/rails test -v

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: 2.7.5
bundler-cache: true
# Add or replace any other lints here
- name: Security audit dependencies
run: bundle exec bundler-audit --update
- name: Security audit application code
run: bundle exec brakeman -q -w2
- name: Lint Ruby files
run: bundle exec rubocop --parallel -A
8 changes: 5 additions & 3 deletions Capfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Load DSL and Setup Up Stages
require 'capistrano/setup'

Expand All @@ -18,10 +20,10 @@ require 'capistrano/deploy'
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
require 'capistrano/bundler'
require "capistrano/scm/git"
require 'capistrano/scm/git'
install_plugin Capistrano::SCM::Git
#require 'capistrano/rails/assets'
#require 'capistrano/rails/migrations'
# require 'capistrano/rails/assets'
# require 'capistrano/rails/migrations'
require 'capistrano/rails'
require 'capistrano/yarn'
require 'capistrano/locally'
Expand Down
34 changes: 13 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7.5-alpine AS app
FROM ruby:2.7.8-alpine AS app

WORKDIR /app

Expand All @@ -17,34 +17,26 @@ RUN apk add --no-cache \
less \
&& addgroup --gid ${GID} ruby \
&& adduser -u ${UID} -G ruby -D ruby \
&& chown ruby:ruby -R /app \
&& mkdir /node_modules \
&& chown ruby:ruby -R /node_modules /app
&& mkdir /node_modules

USER ruby

COPY --chown=ruby:ruby bin/ ./bin
RUN chmod 0755 bin/*
COPY --chown=ruby:ruby Gemfile* ./
COPY --chown=ruby:ruby package.json *yarn* ./

ARG RAILS_ENV="production"
# Set ownership and permissions
RUN chown -R ruby:ruby /app

ENV RAILS_ENV="${RAILS_ENV}" \
NODE_ENV="${NODE_ENV}" \
PATH="${PATH}:/home/ruby/.local/bin:/node_modules/.bin" \
USER="ruby" \
BUNDLE_PATH=/usr/local/bundle
USER ruby

COPY --chown=ruby:ruby Gemfile* ./
# Install dependencies
RUN bundle install --jobs "$(nproc)"
RUN gem install rails


RUN gem install rails
RUN yarn install

RUN echo "--modules-folder /node_modules" > .yarnrc
COPY --chown=ruby:ruby package.json *yarn* ./
RUN yarn install

# Copy application code
COPY --chown=ruby:ruby . .

EXPOSE 3000

CMD ["sh"]
CMD ["bash"]
49 changes: 26 additions & 23 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '7.0.3'

gem 'jsbundling-rails'

gem 'sassc-rails' #sass-rails replacent
gem 'terser' #ugilifer replacent
gem 'sassc-rails' # sass-rails replacent
gem 'terser' # ugilifer replacent

# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
Expand All @@ -18,11 +20,9 @@ gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'select2-rails'


# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'


# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '~> 5.0'

Expand All @@ -36,10 +36,10 @@ gem 'turbo-rails'
gem 'stimulus-rails'

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
#gem "jbuilder"
# gem "jbuilder"

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

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
Expand All @@ -50,41 +50,42 @@ gem 'bootsnap', require: false

gem 'cube-ruby', require: 'cube'
gem 'dalli'
gem 'flag-icons-rails', '~> 3.4'
gem 'flamegraph'
gem 'graphql-client'
gem 'haml', '~> 5.1'
gem 'i18n'
gem 'rails-i18n', '~> 7.0.0'
gem 'iconv'
gem 'inline_svg'
gem 'iso-639', '~> 0.3.6'
gem 'lookbook', '~> 1.5.5'
gem 'multi_json'
gem 'mysql2', '0.5.3'
gem 'mysql2'
gem 'oj'
gem 'ontologies_api_client', git: 'https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git',
branch: 'development'
gem 'open_uri_redirections'
gem 'pry'
gem 'psych', '< 4'
gem 'rack-mini-profiler'
gem 'rails_autolink'
gem 'rails-i18n', '~> 7.0.0'
gem 'rdoc'
gem 'recaptcha', '~> 5.9.0'
gem 'rest-client'
gem 'stackprof', require: false
gem 'thin'
gem 'view_component', '~> 2.72'
gem 'turnout'
gem 'view_component', '~> 2.72'
gem 'will_paginate', '~> 3.0'
gem 'inline_svg'
gem "lookbook", '~> 1.5.5'
gem 'ontologies_api_client', git: 'https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git', branch: 'development'
gem "flag-icons-rails", "~> 3.4"
gem "iso-639", "~> 0.3.6"

# Multi-Provider Authentication
gem 'omniauth'
gem "omniauth-rails_csrf_protection"
gem 'omniauth-github'
gem 'omniauth-google-oauth2'
gem 'omniauth-orcid'
gem 'omniauth-keycloak'
gem 'omniauth-orcid'
gem 'omniauth-rails_csrf_protection'

group :staging, :production, :appliance do
# application monitoring
Expand All @@ -111,16 +112,20 @@ group :development do
gem 'rubocop', require: false
# gem 'i18n-debug'
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem 'debug', platforms: %i[ mri mingw x64_mingw ]
gem 'debug', platforms: %i[mri mingw x64_mingw]

# Use console on exceptions pages [https://github.com/rails/web-console]
gem 'web-console'
gem 'i18n-tasks'
gem 'deepl-rb'
gem 'i18n-tasks'
gem 'web-console'
end

group :test, :development do
gem 'brakeman'
gem 'rspec-rails'
gem 'rubocop'
gem 'rubocop-rails'
gem 'ruby_audit'
end

group :test do
Expand All @@ -130,7 +135,5 @@ group :test do
gem 'webdrivers'
end


gem "net-ftp", "~> 0.2.0", require: false
gem "net-http"

gem 'net-ftp', '~> 0.2.0', require: false
gem 'net-http'
Loading

0 comments on commit 31f49a6

Please sign in to comment.