Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
edavey authored Sep 23, 2024
0 parents commit cbd4db6
Show file tree
Hide file tree
Showing 159 changed files with 5,729 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
94 changes: 94 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
## IMPORTANT ##
#
# Usually a pattern here also belongs in your `.gitignore` file and vice versa.
#
# Note that Docker's ignore syntax is slightly different to Git's. The main
# difference is that Git interprets patterns without a leading slash as applying
# to any subdirectory, while Docker interprets them as relative to the project
# root directory. To resolve that, a `.dockerignore` should prefix those
# patterns with `**/`. This is also compatible with Git.
#
# This file is NOT a substitute for being intentional in copying directories to
# a Docker image. Avoid use of `COPY . <destination>` in your `Dockerfile`s.
#
## How to use this file
#
# Add patterns to the section they apply to, sorted by:
#
# 1. absolute paths to or patterns for files (with a `/` prefix)
# 2. absolute paths to or patterns for directories
# 3. relative paths to or patterns for files (with a `**/` prefix)
# 4. relative paths to or patterns for directories
# 5. pattern exceptions (sorted as above)
#
# Sort them alphanumerically within each section.
#
# If no section fits, create one. No path or pattern should exist without a
# section or label.
#

## Sensitive files
#
# Note that these patterns will ignore any files matched by their equivalents in
# `.gitignore`. This is probably what you want in many cases, but you may need
# to add exceptions here if you really want to include them in your Docker
# images. An exception is a more specific pattern (ideally a fully specified
# path without any wildcards) prefixed with a `!` and must be defined after the
# pattern it's excepting (which will happen naturally if you're following the
# sort order above).
#
### Databases
**/*.db*
**/*.dump*
**/*.sql*
**/*.sqlite3*
### Environment variables
**/.env
**/.env.*
### Logs
**/*.log*
### Secrets and keys
**/*.crt*
**/*.key*
**/*.pem*
### Spreadsheet data
**/*.bks*
**/*.csv*
**/*.dex*
**/*.numbers*
**/*.ods*
**/*.ots*
**/*.tsv*
**/*.xlr*
**/*.xls*
### Terraform
**/.terraformrc*
**/terraform.rc*
**/*.tfstate*
**/*.tfvars*
**/.terraform/
### XML data
**/*.xml*

## Dependencies
/Brewfile.lock.json
/.bundle/
/node_modules/
/vendor/bundle/

## Temporary files
/coverage/
/log/
**/tmp/

## Build artefacts
/public/assets/

## Docker specific patterns ##
#
### Dependencies
/Brewfile
### Workflow configuration
/.github/
### git stuff
/.git/
21 changes: 21 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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

# TODO: Replace `example.com` with the canonical hostname of the app
CANONICAL_HOSTNAME=example.com

# TODO: Add a comma seperated list of any other hostnames you want to
# app to respond to and redirect to the canonical hostname, or delete
# this line completely
ADDITIONAL_HOSTNAMES=
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
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/log/
/tmp/
/vendor/
/public/assets
/coverage
7 changes: 7 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["eslint:recommended", "prettier"],
"env": {
"browser": true,
"es6": true
}
}
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do you need to update the changelog? -->

## Changes in this PR

## Screenshots of UI changes

### Before

### After

## Next steps

- [ ] Run any necessary
[accessibility testing](https://playbook.dxw.com/guides/web-accessibility.html)
on this feature.
79 changes: 79 additions & 0 deletions .github/workflows/automatic-rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
on:
issue_comment:
types:
- created
pull_request_target:
types:
- auto_merge_enabled

env:
AUTO_REBASE_PERSONAL_ACCESS_TOKEN:
${{ secrets.AUTO_REBASE_PERSONAL_ACCESS_TOKEN }}

jobs:
check-token:
if: |
(
github.event.issue.pull_request &&
contains(github.event.comment.body, '/rebase')
) ||
github.event_name == 'pull_request_target'
runs-on: ubuntu-latest

steps:
- if: "! env.AUTO_REBASE_PERSONAL_ACCESS_TOKEN"
name: Prompt to add a token
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number || github.event.number }}
body: |
To automatically rebase, you need to add a [personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) with the name `AUTO_REBASE_PERSONAL_ACCESS_TOKEN` to the [secrets section of this repo](https://github.com/${{ github.event.repository.full_name }}/settings/secrets/actions).
Once this is done, you can try the `/rebase` command again.
- if: github.event.comment
name: React to the triggering comment
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ github.event.comment.id }}
reactions:
${{ env.AUTO_REBASE_PERSONAL_ACCESS_TOKEN && '+1' || '-1' }}

- if: "! env.AUTO_REBASE_PERSONAL_ACCESS_TOKEN"
name: Return a failing state if we have no token
run: exit 1

rebase:
needs: check-token
name: Rebase

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
token: ${{ env.AUTO_REBASE_PERSONAL_ACCESS_TOKEN }}
fetch-depth: 0

- name: Rebase on top of the default branch
uses: cirrus-actions/[email protected]
env:
GITHUB_TOKEN: ${{ env.AUTO_REBASE_PERSONAL_ACCESS_TOKEN }}

- if: failure()
name: Notify of the failure
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number || github.event.number }}
body: |
Automatic rebasing for this issue has failed :disappointed:
You'll have to rebase this one manually, I'm afraid.
- if: success() && github.event.comment
name: React to the triggering comment
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ github.event.comment.id }}
reactions: hooray
43 changes: 43 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# TODO: Enable GitHub Actions on the repository to test all pull requests
# https://github.com/<org>/<repo>/actions
on:
pull_request:
push:
branches:
- main
- develop

jobs:
test:
runs-on: ubuntu-latest

env:
RAILS_ENV: test

steps:
- name: Check out code
uses: actions/checkout@v4

- id: cache-docker
uses: actions/cache@v3
with:
path: /tmp/docker-save
key:
docker-save-${{ hashFiles('Dockerfile', 'Gemfile.lock',
'package-lock.json') }}

- if: steps.cache-docker.outputs.cache-hit == 'true'
name: Load cached Docker image
run: docker load -i /tmp/docker-save/snapshot.tar || true

- name: Build
run: script/ci/cibuild

- name: Test
run: script/ci/test

- if: always() && steps.cache-docker.outputs.cache-hit != 'true'
name: Prepare Docker cache
run:
mkdir -p /tmp/docker-save && docker save app_test:latest -o
/tmp/docker-save/snapshot.tar && ls -lh /tmp/docker-save
87 changes: 87 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
## IMPORTANT ##
#
# Usually a pattern here also belongs in your `.dockerignore` file and vice
# versa.
#
# Note that Docker's ignore syntax is slightly different to Git's. The main
# difference is that Git interprets patterns without a leading slash as applying
# to any subdirectory, while Docker interprets them as relative to the project
# root directory. To resolve that, a `.dockerignore` should prefix those
# patterns with `**/`. This is also compatible with Git.
#
## How to use this file
#
# Add patterns to the section they apply to, sorted by:
#
# 1. absolute paths to or patterns for files (with a `/` prefix)
# 2. absolute paths to or patterns for directories
# 3. relative paths to or patterns for files (without a `/` prefix)
# 4. relative paths to or patterns for directories
# 5. pattern exceptions (sorted as above)
#
# Sort them alphanumerically within each section.
#
# If no section fits, create one. No path or pattern should exist without a
# section or label.
#

## Sensitive files
#
# To override these ignored files on a case-by-case basis,
# instead of adding a rule to this file, force add them:
#
# ```
# git add path/to/file --force
# ```
#
# This reduces the risk of accidentally committing files that happen to match
# the ignore pattern exception, or a file being removed and readded
# unintentionally in the future.
#
### Databases
*.db*
*.dump*
*.sql*
*.sqlite3*
### Environment variables
.env
.env.*
### Logs
*.log*
### Secrets and keys
*.crt*
*.key*
*.pem*
### Spreadsheet data
*.bks*
*.csv*
*.dex*
*.numbers*
*.ods*
*.ots*
*.tsv*
*.xlr*
*.xls*
### Terraform
.terraformrc*
terraform.rc*
*.tfstate*
*.tfvars*
.terraform/
### XML data
*.xml*

## Dependencies
/Brewfile.lock.json
/.bundle/
/node_modules/
/vendor/bundle/

## Temporary files
/coverage/
/log/
tmp/

## Build artefacts
/public/assets/
/spec/examples.txt
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.17.0
Loading

0 comments on commit cbd4db6

Please sign in to comment.