Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tamsinforbes committed Nov 28, 2023
1 parent f8810b7 commit c0ec1e0
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 101 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/deploy-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ env:
ECR_REGION: ${{ vars.DEVELOPMENT_ECR_REGION }}
ECR_ROLE_TO_ASSUME: ${{ secrets.DEVELOPMENT_ECR_ROLE_TO_ASSUME }}

# AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }}
# AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }}

# FLASK_APP_SECRET: ${{ secrets.DEV_FLASK_APP_SECRET }}
# OPS_ENG_REPORTS_ENCRYPT_KEY: ${{ secrets.DEV_OPS_ENG_REPORTS_ENCRYPT_KEY }}
# OPERATIONS_ENGINEERING_REPORTS_API_KEY: ${{ secrets.DEV_OPERATIONS_ENGINEERING_REPORTS_API_KEY }}

jobs:
build-push:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -83,9 +76,3 @@ jobs:
--set image.repository=${ECR_REGISTRY}/${ECR_REPOSITORY} \
--set ingress.host=operations-engineering-example-${ENV}.cloud-platform.service.justice.gov.uk \
--set ingress.identifier=example-ingress-operations-engineering-example-${ENV}-green
# --set application.auth0ClientId=${AUTH0_CLIENT_ID} \
# --set application.auth0ClientSecret=${AUTH0_CLIENT_SECRET} \
# --set application.appSecretKey=${FLASK_APP_SECRET} \
# --set application.encryptionKey=${OPS_ENG_REPORTS_ENCRYPT_KEY} \
# --set application.apiKey=${OPERATIONS_ENGINEERING_REPORTS_API_KEY} \
24 changes: 0 additions & 24 deletions .github/workflows/deploy-to-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ env:
ECR_REGION: ${{ vars.PRODUCTION_ECR_REGION }}
ECR_ROLE_TO_ASSUME: ${{ secrets.PRODUCTION_ECR_ROLE_TO_ASSUME }}

# AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }}
# AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }}

# FLASK_APP_SECRET: ${{ secrets.PROD_FLASK_APP_SECRET }}
# OPS_ENG_REPORTS_ENCRYPT_KEY: ${{ secrets.PROD_OPS_ENG_REPORTS_ENCRYPT_KEY }}
# OPERATIONS_ENGINEERING_REPORTS_API_KEY: ${{ secrets.PROD_OPERATIONS_ENGINEERING_REPORTS_API_KEY }}

jobs:
build-push:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -89,20 +82,3 @@ jobs:
--set image.repository=${ECR_REGISTRY}/${ECR_REPOSITORY} \
--set ingress.host=operations-engineering-example-${ENV}.cloud-platform.service.justice.gov.uk \
--set ingress.identifier=example-ingress-operations-engineering-example-${ENV}-green
# --set application.auth0ClientId=${AUTH0_CLIENT_ID} \
# --set application.auth0ClientSecret=${AUTH0_CLIENT_SECRET} \
# --set application.appSecretKey=${FLASK_APP_SECRET} \
# --set application.encryptionKey=${OPS_ENG_REPORTS_ENCRYPT_KEY} \
# --set application.apiKey=${OPERATIONS_ENGINEERING_REPORTS_API_KEY} \

# - name: Report failure to Slack
# if: always()
# uses: ravsamhq/notify-slack-action@v2
# with:
# status: ${{ job.status }}
# notify_when: "failure"
# notification_title: "Failed to deploy the example application to production"
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN \
--update \
build-base

# Copy dirs/files from the repo to the container wd
# Copy dirs/files from the repo to the container working directory
COPY requirements.txt requirements.txt
COPY application application
COPY build.py build.py
Expand Down
3 changes: 0 additions & 3 deletions application/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@
@app.route("/", methods=["GET", "POST"])
def index():
return render_template("index.html")

# if __name__ == '__main__':
# app.run()
62 changes: 2 additions & 60 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,66 +27,8 @@ setup:
preview:
flask --app application/__init__ --debug run

app:
local:
docker compose up --build



# 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 app # dev stop venv lint test format local prod clean-test all
.PHONY: help setup preview local

0 comments on commit c0ec1e0

Please sign in to comment.