Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tahb committed Oct 23, 2020
0 parents commit 175a57f
Show file tree
Hide file tree
Showing 112 changed files with 2,523 additions and 0 deletions.
1 change: 1 addition & 0 deletions .adr-dir
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doc/architecture/decisions
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Dotenv
#
# This file commits safe environment variables for the development environment.
# For managing sensitive values and overrides use `/.env.development.local`
#
# Reference: https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use

# Rollbar for application monitoring
ROLLBAR_ACCESS_TOKEN=ROLLBAR_ACCESS_TOKEN
ROLLBAR_ENV=development

# TODO: Replace `rails-template` with the name of the app.
DATABASE_URL=postgres://postgres@localhost:5432/rails-template-development
9 changes: 9 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Dotenv
#
# This file commits safe environment variables for the test environment.
# For managing sensitive values and overrides use `/.env.test.local`
#
# Reference: https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use

# TODO: Replace `rails-template` with the name of the app.
DATABASE_URL=postgres://postgres@localhost:5432/rails-template-test
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
time: "11:00"
timezone: Europe/London
open-pull-requests-limit: 5
versioning-strategy: auto
target-branch: develop
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "11:00"
timezone: Europe/London
open-pull-requests-limit: 5
versioning-strategy: auto
target-branch: develop
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do you need to update the changelog? -->

## Changes in this PR

## Screenshots of UI changes

### Before

### After

## Next steps
28 changes: 28 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# TODO: Enable GitHub Actions on the repository to test all pull requests
# https://github.com/<org>/<repo>/actions
name: CI

on: pull_request

jobs:
test:
runs-on: ubuntu-latest
env:
RAILS_ENV: test
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Docker
run: docker network create test
- name: Set up Postgres
run: docker run -d --name pg --network test -e POSTGRES_USER=test -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 postgres:11
- name: Build a new Docker image
run: docker build . --build-arg RAILS_ENV=test -t app:test
- name: Run the tests
run: |
docker run --name test-container \
--network test \
-e RAILS_ENV=test \
-e DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true \
-e DATABASE_URL=postgres://test@pg:5432/app_test \
app:test bundle exec rake
93 changes: 93 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#----------------------------------------------------------------------------
# Ignore these files when committing 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/

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



# 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
/doc/api/
/doc/app/
/doc/features.html
/doc/specs.html
/public/cache
/public/stylesheets/compiled
/public/system/*
/spec/tmp/*
/cache
/capybara*
/capybara-*.html
/gems
/specifications
rerun.txt
pickle-email-*.html
.zeus.sock

# 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

# Textmate project files
/*.tmproj

# vim artifacts
**.swp

# Environment files that may contain sensitive data
.env
.powenv

# tilde files are usually backup files from a text editor
*~

# Remove the master key added in Rails 5.2 incase it is used
config/master.key

.env.*
!.env.example
!.env.test
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--require spec_helper
--require rails_helper
1 change: 1 addition & 0 deletions .ruby-gemset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rails-template
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6.3
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog 1.0.0].

## [Unreleased]

[unreleased]: TODO
[keep a changelog 1.0.0]: https://keepachangelog.com/en/1.0.0/
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM ruby:2.6.3 as release
MAINTAINER dxw <[email protected]>
RUN apt-get update && apt-get install -qq -y \
build-essential \
libpq-dev \
--fix-missing --no-install-recommends
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs

ENV INSTALL_PATH /srv/app
RUN mkdir -p $INSTALL_PATH

WORKDIR $INSTALL_PATH

# set rails environment
ARG RAILS_ENV
ENV RAILS_ENV=${RAILS_ENV:-production}
ENV RACK_ENV=${RAILS_ENV:-production}

COPY Gemfile $INSTALL_PATH/Gemfile
COPY Gemfile.lock $INSTALL_PATH/Gemfile.lock

RUN gem update --system
RUN gem install bundler

# bundle ruby gems based on the current environment, default to production
RUN echo $RAILS_ENV
RUN \
if [ "$RAILS_ENV" = "production" ]; then \
bundle install --without development test --retry 10; \
else \
bundle install --retry 10; \
fi

COPY . $INSTALL_PATH

RUN RAILS_ENV=$RAILS_ENV SECRET_KEY_BASE="super secret" bundle exec rake assets:precompile --quiet

# db setup
COPY ./docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 3000

CMD ["rails", "server"]
57 changes: 57 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# frozen_string_literal: true

source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "2.6.3"

gem "bootsnap", ">= 1.1.0", require: false
gem "bootstrap", ">= 4.3.1"
gem "coffee-rails", "~> 5.0"
gem "high_voltage"
gem "jbuilder", "~> 2.5"
gem "jquery-rails"
gem "pg"
gem "mini_racer"
gem "puma", "~> 5.0"
gem "rollbar"
gem "rails", "~> 6.0.0"
gem "sass-rails", "~> 6.0"
gem "turbolinks", "~> 5"
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]
gem "uglifier", ">= 1.3.0"

group :development do
gem "listen", ">= 3.0.5", "< 3.3"
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "web-console", ">= 3.3.0"
end

group :test do
gem "capybara", ">= 2.15"
gem "selenium-webdriver"
gem "simplecov"
end

group :development do
gem "better_errors"
gem "rails_layout"
gem "spring-commands-rspec"
end

group :development, :test do
gem "brakeman"
gem "bullet"
gem "byebug", platforms: %i[mri mingw x64_mingw]
gem "dotenv-rails"
gem "factory_bot_rails"
gem "faker"
gem "pry"
gem "rspec-rails"
gem "standard"
end

group :test do
gem "database_cleaner"
gem "launchy"
end
Loading

0 comments on commit 175a57f

Please sign in to comment.