Skip to content

Commit

Permalink
Add iteration 04 doc
Browse files Browse the repository at this point in the history
Fix issues with rick text links
  • Loading branch information
IsurangaPerera committed Apr 26, 2023
1 parent e9663cc commit 3c6046a
Show file tree
Hide file tree
Showing 77 changed files with 2,381 additions and 156,980 deletions.
4 changes: 0 additions & 4 deletions .dev.env

This file was deleted.

43 changes: 15 additions & 28 deletions .github/workflows/development-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,21 @@ on:
pull_request:
branches: [ "main" ]
jobs:
test:
docker:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./app
env:
RAILS_ENV: test
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
ruby-version: '3.1.3'
bundler-cache: true
- name: Install packages
run: bundle install
- name: Set up database schema
run: bin/rails db:schema:load
- name: Set up database schema
run: bin/rails db:migrate
- name: Generate tests
run: bin/rails generate rspec:install
- name: Run tests
run: bin/rake
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the docker_compose
run: docker-compose -f docker-compose.prod.yml up -d --build
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:app"
push: true
tags: isurangaperera/ideals:latest
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ app/tmp
app/log
app/coverage
app/coveragejs
app/node_modules/
app/node_modules/
app/public

node_modules
3 changes: 3 additions & 0 deletions app/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
app/public
app/package-lock.json
16 changes: 12 additions & 4 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dockerfile development version
FROM ruby:3.1.3 AS ideals-development
FROM ruby:3.1.3 AS ideals-production

RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -\
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
Expand All @@ -10,21 +10,29 @@ RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -\
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn@1

RUN apt-get update \
&& apt-get install -y build-essential libcairo2-dev \
libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

# Default directory
ENV INSTALL_PATH /opt/app
ENV RAILS_ENV production
ENV NODE_OPTIONS --openssl-legacy-provider

RUN mkdir -p $INSTALL_PATH

# Install gems
WORKDIR $INSTALL_PATH
COPY . .
RUN rm -rf node_modules vendor
RUN rm -rf node_modules
RUN gem install rails bundler
RUN bundle update rack-protection
RUN bundle install

RUN yarn install --production=true
RUN yarn install
RUN bin/rails assets:precompile

EXPOSE 3000

# Start server
CMD bundle exec unicorn -c config/unicorn.rb
CMD bundle exec rails server -b 0.0.0.0
2 changes: 2 additions & 0 deletions app/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ group :test do
gem 'selenium-webdriver'
gem 'simplecov', require: false
gem 'webdrivers'
gem 'webmock'
end

gem 'rspec-rails', group: %i[development test]
Expand All @@ -86,3 +87,4 @@ gem 'omniauth-rails_csrf_protection', '~> 1.0' # prevents forged authentication
# webpack
gem 'pg'
gem 'webpacker'
gem 'nokogiri'
9 changes: 9 additions & 0 deletions app/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ GEM
xpath (~> 3.2)
coderay (1.1.3)
concurrent-ruby (1.2.2)
crack (0.4.5)
rexml
crass (1.0.6)
cucumber (8.0.0)
builder (~> 3.2, >= 3.2.4)
Expand Down Expand Up @@ -172,6 +174,7 @@ GEM
guard (~> 2.8)
guard-compat (~> 1.0)
multi_json (~> 1.8)
hashdiff (1.0.1)
hashie (5.0.0)
http_parser.rb (0.8.0)
i18n (1.12.0)
Expand Down Expand Up @@ -396,6 +399,10 @@ GEM
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
webmock (3.18.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webpacker (5.4.4)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
Expand Down Expand Up @@ -427,6 +434,7 @@ DEPENDENCIES
image_processing (~> 1.2)
importmap-rails
jbuilder
nokogiri
omniauth-auth0 (~> 3.0)
omniauth-rails_csrf_protection (~> 1.0)
pg
Expand All @@ -446,6 +454,7 @@ DEPENDENCIES
tzinfo-data
web-console
webdrivers
webmock
webpacker

RUBY VERSION
Expand Down
24 changes: 0 additions & 24 deletions app/README.md

This file was deleted.

1 change: 1 addition & 0 deletions app/app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
*/
/*@import "trix/dist/trix";
@import "./actiontext.scss";*/
@import "concept-styles.css";
71 changes: 71 additions & 0 deletions app/app/assets/stylesheets/concept-styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
.engraved {
font-size: 25px;
font-family: Futura;
background-color: #666666;
-webkit-background-clip: text;
-moz-background-clip: text;
background-clip: text;
color: transparent;
text-shadow: rgba(245, 245, 245, 0.5) 3px 5px 1px;
}

.sub-engraved {
font-size: 15px;
font-family: Futura;
background-color: #666666;
-webkit-background-clip: text;
-moz-background-clip: text;
background-clip: text;
color: transparent;
text-shadow: rgba(245, 245, 245, 0.5) 3px 5px 1px;
}

.main-engraved {
font-size: 40px;
font-family: Futura;
background-color: #666666;
-webkit-background-clip: text;
-moz-background-clip: text;
background-clip: text;
color: transparent;
text-shadow: rgba(245, 245, 245, 0.5) 3px 5px 1px;
}

.embossed {
color: #f0f0f0;
font-size: 15px;
font-family: Futura;
background-color: #666666;
text-shadow: 1px 4px 4px #555;
text-align: left;
-webkit-background-clip: text;
-moz-background-clip: text;

}

.link {
padding-left: 20px;
padding-right: 20px;
}

.flex-wrapper {
display: flex;
min-height: 100vh;
flex-direction: column;
justify-content: flex-start;
}

footer {
margin-top: auto;
}

span {
margin-bottom: 10px;
}

span {
font-size: 22px;
margin-bottom: 0;
font-weight: 500;
color: #012970;
}
4 changes: 2 additions & 2 deletions app/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ def index; end
# :nocov:

def require_login
#if ENV['CUCUMBER'] is true, then return
# if ENV['CUCUMBER'] is true, then return

return if ENV['CUCUMBER'] == 'true'

return if session[:userinfo].present?

flash[:alert] =
'Log in is required. You do not have rights to perform that action. If you believe you have the rights, please log in with your account.'
redirect_to root_path and return
redirect_to '/init' and return
end
# :nocov:
end
2 changes: 1 addition & 1 deletion app/app/controllers/assumptions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class AssumptionsController < ApplicationController
before_action :set_assumption, only: %i[show edit update destroy]
before_action :require_login, only: [:new, :create, :edit, :update, :destroy]
before_action :require_login, only: %i[new create edit update destroy]
# GET /assumptions or /assumptions.json
def index
@assumptions = Assumption.all
Expand Down
2 changes: 1 addition & 1 deletion app/app/controllers/main_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class MainController < ApplicationController
before_action :set_newobject, only: %i[show edit update destroy]
before_action :require_login
skip_before_action :require_login, only: [:index, :show]
skip_before_action :require_login, only: %i[index show]

# GET /newobjects or /newobjects.json
def index
Expand Down
2 changes: 1 addition & 1 deletion app/app/controllers/practices_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class PracticesController < ApplicationController
before_action :set_practice, only: %i[show edit update destroy]
before_action :require_login
skip_before_action :require_login, only: [:index, :show]
skip_before_action :require_login, only: %i[index show]
# GET /practices or /practices.json
def index
@practices = Practice.all
Expand Down
2 changes: 1 addition & 1 deletion app/app/controllers/theories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class TheoriesController < ApplicationController
before_action :set_theory, only: %i[show edit update destroy]
before_action :require_login
skip_before_action :require_login, only: [:index, :show]
skip_before_action :require_login, only: %i[index show]
# GET /theories or /theories.json
def index
@theories = Theory.all
Expand Down
2 changes: 0 additions & 2 deletions app/app/controllers/user_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# ./app/controllers/user_controller.rb
class UserController < ApplicationController
include Secured
# :nocov:

def show
# session[:userinfo] was saved earlier on Auth0Controller#callback
Expand All @@ -13,5 +12,4 @@ def show
@info = session[:info]
render 'user/show'
end
# :nocov:
end
Loading

0 comments on commit 3c6046a

Please sign in to comment.