generated from ministryofjustice/template-repository
-
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 branch 'main' of github.com:ministryofjustice/operations-engine…
…ering-example
- Loading branch information
Showing
10 changed files
with
180 additions
and
80 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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,89 @@ | ||
.ONESHELL: | ||
|
||
# Default values for variables (can be overridden by passing arguments to `make`) | ||
# PYTHON_SOURCE_FILES = ./instance ./report_app ./tests ./dynambodb_testing setup.py operations_engineering_reports.py build.py | ||
# RELEASE_NAME ?= default-release-name | ||
# AUTH0_CLIENT_ID ?= default-auth0-client-id | ||
# AUTH0_CLIENT_SECRET ?= default-auth0-client-secret | ||
# APP_SECRET_KEY ?= default-app-secret-key | ||
# ENCRYPTION_KEY ?= default-encryption-key | ||
# API_KEY ?= default-api-key | ||
# HOST_SUFFIX ?= default-host-suffix | ||
# | ||
|
||
# Targets | ||
help: | ||
@echo "Available commands:" | ||
@echo "make setup - Setup the environment" | ||
# @echo "make test - Run tests" | ||
@echo "make preview - Run locally in debug mode" | ||
# @echo "make deploy-dev - Deploy the application to the dev namespace" | ||
|
||
setup: | ||
python3 -m venv venv | ||
@venv/bin/pip3 install --upgrade pip | ||
@venv/bin/pip3 install -r requirements.txt | ||
|
||
preview: | ||
flask --app ops_eng_app/__init__ --debug run | ||
|
||
|
||
|
||
# venv: requirements.txt requirements-test.txt | ||
# python3 -m venv venv | ||
# @venv/bin/pip3 install --upgrade pip | ||
# @venv/bin/pip3 install -r requirements.txt | ||
|
||
# lint: venv | ||
# @venv/bin/flake8 --ignore=E501,W503 $(PYTHON_SOURCE_FILES) | ||
# @venv/bin/mypy --ignore-missing-imports $(PYTHON_SOURCE_FILES) | ||
# @venv/bin/pylint --recursive=y $(PYTHON_SOURCE_FILES) | ||
|
||
# format: venv | ||
# @venv/bin/black $(PYTHON_SOURCE_FILES) | ||
|
||
# test: | ||
# export FLASK_CONFIGURATION=development; python3 -m pytest -v | ||
|
||
# clean-test: | ||
# rm -fr venv | ||
# rm -fr .tox/ | ||
# rm -fr .pytest_cache | ||
# rm -fr .mypy_cache | ||
# rm -fr .coverage | ||
# rm -fr htmlcov/ | ||
# rm -fr .pytest_cache | ||
|
||
|
||
# # To run locally, you need to pass the following: | ||
# # make deploy IMAGE=my-image RELEASE_NAME=my-release AUTH0_CLIENT_ID=my-auth0-id AUTH0_CLIENT_SECRET=my-secret APP_SECRET_KEY=my-app-secret ENCRYPTION_KEY=my-encryption-key API_KEY=my-api-key HOST_SUFFIX=my-host-suffix | ||
# deploy-dev: | ||
# helm --debug upgrade $(RELEASE_NAME) helm/operations-engineering-reports \ | ||
# --install \ | ||
# --force \ | ||
# --wait \ | ||
# --set image.tag=$(IMAGE) \ | ||
# --set application.auth0ClientId=$(AUTH0_CLIENT_ID) \ | ||
# --set application.auth0ClientSecret=$(AUTH0_CLIENT_SECRET) \ | ||
# --set application.appSecretKey=$(APP_SECRET_KEY) \ | ||
# --set application.encryptionKey=$(ENCRYPTION_KEY) \ | ||
# --set application.apiKey=$(API_KEY) \ | ||
# --set ingress.hosts={operations-engineering-reports-dev-$(HOST_SUFFIX).cloud-platform.service.justice.gov.uk} \ | ||
# --set image.repository=754256621582.dkr.ecr.eu-west-2.amazonaws.com/operations-engineering/operations-engineering-reports-dev-ecr \ | ||
# --namespace operations-engineering-reports-dev | ||
|
||
# delete-dev: | ||
# helm delete $(RELEASE_NAME) --namespace operations-engineering-reports-dev | ||
|
||
# all: | ||
|
||
# dev: | ||
# bash scripts/start-db-dev.sh | ||
|
||
# db-ui: | ||
# bash scripts/start-db-ui.sh | ||
|
||
# stop: | ||
# docker-compose down -v --remove-orphans | ||
|
||
.PHONY: preview setup help # dev stop venv lint test format local prod clean-test all |
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
from flask import Flask | ||
from flask import Flask, render_template, url_for | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route("/") | ||
def hello_gudetama(): | ||
return "<p>Hello Gudetama! Better eaten than rotten! Learn to rest not to quit.</p>" | ||
@app.route("/", methods=["GET", "POST"]) | ||
def gudetama(): | ||
return render_template("index.html") | ||
|
||
# if __name__ == '__main__': | ||
# app.run() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,12 @@ | ||
<html> | ||
<body> | ||
|
||
<h1>Hello Gudetama!</h1> | ||
|
||
<p>I hope you're having a lovely day?</p> | ||
|
||
<img src="{{url_for('static', filename='gudetama_meh.png')}}" width="256"/> | ||
|
||
</body> | ||
</html> | ||
|
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#authlib~=1.2.1 | ||
boto3~=1.26.159 | ||
botocore~=1.29.159 | ||
boto3~=1.29.4 # 1.26.159 | ||
botocore~=1.32.4 # 1.29.159 | ||
#cryptography~=41.0.3 | ||
flask~=2.3.3 | ||
flask-cors | ||
govuk-frontend-jinja | ||
gunicorn | ||
flask~=3.0.0 # 2.3.3 | ||
flask-cors~=4.0.0 | ||
govuk-frontend-jinja~=2.7.0 | ||
gunicorn~=21.2.0 | ||
python-dotenv~=1.0.0 | ||
requests~=2.31.0 | ||
pytest~=7.4.2 | ||
pytest~=7.4.3 | ||
#setuptools~=68.0.0 | ||
Jinja2~=3.1.2 |
This file was deleted.
Oops, something went wrong.