Skip to content

Commit 2e5d74b

Browse files
first commit
0 parents  commit 2e5d74b

File tree

107 files changed

+4858
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+4858
-0
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.*
2+
!.coveragerc
3+
!.env
4+
!.pylintrc

.editorconfig

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{py, rst, ini}]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.py]
16+
line_length = 79
17+
known_first_party = tmh_registry, config
18+
multi_line_output = 3
19+
default_section = THIRDPARTY
20+
recursive = true
21+
skip = venv/
22+
skip_glob = **/migrations/*.py
23+
include_trailing_comma = true
24+
force_grid_wrap = 0
25+
use_parentheses = true
26+
27+
[*.{html, css, scss, json, yml}]
28+
indent_style = space
29+
indent_size = 2
30+
31+
[*.md]
32+
trim_trailing_whitespace = false
33+
34+
[Makefile]
35+
indent_style = tab
36+
37+
[nginx.conf]
38+
indent_style = space
39+
indent_size = 2

.envs/.local/.django

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# General
2+
# ------------------------------------------------------------------------------
3+
USE_DOCKER=yes
4+
IPYTHONDIR=/app/.ipython
5+
6+
7+
ADMIN_PASSWORD=admin

.envs/.local/.postgres

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# PostgreSQL
2+
# ------------------------------------------------------------------------------
3+
POSTGRES_HOST=postgres
4+
POSTGRES_PORT=5432
5+
POSTGRES_DB=tmh_registry
6+
POSTGRES_USER=admin
7+
POSTGRES_PASSWORD=admin
8+
DATABASE_URL=postgres://admin:admin@postgres:5432/tmh_registry

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
# Update Github actions in workflows
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
- package-ecosystem: "pip"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+

.github/pull_request_template.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Description
2+
3+
<!-- Write and explain of the changes introduced by this PR for the reviewers to fully understand -->
4+
5+
## Checklist
6+
7+
<!-- Please check everything that applies: -->
8+
9+
- [ ] I have reviewed my code and checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc)
10+
- [ ] I have created at least one test case for the changes I have made
11+
- [ ] I have updated the documentation (**SwaggerHub**, **README.md**, **Wiki**, etc.) for the changes I have made

.github/workflows/ci.yml

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: CI
2+
3+
# Enable Buildkit and let compose use it to speed up image building
4+
env:
5+
DOCKER_BUILDKIT: 1
6+
COMPOSE_DOCKER_CLI_BUILD: 1
7+
8+
on:
9+
push:
10+
branches:
11+
- 'feat/**'
12+
- 'ci/**'
13+
- 'issue/**'
14+
- 'master'
15+
- 'develop'
16+
- 'hotfix/**'
17+
- 'bug/**'
18+
- 'fix/**'
19+
- 'refactor/**'
20+
- 'build/**'
21+
- 'test/**'
22+
23+
24+
jobs:
25+
precommit:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Setup Python
29+
uses: actions/[email protected]
30+
with:
31+
python-version: 3.8.7
32+
architecture: x64
33+
- name: Checkout Repository
34+
uses: actions/checkout@main
35+
- name: Install dependencies
36+
run: pip install -r requirements/local.txt
37+
- name: Run precommit
38+
run: pre-commit run --all-files
39+
40+
# With no caching at all the entire ci process takes 4m 30s to complete!
41+
unittest:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout Code Repository
45+
uses: actions/checkout@v2
46+
- name: Build the Stack
47+
run: docker-compose -f local.yml build
48+
- name: Make DB Migrations
49+
run: docker-compose -f local.yml run --rm django python manage.py migrate
50+
- name: Run the Stack
51+
run: docker-compose -f local.yml up -d
52+
- name: Run Django Tests
53+
run: docker-compose -f local.yml exec -T django coverage run --rcfile=.pre-commit/setup.cfg -m pytest --disable-pytest-warnings;
54+
- name: Print Coverage
55+
run: docker-compose -f local.yml exec -T django coverage report
56+
- name: Tear down the Stack
57+
run: docker-compose -f local.yml down
58+
59+
deploy:
60+
runs-on: ubuntu-latest
61+
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master'
62+
needs:
63+
- unittest
64+
- precommit
65+
steps:
66+
- name: Checkout Repository
67+
uses: actions/checkout@v1
68+
69+
- name: Push to Staging
70+
if: github.ref == 'refs/heads/develop'
71+
uses: akhileshns/[email protected]
72+
73+
with:
74+
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
75+
heroku_app_name: ${{ secrets.HEROKU_STG_APP_NAME }}
76+
heroku_email: ${{ secrets.HEROKU_EMAIL }}
77+
78+
79+
- name: Push to Production
80+
if: github.ref == 'refs/heads/master'
81+
uses: akhileshns/[email protected]
82+
83+
with:
84+
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
85+
heroku_app_name: ${{ secrets.HEROKU_PROD_APP_NAME }}
86+
heroku_email: ${{ secrets.HEROKU_EMAIL }}
87+
88+
89+
bump:
90+
if: "github.event_name == 'push' && github.ref == 'refs/heads/master'"
91+
runs-on: ubuntu-latest
92+
needs:
93+
- unittest
94+
- precommit
95+
- deploy
96+
steps:
97+
- name: Checkout Repository
98+
uses: actions/checkout@main
99+
- name: Install dependencies
100+
uses: actions/[email protected]
101+
with:
102+
node-version: '12.x'
103+
- name: Install dependencies
104+
run: yarn install
105+
- name: Release
106+
107+
env:
108+
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
109+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
run: npx semantic-release
111+

0 commit comments

Comments
 (0)