Skip to content

List Transactions #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
SHELL:=/bin/bash

wipe-all: down wipe-volumes wipe-images wipe-containers

wipe-volumes:
@$$(cd gt-app/tmp && ls -A | grep -v '\.keep' | xargs sudo rm -rf)
@if [[ -n "$$(docker volume ls -qf dangling=true)" ]]; then\
docker volume rm -f $$(docker volume ls -qf dangling=true);\
fi
@docker volume ls -qf dangling=true | xargs -r docker volume rm

wipe-images:
@if [[ -n "$$(docker images --filter "dangling=true" -q --no-trunc)" ]]; then\
docker rmi -f $$(docker images --filter "dangling=true" -q --no-trunc);\
fi
@if [[ -n "$$(docker images | grep "none" | awk '/ / { print $3 }')" ]]; then\
docker rmi -f $$(docker images | grep "none" | awk '/ / { print $3 }');\
fi

wipe-containers:
@if [[ -n "$$(docker ps -qa --no-trunc --filter "status=exited")" ]]; then\
docker rm -f $$(docker ps -qa --no-trunc --filter "status=exited");\
fi

wipe-postgres-redis-data:
@sudo rm -rf tmp

down:
@docker-compose down
@docker-compose kill

install-docker:
@echo "Installing Docker"

@sudo apt-get update

@sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common -y

@curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

@sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$$(lsb_release -cs) \
stable"

@sudo apt-get update

@sudo apt-get install docker-ce

@sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) \
-o /usr/local/bin/docker-compose

@sudo chmod +x /usr/local/bin/docker-compose
@sleep 5
@echo "Docker Installed successfully"

install-docker-if-not-already-installed:
@if [ -z "$$(which docker)" ]; then\
make install-docker;\
fi

build-all-docker-images:
@echo "Building docker images."
@echo "Grab a coffe and wait."
@docker-compose build
@echo "Docker images built"

pull:
@git pull origin $$(git branch | grep \* | cut -d ' ' -f2) --rebase

push:
@git push origin $$(git branch | grep \* | cut -d ' ' -f2) --force-with-lease

up:
@docker-compose up -d

set-up: install-docker-if-not-already-installed down build-all-docker-images

reset: wipe-all set-up

14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.7'

services:
web:
stdin_open: true
tty: true
build:
context: ./source
target: rails_app
volumes:
- ./source:/home/rails/myapp
ports:
- "3000:3000"

17 changes: 17 additions & 0 deletions source/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# 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'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal

# Ignore all logfiles and tempfiles.
/log/*
!/log/.keep
/tmp
26 changes: 26 additions & 0 deletions source/.rubocop-excludes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
AllCops:
Exclude:
# Rubocop defaults
- Gemfile
- vendor/**/*
- tmp/**/*
# Framework generated configuration files
- config/boot.rb
- config/application.rb
- config/environment.rb
- config/environments/*
- config/initializers/*
- bin/**/*
- script/**/*
- db/schema.rb
- Rakefile
# rspec generated files
- spec/spec_helper.rb
- spec/rails_helper.rb
# auto genrate scafold files
- spec/controllers/*
- spec/routing/*
- spec/requests/*
- spec/views/**/*
- app/controllers/*
- app/views/**/*
61 changes: 61 additions & 0 deletions source/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
AllCops:
TargetRubyVersion: 2.5.1

Bundler/OrderedGems:
Enabled: false

Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation

Metrics/AbcSize:
Max: 20

Metrics/BlockLength:
Exclude:
- config/routes.rb
- spec/**/*.rb
- config/routes/*.rb

Layout/LineLength:
Max: 120
Exclude:
- config/routes.rb
IgnoreCopDirectives: true

Metrics/MethodLength:
Max: 50
Exclude:
- db/migrate/*.rb


Style/ClassAndModuleChildren:
Enabled: false

Style/Documentation:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Layout/SpaceAroundMethodCallOperator:
Enabled: true

Lint/RaiseException:
Enabled: true

Lint/StructNewOverride:
Enabled: true

Style/ExponentialNotation:
Enabled: true

Style/HashEachMethods:
Enabled: true

Style/HashTransformKeys:
Enabled: true

Style/HashTransformValues:
Enabled: true

inherit_from: .rubocop-excludes.yml
29 changes: 29 additions & 0 deletions source/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM ruby:2.5.1 AS base

RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs

RUN useradd -ms /bin/bash rails

USER rails

RUN mkdir /home/rails/myapp

WORKDIR /home/rails/myapp

COPY Gemfile* ./

RUN bundle install

COPY . .

FROM base AS rails_app

COPY ./docker-entrypoint.sh /usr/local/bin/

ENTRYPOINT ["docker-entrypoint.sh"]

CMD [ "bundle", "exec", "rails s -p 3000 -b '0.0.0.0'"]

FROM base AS sidekiq_app

CMD ["bundle", "exec", "sidekiq"]
59 changes: 59 additions & 0 deletions source/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.11'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '1.3.13'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'rspec-rails', '~> 3.7'
gem 'pry-byebug'
gem 'shoulda-matchers'
gem 'database_cleaner'
gem 'factory_bot_rails'
gem 'faker'
gem 'rubocop'
gem 'capybara'
end
gem 'simplecov', require: false, group: :test

group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"
gem 'bootstrap-generators', '~> 3.3.4'
Loading