Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
kinnalru committed Jul 29, 2022
1 parent 79f6e3f commit 73f11ad
Show file tree
Hide file tree
Showing 9 changed files with 428 additions and 0 deletions.
124 changes: 124 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#----------------------------------------------------------------------------
# Ignore these files when commiting to a git repository.
#
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# The original version of this file is found here:
# https://github.com/RailsApps/rails-composer/blob/master/files/gitignore.txt
#
# Corrections? Improvements? Create a GitHub issue:
# http://github.com/RailsApps/rails-composer/issues
#----------------------------------------------------------------------------

# bundler state
/.bundle
/vendor/bundle/
/vendor/ruby/
vendor/cache

# minimal Rails specific artifacts
db/*.sqlite3
db/schema.rb
/db/*.sqlite3-journal
/log/*
/tmp/*
/swagger/*


# add /config/database.yml if it contains passwords
# /config/database.yml

# various artifacts
**.war
*.rbc
*.sassc
.redcar/
.sass-cache
/config/config.yml
/coverage.data
/coverage/
/db/*.javadb/
/db/*.sqlite3
config/database.yml
config/secrets.yml
config/app.yml
config/cable.yml
config/bunny.yml
oxymoron.js
/doc/api/
/doc/app/
/doc/features.html
/doc/specs.html
/public/cache
/public/uploads
/public/stylesheets/compiled
/public/system/*
/spec/tmp/*
/cache
/capybara*
/capybara-*.html
/gems
/specifications
rerun.txt
pickle-email-*.html
*.sublime-project
*.sublime-workspace
.zeus.sock
.byebug_history

#test
/docs


# 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
#
# Here are some files you may want to ignore globally:

# scm revert files
**.orig

# Mac finder artifacts
.DS_Store

# Netbeans project directory
/nbproject/

# RubyMine project files
.idea

# VsCode project files
.vscode
*.code-workspace

# Textmate project files
/*.tmproj

# vim artifacts
**.swp

# Environment files that may contain sensitive data
.powenv

# tilde files are usually backup files from a text editor
*~
public/assets/
config/keys
public/.revision
storage/*
spec/reports/

erd-schema.*
.ruby-gemset
.ruby-version
passenger.*.pid.lock
*.sublime-project
*.sublime-workspace

/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
46 changes: 46 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
before_script:
- mkdir -p ~/.docker
- echo ${RNDS_DOCKER_AUTH} > ~/.docker/config.json

stages:
- build
- tagging
- deploy

variables:
BUILDVERSION: ${CI_PIPELINE_ID}
SERVICE_IMAGE: docker.rnds.pro/yard-docs
SERVICE_TAG: ${CI_COMMIT_SHORT_SHA}

# MIXINS

include:
- project: 'aggredator/support/composer'
file: '/templates/tagging.yml'


build:
image: rnds/ruby:2.5-test
stage: build
script:
- SERVICE_TAG=lastest docker-compose pull -q || true
- docker-compose build --force-rm --pull
- docker-compose push

# TAGGING STAGE

tagging:tags:
extends: .tagging_tags
variables:
IMAGE: ${SERVICE_IMAGE}

tagging:branches:
extends: .tagging_branches
variables:
IMAGE: ${SERVICE_IMAGE}

tagging:master:
extends: .tagging_master
variables:
IMAGE: ${SERVICE_IMAGE}

133 changes: 133 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
AllCops:
TargetRubyVersion: 2.5
Exclude:
- "storage/**/*"

Layout/TrailingBlankLines:
Enabled: true
AutoCorrect: true
EnforcedStyle: final_blank_line

#Layout/IndentationWidth:
# Enabled: true

#Layout/IndentAssignment:
# Enabled: false
# IndentationWidth: false

#Layout/ElseAlignment:
# Enabled: false

Layout/MultilineOperationIndentation:
EnforcedStyle: indented

Layout/MultilineAssignmentLayout:
EnforcedStyle: new_line

Layout/RescueEnsureAlignment:
Enabled: true

Layout/EndAlignment:
Enabled: true
EnforcedStyleAlignWith: variable
AutoCorrect: true

Layout/AlignHash:
EnforcedColonStyle: table
EnforcedHashRocketStyle: table

Layout/IndentationConsistency:
EnforcedStyle: indented_internal_methods

Layout/EmptyLines:
Enabled: false

Layout/EmptyLinesAroundClassBody:
EnforcedStyle: empty_lines_except_namespace

Layout/EmptyLinesAroundModuleBody:
EnforcedStyle: empty_lines_except_namespace

Layout/SpaceInsideBlockBraces:
EnforcedStyle: space
SpaceBeforeBlockParameters: false

Layout/SpaceAroundBlockParameters:
EnforcedStyleInsidePipes: no_space

Layout/SpaceBeforeBlockBraces:
Enabled: false

#Lint/AssignmentInCondition:
# Enabled: false

Metrics/BlockLength:
Exclude:
- "spec/**/*.rb"

Metrics/LineLength:
Max: 100
IgnoredPatterns: ['(\A|\s)#']

Metrics/AbcSize:
Max: 20

Metrics/MethodLength:
Max: 20

Security/YAMLLoad:
Enabled: false

Style/AsciiComments:
Enabled: false

Style/RedundantBegin:
Enabled: false

Style/GlobalVars:
AllowedVariables: ["$logger", "$root"]

Style/ClassAndModuleChildren:
EnforcedStyle: compact
Enabled: false

Style/Documentation:
Enabled: false

Style/Lambda:
Enabled: false

Style/RedundantSelf:
Enabled: false

Style/RaiseArgs:
EnforcedStyle: compact

Style/SpecialGlobalVars:
Enabled: false

Style/BracesAroundHashParameters:
EnforcedStyle: context_dependent

Style/NumericPredicate:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/DoubleNegation:
Enabled: false

Style/SymbolArray:
Enabled: false

Style/RescueModifier:
Enabled: false

Style/TrailingCommaInArrayLiteral:
Enabled: true
AutoCorrect: true

Style/TrailingCommaInArguments:
Enabled: true
AutoCorrect: true
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ARG RUBY_VERSION=3.1

FROM ruby:${RUBY_VERSION}-alpine

WORKDIR /home/app

RUN mkdir -p /usr/local/etc \
&& { \
echo 'install: --no-document'; \
echo 'update: --no-document'; \
} >> /usr/local/etc/gemrc \
&& echo 'gem: --no-document' > ~/.gemrc

# RUN set -ex \
# && apk add --no-cache build-base git curl

ADD Gemfile Gemfile.lock /home/app/

RUN set -ex \
&& gem install bundler && gem update bundler \
&& bundle config set --local system 'true' \
&& bundle install --jobs=3 \
&& rm -rf /tmp/* /var/tmp/* /usr/src/ruby /root/.gem /usr/local/bundle/cache

ADD . /home/app/

RUN set -ex \
&& bundle install --jobs=3 \
&& rm -rf /tmp/* /var/tmp/* /usr/src/ruby /root/.gem /usr/local/bundle/cache

CMD ["bundle", "exec", "ruby", "/home/app/main.rb"]


8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://rubygems.org'


gem 'activesupport', '~> 6.0'
gem 'docker-api'



31 changes: 31 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.6.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
concurrent-ruby (1.1.10)
docker-api (2.2.0)
excon (>= 0.47.0)
multi_json
excon (0.92.4)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
minitest (5.16.2)
multi_json (1.15.0)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
zeitwerk (2.6.0)

PLATFORMS
x86_64-linux

DEPENDENCIES
activesupport (~> 6.0)
docker-api

BUNDLED WITH
2.3.15
Loading

0 comments on commit 73f11ad

Please sign in to comment.