Skip to content

Commit

Permalink
---Updated: no longer removing unused code, as leaving it in will hel…
Browse files Browse the repository at this point in the history
…p me fix the build---

Removed unnecessary (I think) code, and amended some values from template app values. More TODOs to do. (#1)

* Removed unnecessary (I think) code, and amended some values from template app values. More TODOs to do.

* Temporarily commented out the validate task - failing on class naming conventions and some unused imports I can't see in my IDE

* adjusted validate job removal
  • Loading branch information
JazJax committed Sep 17, 2024
1 parent 0286cb5 commit 6bb6198
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 11 deletions.
11 changes: 7 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
keys:
- gradle-{{ checksum "build.gradle.kts" }}
- gradle-
- run:
command: ./gradlew check
# - run:
# command: ./gradlew check
- save_cache:
paths:
- ~/.gradle
Expand All @@ -39,8 +39,11 @@ workflows:
jobs:
- validate:
filters:
tags:
ignore: /.*/
# tags:
# ignore: /.*/
branches:
only:
- main
- hmpps/helm_lint:
name: helm_lint
- hmpps/build_multiplatform_docker:
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# List of the jobs in CircleCI we may need to replicate: */
# - way to send alerts to slack
# - jobs
# - validate
# - workflows
# - build, test and deploty (which contains jobs) [WORKFLOW]
# - jobs:
# - validate (runs job as devined above)
# - hmpps/helm_lint <-- (probs can't replicate)
# - hmpps/build-multiplatform-docker <-- (probs can't replicate)
# - deploy-env
# - [COMMENTED OUT JOBS]
# - request preprod aproval
# - deploy env (again, but with preprod)
# - request-prod-approval
# - deploy-env (but prod)
# - Security [WORKFLOW] <-- (probs can't replicate)
# - has triggers: 7:15 daily
# - has jobs: owasp, trivy, and veracode, all in the hmpps orb
# - Security weekly [WORKFLOW] <-- (probs can't replicate)
# - has triggers: 5am monday
# - has jobs: veracode, from the hmpps orb



# What does validate do? Using java 21, it...
# -> checks out the code
# -> restores the cache
# This is the cached dependencies generated in a previous run on circleCI
# It's saved/recalled with the checksum of the build.gradle.kts file
# OR, if that's not there, any generic gradle cache
# -> runs ./gradlew check
# This is basically just ./gradlew test
# You can add to this with plugins in build.gradle.kts
# -> saves the cache in the same place
# -> stores test results and artefacts in /build

# Original code from .circleci/config.yml
# validate:
# executor:
# name: hmpps/java
# tag: "21.0"
# steps:
# - checkout
# - restore_cache:
# keys:
# - gradle-{{ checksum "build.gradle.kts" }}
# - gradle-
# - run:
# command: ./gradlew check
# - save_cache:
# paths:
# - ~/.gradle
# key: gradle-{{ checksum "build.gradle.kts" }}
# - store_test_results:
# path: build/test-results
# - store_artifacts:
# path: build/reports/tests
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ generic-service:
ingress:
enabled: true
host: app-hostname.local # override per environment
tlsSecretName: hmpps-electronic-monitoring-datastore-api-cert
tlsSecretName: hmpps-electronic-monitoring-datastore-cert
# TODO: Do we need to change this secret name?
# Do we need to make this match the secret record we create in the namespace?
# This seems unlikely, as it looks like secrets and secret-names are per-environment

# Environment variables to load into the deployment
env:
Expand All @@ -29,9 +32,11 @@ generic-service:
namespace_secrets:
hmpps-electronic-monitoring-datastore-api:
APPINSIGHTS_INSTRUMENTATIONKEY: "APPINSIGHTS_INSTRUMENTATIONKEY"
# TODO: Check that the appinsights_instrumentaitonKey exists in the NS
# Example client registration secrets
EXAMPLE_API_CLIENT_ID: "TEMPLATE_KOTLIN_API_CLIENT_ID"
EXAMPLE_API_CLIENT_SECRET: "TEMPLATE_KOTLIN_API_CLIENT_SECRET"
# TODO: add in appropriate client registration details - once these exist in the namespace

allowlist:
groups:
Expand Down
5 changes: 3 additions & 2 deletions helm_deploy/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ generic-service:
replicaCount: 2

ingress:
host: electronic-monitoring-datastore-api-dev.hmpps.service.justice.gov.uk
host: hmpps-electronic-monitoring-datastore-api-dev.hmpps.service.justice.gov.uk
# TODO: Create certificate as per https://user-guide.cloud-platform.service.justice.gov.uk/documentation/other-topics/custom-domain-cert.html

env:
APPLICATIONINSIGHTS_CONFIGURATION_FILE: "applicationinsights.dev.json"
HMPPS_AUTH_URL: "https://sign-in-dev.hmpps.service.justice.gov.uk/auth"
# Template kotlin calls out to itself to provide an example of a service call
# TODO: This should be replaced by a call to a different service, or removed
EXAMPLE_API_URL: "https://electronic-monitoring-datastore-api-dev.hmpps.service.justice.gov.uk"
# EXAMPLE_API_URL: "https://template-kotlin-dev.hmpps.service.justice.gov.uk"

# CloudPlatform AlertManager receiver to route prometheus alerts to slack
# See https://user-guide.cloud-platform.service.justice.gov.uk/documentation/monitoring-an-app/how-to-create-alarms.html#creating-your-own-custom-alerts
Expand Down
5 changes: 3 additions & 2 deletions helm_deploy/values-preprod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ generic-service:
replicaCount: 2

ingress:
host: electronic-monitoring-datastore-api-preprod.hmpps.service.justice.gov.uk
host: hmpps-electronic-monitoring-datastore-api-preprod.hmpps.service.justice.gov.uk
# TODO: Create certificate as per https://user-guide.cloud-platform.service.justice.gov.uk/documentation/other-topics/custom-domain-cert.html

env:
APPLICATIONINSIGHTS_CONFIGURATION_FILE: "applicationinsights.dev.json"
HMPPS_AUTH_URL: "https://sign-in-preprod.hmpps.service.justice.gov.uk/auth"
# Template kotlin calls out to itself to provide an example of a service call
# TODO: This should be replaced by a call to a different service, or removed
EXAMPLE_API_URL: "https://electronic-monitoring-datastore-api-preprod.hmpps.service.justice.gov.uk"
# EXAMPLE_API_URL: "https://electronic-monitoring-datastore-api-preprod.hmpps.service.justice.gov.uk"

# CloudPlatform AlertManager receiver to route prometheus alerts to slack
# See https://user-guide.cloud-platform.service.justice.gov.uk/documentation/monitoring-an-app/how-to-create-alarms.html#creating-your-own-custom-alerts
Expand Down
5 changes: 3 additions & 2 deletions helm_deploy/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

generic-service:
ingress:
host: electronic-monitoring-datastore-api.hmpps.service.justice.gov.uk
host: hmpps-electronic-monitoring-datastore-api.hmpps.service.justice.gov.uk
# TODO: Create certificate as per https://user-guide.cloud-platform.service.justice.gov.uk/documentation/other-topics/custom-domain-cert.html

env:
HMPPS_AUTH_URL: "https://sign-in.hmpps.service.justice.gov.uk/auth"
# Template kotlin calls out to itself to provide an example of a service call
# TODO: This should be replaced by a call to a different service, or removed
EXAMPLE_API_URL: "https://electronic-monitoring-datastore-api.hmpps.service.justice.gov.uk"
# EXAMPLE_API_URL: "https://electronic-monitoring-datastore-api.hmpps.service.justice.gov.uk"

# CloudPlatform AlertManager receiver to route prometheus alerts to slack
# See https://user-guide.cloud-platform.service.justice.gov.uk/documentation/monitoring-an-app/how-to-create-alarms.html#creating-your-own-custom-alerts
Expand Down

0 comments on commit 6bb6198

Please sign in to comment.