-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from uktrade/adds-dockerised-django-app
Adds dockerised django app and postgres database
- Loading branch information
Showing
62 changed files
with
7,791 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
repository: orp | ||
builder: | ||
name: paketobuildpacks/builder-jammy-full | ||
version: 0.3.339 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Exit early if something goes wrong | ||
set -e | ||
|
||
# Add commands below to run inside the container after all the other buildpacks have been applied | ||
export BUILD_STEP='True' | ||
export COPILOT_ENVIRONMENT_NAME='build' | ||
export DJANGO_SETTINGS_MODULE="config.settings.base" | ||
|
||
poetry run python orp/manage.py collectstatic --noinput |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.git | ||
.github | ||
.gitignore | ||
.idea | ||
.vscode | ||
.mypy_cache | ||
.pre-commit-config.yaml | ||
CODEOWNERS | ||
LICENSE | ||
Makefile | ||
README.md | ||
__pycache__ | ||
adr | ||
docs | ||
paas_entrypoint.sh | ||
Procfile | ||
.copilot/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Code Quality Checks | ||
|
||
on: [push] | ||
|
||
jobs: | ||
lint: | ||
name: Run lint checks | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install poetry | ||
poetry install --only dev | ||
- name: black | ||
run: poetry run pre-commit run black --all-files | ||
|
||
- name: isort | ||
run: poetry run pre-commit run isort --all-files | ||
|
||
- name: flake8 | ||
run: poetry run pre-commit run flake8 --all-files | ||
|
||
- name: detect-secrets | ||
run: poetry run pre-commit run detect-secrets --all-files | ||
|
||
- name: mypy | ||
run: poetry run pre-commit run mypy --all-files | ||
|
||
- name: bandit | ||
run: poetry run pre-commit run bandit --all-files | ||
test: | ||
name: Run unit tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install poetry | ||
poetry install --without dev | ||
- name: Build bundle | ||
run: | | ||
npm install | ||
npm run build | ||
DJANGO_SETTINGS_MODULE=config.settings.local poetry run orp/manage.py collectstatic --noinput | ||
# - name: Run tests | ||
# run: poetry run pytest orp/tests | ||
|
||
# - name: Generate coverage report | ||
# run: poetry run coverage xml | ||
|
||
# - name: Upload coverage report | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: coverage | ||
# path: coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: mixed-line-ending | ||
- repo: https://github.com/psf/black | ||
rev: 24.4.2 | ||
hooks: | ||
- id: black | ||
args: [--check, --diff] # diff is required for Github workflow | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
args: | ||
- --check | ||
- --diff # diff is required for Github workflow | ||
- --profile black | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 7.0.0 | ||
hooks: | ||
- id: flake8 | ||
- repo: https://github.com/Yelp/detect-secrets | ||
rev: v1.5.0 | ||
hooks: | ||
- id: detect-secrets | ||
args: [--baseline, .secrets.baseline] | ||
exclude: poetry.lock | ||
- repo: https://github.com/pycqa/bandit | ||
rev: '1.7.8' | ||
hooks: | ||
- id: bandit | ||
args: ["-c", "pyproject.toml"] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: 'v1.10.0' | ||
hooks: | ||
- id: mypy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
{ | ||
"version": "1.5.0", | ||
"plugins_used": [ | ||
{ | ||
"name": "ArtifactoryDetector" | ||
}, | ||
{ | ||
"name": "AWSKeyDetector" | ||
}, | ||
{ | ||
"name": "AzureStorageKeyDetector" | ||
}, | ||
{ | ||
"name": "Base64HighEntropyString", | ||
"limit": 4.5 | ||
}, | ||
{ | ||
"name": "BasicAuthDetector" | ||
}, | ||
{ | ||
"name": "CloudantDetector" | ||
}, | ||
{ | ||
"name": "DiscordBotTokenDetector" | ||
}, | ||
{ | ||
"name": "GitHubTokenDetector" | ||
}, | ||
{ | ||
"name": "GitLabTokenDetector" | ||
}, | ||
{ | ||
"name": "HexHighEntropyString", | ||
"limit": 3.0 | ||
}, | ||
{ | ||
"name": "IbmCloudIamDetector" | ||
}, | ||
{ | ||
"name": "IbmCosHmacDetector" | ||
}, | ||
{ | ||
"name": "IPPublicDetector" | ||
}, | ||
{ | ||
"name": "JwtTokenDetector" | ||
}, | ||
{ | ||
"name": "KeywordDetector", | ||
"keyword_exclude": "" | ||
}, | ||
{ | ||
"name": "MailchimpDetector" | ||
}, | ||
{ | ||
"name": "NpmDetector" | ||
}, | ||
{ | ||
"name": "OpenAIDetector" | ||
}, | ||
{ | ||
"name": "PrivateKeyDetector" | ||
}, | ||
{ | ||
"name": "PypiTokenDetector" | ||
}, | ||
{ | ||
"name": "SendGridDetector" | ||
}, | ||
{ | ||
"name": "SlackDetector" | ||
}, | ||
{ | ||
"name": "SoftlayerDetector" | ||
}, | ||
{ | ||
"name": "SquareOAuthDetector" | ||
}, | ||
{ | ||
"name": "StripeDetector" | ||
}, | ||
{ | ||
"name": "TelegramBotTokenDetector" | ||
}, | ||
{ | ||
"name": "TwilioKeyDetector" | ||
} | ||
], | ||
"filters_used": [ | ||
{ | ||
"path": "detect_secrets.filters.allowlist.is_line_allowlisted" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.common.is_baseline_file", | ||
"filename": ".secrets.baseline" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies", | ||
"min_level": 2 | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_indirect_reference" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_likely_id_string" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_lock_file" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_potential_uuid" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_sequential_string" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_swagger_file" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_templated_secret" | ||
} | ||
], | ||
"results": { | ||
"Makefile": [ | ||
{ | ||
"type": "Basic Auth Credentials", | ||
"filename": "Makefile", | ||
"hashed_secret": "afc848c316af1a89d49826c5ae9d00ed769415f3", | ||
"is_verified": false, | ||
"line_number": 102 | ||
} | ||
], | ||
"orp/tests/conftest.py": [ | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "orp/tests/conftest.py", | ||
"hashed_secret": "ff84e88d512a74e0763b73780b819937e28100cf", | ||
"is_verified": false, | ||
"line_number": 17 | ||
} | ||
], | ||
"orp/tests/core/test_companies_house.py": [ | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "orp/tests/core/test_companies_house.py", | ||
"hashed_secret": "ff84e88d512a74e0763b73780b819937e28100cf", | ||
"is_verified": false, | ||
"line_number": 10 | ||
} | ||
], | ||
"orp/tests/data/mock_ch_profile_response.json": [ | ||
{ | ||
"type": "Base64 High Entropy String", | ||
"filename": "orp/tests/data/mock_ch_profile_response.json", | ||
"hashed_secret": "da6511f97b6d20a5390ea9afd4c155f9d7236613", | ||
"is_verified": false, | ||
"line_number": 44 | ||
} | ||
] | ||
}, | ||
"generated_at": "2024-09-09T12:08:54Z" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# The Open Regulation Platform team maintain the orp service | ||
* @uktrade/orp |
Oops, something went wrong.