Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #805 from omu/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
msdundar authored Feb 16, 2019
2 parents 4a8fda8 + 5d3c289 commit fb280f7
Show file tree
Hide file tree
Showing 381 changed files with 6,219 additions and 3,775 deletions.
54 changes: 27 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ repository: &repository
key: nokul-repo-{{ .Environment.CIRCLE_SHA1 }}

# build image
ruby_2_6_0: &ruby_2_6_0
ruby_2_6: &ruby_2_6
docker:
- image: circleci/ruby:2.6.0-node-browsers
- image: circleci/ruby:2.6.1-node-browsers
<<: *rails_environment
- image: circleci/postgres:11.1-alpine
<<: *postgres_environment
Expand All @@ -41,15 +41,15 @@ ruby_2_6_0: &ruby_2_6_0
version: 2
jobs:
prepare_project:
<<: *ruby_2_6_0
<<: *ruby_2_6
steps:
- checkout
- save_cache:
<<: *repository
paths:
- ~/project
bundle_dependencies:
<<: *ruby_2_6_0
<<: *ruby_2_6
steps:
- restore_cache:
<<: *repository
Expand All @@ -68,7 +68,7 @@ jobs:
paths:
- vendor/bundle
bundle_assets:
<<: *ruby_2_6_0
<<: *ruby_2_6
steps:
- restore_cache:
<<: *repository
Expand All @@ -88,7 +88,7 @@ jobs:
paths:
- node_modules/
quality:
<<: *ruby_2_6_0
<<: *ruby_2_6
steps:
- restore_cache:
<<: *repository
Expand All @@ -103,7 +103,7 @@ jobs:
- run: bundle exec rake quality:all
- run: bin/yarn run lint
security:
<<: *ruby_2_6_0
<<: *ruby_2_6
steps:
- restore_cache:
<<: *repository
Expand All @@ -117,7 +117,7 @@ jobs:
- run: bundle --path vendor/bundle --without development
- run: bundle exec rake security:all
database:
<<: *ruby_2_6_0
<<: *ruby_2_6
steps:
- restore_cache:
<<: *repository
Expand All @@ -131,7 +131,7 @@ jobs:
- run: bundle --path vendor/bundle --without development
- run: bundle exec rake database:all
test_suite:
<<: *ruby_2_6_0
<<: *ruby_2_6
steps:
- restore_cache:
<<: *repository
Expand Down Expand Up @@ -192,21 +192,21 @@ workflows:
- test_suite:
requires:
- bundle_assets
- deploy_develop:
requires:
- quality
- security
- database
- test_suite
filters:
branches:
only: develop
- deploy_master:
requires:
- quality
- security
- database
- test_suite
filters:
branches:
only: master
# - deploy_develop:
# requires:
# - quality
# - security
# - database
# - test_suite
# filters:
# branches:
# only: develop
# - deploy_master:
# requires:
# - quality
# - security
# - database
# - test_suite
# filters:
# branches:
# only: master
40 changes: 40 additions & 0 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
linters:
Rubocop:
enabled: true
rubocop_config:
inherit_from:
- .rubocop.yml
Style/FrozenStringLiteralComment:
Enabled: false
Layout/InitialIndentation:
Enabled: false
Layout/TrailingBlankLines:
Enabled: false
Naming/FileName:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Metrics/LineLength:
Enabled: false
Lint/UselessAssignment:
Enabled: false
Rails/OutputSafety:
Enabled: false
SpaceAroundErbTag:
enabled: true
FinalNewline:
enabled: true
ErbSafety:
enabled: true
RightTrim:
enabled: false
SelfClosingTag:
enabled: true
AllowedScriptType:
enabled: true
allowed_types:
- 'application/json'
- 'text/javascript'
- 'text/html'
allow_blank: false
disallow_inline_scripts: false
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "standard"
"extends": "standard"
}
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ labels: bug

* [ ] İş kaydınızın başlığı kurallara (sadece ilk harf büyük, emir kipinde problem cümlesi vb.) uygun mu?
* [ ] [Katkı sağlama dokümanını](https://github.com/omu/nokul/CONTRIBUTING.md) okudunuz mu?
* [ ] Öneriniz ile alakalı açık olarak bekleyen bir [issue](https://github.com/omu/nokul/issues) veya [pull request](https://github.com/omu/nokul/pulls) emin misiniz?
* [ ] Öneriniz ile alakalı açık olarak bekleyen bir [issue](https://github.com/omu/nokul/issues) veya [pull request](https://github.com/omu/nokul/pulls) olmadığına emin misiniz?

**Ek içerik:**

Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ yarn-debug.log*
.env
.envrc
/.local/

# Ignore dokku deploy key
config/deploy_key

# Ignore auto-generated PDFs of markdown files
.pdf
2 changes: 2 additions & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rubocop:
config_file: .rubocop.yml
25 changes: 25 additions & 0 deletions .htmlhintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"spec-char-escape": false,
"attr-value-double-quotes": false,
"doctype-first": false,
"id-class-value": false,
"title-require": false,
"head-script-disabled": false,
"tagname-lowercase": true,
"attr-lowercase": true,
"attr-value-not-empty": false,
"attr-no-duplication": true,
"tag-pair": true,
"tag-self-close": false,
"id-unique": true,
"src-not-empty": true,
"alt-require": true,
"doctype-html5": true,
"style-disabled": false,
"inline-style-disabled": false,
"inline-script-disabled": false,
"space-tab-mixed-disabled": "space",
"id-class-ad-disabled": false,
"href-abs-or-rel": false,
"attr-unsafe-chars": true
}
12 changes: 11 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,20 @@ Metrics/BlockLength:
Exclude:
- config/routes/**/*
- lib/tasks/**/*.rake # Won't fix
- test/models/concerns/reference_validations_test.rb
- test/models/concerns/validation_test_module.rb # Won't fix
Metrics/MethodLength:
Exclude:
- test/models/concerns/validation_test_module.rb # Won't fix
Metrics/AbcSize:
Exclude:
- test/models/concerns/validation_test_module.rb # Won't fix
Metrics/ClassLength:
Exclude:
- test/**/*.rb
Naming/PredicateName:
Exclude:
- test/models/concerns/association_test_module.rb # Won't fix
- test/models/concerns/enumeration_test_module.rb # Won't fix

# Do not exclude files from ALL COPS unless it's really necessary!
AllCops:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.0
2.6.1
60 changes: 60 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
language: minimal

cache:
directories:
- "$HOME/bundle"
- "$HOME/.bundle_config"
- "$HOME/node_modules"

install:
- docker-compose build test
- docker-compose run test bin/plugdo bundle install -j4 --path /app/vendor/bundle --without development
- docker-compose run test yarn install
- docker-compose run test bin/rails db:create db:structure:load

before_script:
- openssl aes-256-cbc -K $encrypted_3f8c4ca1dcec_key -iv $encrypted_3f8c4ca1dcec_iv -in config/deploy_key.enc -out config/deploy_key -d
- chmod 600 config/deploy_key
- eval "$(ssh-agent -s)" && ssh-add config/deploy_key
- echo -e "Host app.omu.sh\n\tStrictHostKeyChecking no\n" >>~/.ssh/config

jobs:
include:
- stage: test
# first job at this stage
name: "Quality Tests"
before_script: skip
script: docker-compose run test bundle exec rake quality:all

# second job at this stage
- name: "Security and Database Tests"
before_script: skip
script: docker-compose run test bundle exec rake security:all database:all

# third job at this stage
- name: "Integration Tests"
before_script: skip
script: docker-compose run test bundle exec rails test:system test

- stage: deploy
# first job at this stage
name: "Deploy to dokku#beta"
if: branch = develop AND type = push AND fork = false
cache: skip
install: skip
script: git remote add beta [email protected]:nokul-develop && git push beta develop:master

# second job at this stage
- name: "Deploy to dokku#production"
if: branch = master AND type = push AND fork = false
cache: skip
install: skip
script: git remote add production [email protected]:nokul && git push production master

notifications:
email: false
slack:
on_success: change
on_failure: change
rooms:
- secure: ljbXmcdLA/wv+j3+RCE0qF/mZd/3PbHI0VOSBkeyJDXWcHHMduIyZlodzliuXL/8mfLbmcJ8MZT5tV9l0OGSgiFI/Ngz1fadsf+0Pim4MtREkp4yKRzfDbQqj8iQwzAAcIAxbIQhenVZtaadwBAM8Jawcjs0m2+iWXaiREU1IlRaK1NzGtkDx8gy5PnVgJhtWmhV7/l6a0Sg94shr53bchkuGwH/ugqgq9L+ec1gGKVpSOHhS0W5WjojMU+3K5/HCP/r9V2J2jYUjtzDSbEDFd18rH0qJjNq1hoaVeaW1uJzidSH7f7B6xXxJfUt4e2CiY+2CkR5LUbFx5V+6fNscEAA9u+zGh6Rn9rxciWkFfzKck6Eomoq5G+d+q/ItVagAMSIUELYCOup2+H/KtRNFTBWBqwECsvXZn7WwaZOdMXDfiTnI9eSWxJqaiwFMtC1A+bnKM7DX2qoZoGCNJAzzQ93EuXdxA1w1oYVs7lfh70qLx5OraXtcTUtfrv4tzms35S9JNNnEQyWN7neuPCS0Yh4QIFf4NX7aaYbwFD66uS25Iq2ochJ4oicFd8s+DxnaXc925GYXFVHk7wZWK/mFlGnZTuTbk4ElByqzRUN2sI5r7xYijv9cBcUM/1RqzXI3B/91Ft/kyCaYDrg3W1j79zLo+G5uIHU2/F1AQBIYlI=
25 changes: 8 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ondokuz/ruby-stretch:1.11.1
FROM ondokuz/ruby-stretch:1.15.1

ENV PATH=/app/bin:$PATH

Expand All @@ -14,29 +14,20 @@ ENV RAILS_MASTER_KEY=$RAILS_MASTER_KEY
ENV RAILS_SERVE_STATIC_FILES=enabled
ENV RAILS_LOG_TO_STDOUT=enabled

WORKDIR /app

COPY .ruby-version ./
COPY Gemfile Gemfile.lock ./
COPY package.json yarn.lock ./

COPY plugins/support/lib/nokul/support/version.rb ./plugins/support/lib/nokul/support/version.rb
COPY plugins/support/nokul-support.gemspec ./plugins/support/nokul-support.gemspec
ENV NODE_ENV=production
ENV NODE_ENV=$NODE_ENV

COPY plugins/tenant/common/lib/nokul/tenant/version.rb ./plugins/tenant/common/lib/nokul/tenant/version.rb
COPY plugins/tenant/common/nokul-tenant.gemspec ./plugins/tenant/common/nokul-tenant.gemspec
RUN case $RAILS_ENV in \
test) apt-get -y update && apt-get -y install --no-install-recommends chromedriver && \
apt-get clean && rm -rf /var/lib/apt/lists/* ;; \
esac

COPY plugins/tenant/$NOKUL_TENANT/lib/nokul/tenant/$NOKUL_TENANT/version.rb ./plugins/tenant/$NOKUL_TENANT/lib/nokul/tenant/$NOKUL_TENANT/version.rb
COPY plugins/tenant/$NOKUL_TENANT/nokul-tenant-$NOKUL_TENANT.gemspec ./plugins/tenant/$NOKUL_TENANT/nokul-tenant-$NOKUL_TENANT.gemspec
WORKDIR /app

RUN bundle config --global silence_root_warning true
RUN bundle install --without development:test -j4 --deployment
RUN yarn install

COPY . ./

RUN bundle exec rake assets:precompile

EXPOSE 3000

CMD bundle exec puma -C config/puma.rb
10 changes: 5 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ruby File.read('.ruby-version')
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# core
gem 'bootsnap', '>= 1.1.0', require: false
gem 'bootsnap', '>= 1.4.0', require: false
gem 'puma', '~> 3.11'
gem 'rails', github: 'rails/rails'
gem 'redis', '~> 4.0'
Expand Down Expand Up @@ -53,6 +53,7 @@ gem 'rack-attack'

# validators
gem 'email_address'
gem 'telephone_number'

# error tracking
gem 'rollbar', github: 'rollbar/rollbar-gem'
Expand All @@ -62,9 +63,11 @@ gem 'friendly_id', '~> 5.2.0'

group :development, :test do
gem 'brakeman', require: false
gem 'bullet', github: 'flyerhzm/bullet'
gem 'bundler-audit'
gem 'byebug', platforms: %i[mri mingw x64_mingw]
gem 'dotenv-rails'
gem 'erb_lint', require: false
gem 'lol_dba'
gem 'rubocop'
gem 'simplecov', require: false
Expand All @@ -79,14 +82,11 @@ group :test do
end

group :development do
# TODO: Will re-enable after upgrading bullet.
# gem 'bullet'
gem 'fit-commit'
gem 'letter_opener'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'pry-rails'
# TODO: Will re-enable after upgrading rack-mini-profiler
# gem 'rack-mini-profiler'
gem 'rack-mini-profiler'
gem 'ruby-progressbar'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
Expand Down
Loading

0 comments on commit fb280f7

Please sign in to comment.