Skip to content

Commit

Permalink
Merge branch 'master' into DTSCCI-938
Browse files Browse the repository at this point in the history
  • Loading branch information
velimd authored Dec 17, 2024
2 parents 4334bc1 + e423a9b commit bd8e4a2
Show file tree
Hide file tree
Showing 265 changed files with 8,581 additions and 2,679 deletions.
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"local>hmcts/.github:renovate-config",
"local>hmcts/.github//renovate/automerge-minor"
],
"automergeSchedule": ["after 8am and before 5pm every weekday"],
"automergeSchedule": ["after 8am and before 11am every weekday"],
"schedule": ["after 8am and before 5pm every weekday"],
"packageRules": [
{
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
steps:
- uses: deepakputhraya/action-pr-title@master
with:
regex: '^(CIV-[0-9]{3,5} [a-zA-Z0-9._\- ]+)|(CIV-TASK [a-zA-Z0-9._\- ]+)|(\[Snyk\].+)|(DTSCCI-[0-9]{3,5} [a-zA-Z0-9._\- ]+)$' # Regex the title should match.
regex: '^(CIV-[0-9]{3,5} [a-zA-Z0-9._\- ]+)|(CIV-TASK [a-zA-Z0-9._\- ]+)|(\[Snyk\].+)|(DTSCCI-[0-9]{3,5}:* [a-zA-Z0-9._\- ]+)$' # Regex the title should match.
allowed_prefixes: 'CIV-,DTSCCI-,[Snyk]' # title should start with the given prefix
prefix_case_sensitive: true # title prefix are case insensitive:
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# renovate: datasource=github-releases depName=microsoft/ApplicationInsights-Java
ARG APP_INSIGHTS_AGENT_VERSION=3.6.1
ARG APP_INSIGHTS_AGENT_VERSION=3.6.2

# Application image

Expand Down
6 changes: 5 additions & 1 deletion Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def product = "civil"
def component = "service"
def ccdBranch = "master"
def camundaBranch = "master"
def dmnBranch = "master"
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)

AppPipelineConfig pipelineConf
Expand Down Expand Up @@ -48,6 +49,7 @@ def secrets = [
secret('microservicekey-ccd-gw', 'CCD_API_GATEWAY_S2S_KEY')
],
'civil-${env}': [
secret('case-document-am-api-s2s-secret', 'CASE_DOCUMENT_AM_API_S2S_SECRET'),
secret('microservicekey-civil-service', 'S2S_SECRET'),
secret('ccd-importer-username', 'CCD_CONFIGURER_IMPORTER_USERNAME'),
secret('ccd-importer-password', 'CCD_CONFIGURER_IMPORTER_PASSWORD'),
Expand Down Expand Up @@ -111,14 +113,15 @@ withPipeline(type, product, component) {
./bin/wait-for.sh definition-store
./bin/add-roles.sh
./bin/pull-latest-camunda-files.sh ${camundaBranch}
./bin/pull-latest-dmn-files.sh ${dmnBranch}
./bin/pull-latest-ccd-files.sh ${ccdBranch}
./bin/import-ccd-definition.sh "-e *-prod.json,*HNL-nonprod.json,AuthorisationCaseType-shuttered.json"
"""
}

yarnBuilder.yarn('yarn-update')
yarnBuilder.yarn('install-dependencies')

env.CIVIL_GENERAL_APPLICATIONS_URL = "https://ga-civil-service-pr-${CHANGE_ID}.preview.platform.hmcts.net"
env.IDAM_API_URL = "https://idam-api.aat.platform.hmcts.net"
env.SERVICE_AUTH_PROVIDER_API_BASE_URL = "http://rpe-service-auth-provider-aat.service.core-compute-aat.internal"
env.CCD_DATA_STORE_URL = "https://ccd-data-store-api-civil-service-pr-${CHANGE_ID}.preview.platform.hmcts.net"
Expand All @@ -144,6 +147,7 @@ withPipeline(type, product, component) {
eval \$(./bin/variables/load-staging-environment-variables.sh)
./bin/add-roles.sh
./bin/pull-latest-camunda-files.sh ${camundaBranch}
./bin/pull-latest-dmn-files.sh ${dmnBranch}
./bin/pull-latest-ccd-files.sh ${ccdBranch}
./bin/import-ccd-definition.sh "-e *-nonprod.json,*COS-nonprod.json,AuthorisationCaseType-shuttered.json"
./bin/import-bpmn-diagram.sh .
Expand Down
44 changes: 44 additions & 0 deletions bin/import-dmn-diagram.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash

set -eu
workspace=${1}
tenant_id=${2}
product=${3}

s2sSecret=${S2S_SECRET:-AABBCCDDEEFFGGHH}

#if [[ "${env}" == 'prod' ]]; then
# s2sSecret=${S2S_SECRET_PROD}-
#fi

serviceToken=$($(realpath ".")/bin/utils/idam-lease-service-token.sh civil_service \
$(docker run --rm hmctspublic.azurecr.io/imported/toolbelt/oathtool --totp -b ${s2sSecret}))

dmnFilepath="$(realpath $workspace)/resources"

for file in $(find ${dmnFilepath} -name '*.dmn')
do
uploadResponse=$(curl --insecure -v --silent -w "\n%{http_code}" --show-error -X POST \
${CAMUNDA_BASE_URL:-http://localhost:9404}/engine-rest/deployment/create \
-H "Accept: application/json" \
-H "ServiceAuthorization: Bearer ${serviceToken}" \
-F "deployment-name=$(basename ${file})" \
-F "deploy-changed-only=true" \
-F "deployment-source=$product" \
${tenant_id:+'-F' "tenant-id=$tenant_id"} \
-F "file=@${dmnFilepath}/$(basename ${file})")

upload_http_code=$(echo "$uploadResponse" | tail -n1)
upload_response_content=$(echo "$uploadResponse" | sed '$d')

if [[ "${upload_http_code}" == '200' ]]; then
echo "$(basename ${file}) diagram uploaded successfully (${upload_response_content})"
continue;
fi

echo "$(basename ${file}) upload failed with http code ${upload_http_code} and response (${upload_response_content})"
continue;

done


19 changes: 19 additions & 0 deletions bin/pull-latest-dmn-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

branchName=$1

#Checkout specific branch pf civil camunda bpmn definition
git clone https://github.com/hmcts/civil-wa-task-configuration.git
cd civil-wa-task-configuration

echo "Switch to ${branchName} branch on civil-wa-task-configuration"
git checkout ${branchName}
cd ..
mkdir wa-dmn

#Copy camunda folder to civil-ccd-def which contians dmn files
cp -r ./civil-wa-task-configuration/src/main/resources ./wa-dmn/.
rm -rf ./civil-wa-task-configuration

./bin/import-dmn-diagram.sh ./wa-dmn/. civil civil
rm -rf ./wa-dmn
1 change: 1 addition & 0 deletions bin/utils/process-definition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ docker run --rm --name json2xlsx \
-v ${definition_input_dir}:/tmp/ccd-definition \
-v ${definition_output_file}:/tmp/ccd-definition.xlsx \
-e CCD_DEF_CASE_SERVICE_BASE_URL=${CCD_DEF_CASE_SERVICE_BASE_URL:-http://docker.for.mac.localhost:4000} \
-e CCD_DEF_GEN_APP_SERVICE_BASE_URL=${CCD_DEF_GEN_APP_SERVICE_BASE_URL:-http://docker.for.mac.localhost:4550} \
-e CCD_DEF_VERSION=${CCD_DEF_VERSION:-} \
hmctspublic.azurecr.io/ccd/definition-processor:${definition_processor_version} \
json2xlsx -D /tmp/ccd-definition -o /tmp/ccd-definition.xlsx ${additionalParameters}
1 change: 1 addition & 0 deletions bin/variables/load-preview-environment-variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ echo "export CAMUNDA_BASE_URL=https://camunda-civil-service-pr-${pr}.preview.pla

# definition placeholders
echo "export CCD_DEF_CASE_SERVICE_BASE_URL=http://civil-service-pr-${pr}-java"
echo "export CCD_DEF_GEN_APP_SERVICE_BASE_URL=http://ga-civil-service-pr-${pr}.preview.platform.hmcts.net"
1 change: 1 addition & 0 deletions bin/variables/load-staging-environment-variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ echo "export CAMUNDA_BASE_URL=https://civil-service-camunda-staging-aat.service.

# definition placeholders
echo "export CCD_DEF_CASE_SERVICE_BASE_URL=http://civil-service-staging-java"
echo "export CCD_DEF_GEN_APP_SERVICE_BASE_URL=http://civil-service-staging-java-ga"
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def versions = [
junitPlatform : '1.11.3',
springBoot : springBoot.class.package.implementationVersion,
springStatemachine: '4.0.0',
lombok : '1.18.34',
lombok : '1.18.36',
springSecurity : '5.8.15',
camunda : '7.20.0',
jackson : '2.18.0',
jackson : '2.18.2',
testcontainers : '1.20.3',
pdfbox : '3.0.2',
tika : '2.9.2'
Expand Down Expand Up @@ -403,10 +403,10 @@ dependencies {
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.24.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-to-slf4j', version: '2.24.1'
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.12.0'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '9.0.96'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: '10.1.31'
implementation group: 'org.elasticsearch', name: 'elasticsearch', version: '7.17.25'
implementation group: 'com.networknt', name: 'json-schema-validator', version: '1.5.2'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '9.0.98'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: '10.1.34'
implementation group: 'org.elasticsearch', name: 'elasticsearch', version: '7.17.26'
implementation group: 'com.networknt', name: 'json-schema-validator', version: '1.5.4'

implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: versions.jackson
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: versions.jackson
Expand All @@ -425,7 +425,7 @@ dependencies {
implementation group: 'com.launchdarkly', name: 'launchdarkly-java-server-sdk', version: '6.3.0'

implementation group: 'com.azure', name: 'azure-core', version: '1.53.0'
implementation group: 'com.azure', name: 'azure-messaging-servicebus', version: '7.17.5'
implementation group: 'com.azure', name: 'azure-messaging-servicebus', version: '7.17.7'
implementation group: 'com.microsoft.azure', name: 'azure-servicebus', version: '3.6.7'
implementation group: 'org.apache.pdfbox', name: 'pdfbox', version: versions.pdfbox
implementation group: 'org.apache.pdfbox', name: 'pdfbox-io', version: versions.pdfbox
Expand All @@ -435,8 +435,8 @@ dependencies {
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.11.0'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '4.11.0'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '4.11.0'
testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.15.7'
testImplementation group: 'net.bytebuddy', name: 'byte-buddy-agent', version: '1.15.7'
testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.15.11'
testImplementation group: 'net.bytebuddy', name: 'byte-buddy-agent', version: '1.15.10'

testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: versions.lombok
testCompileOnly group: 'org.projectlombok', name: 'lombok', version: versions.lombok
Expand Down
19 changes: 18 additions & 1 deletion charts/civil-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
description: A Helm chart for civil-service App
name: civil-service
home: https://github.com/hmcts/civil-service
version: 0.0.72
version: 0.0.76
maintainers:
- name: HMCTS Civil team

Expand Down Expand Up @@ -34,3 +34,20 @@ dependencies:
version: 0.0.5
repository: 'https://hmctspublic.azurecr.io/helm/v1/repo/'
condition: wiremock.enabled

- name: civil-general-applications
version: 0.0.65
repository: 'https://hmctspublic.azurecr.io/helm/v1/repo/'
condition: civil-general-applications.enabled
- name: ccd-case-document-am-api
version: 1.7.14
repository: 'https://hmctspublic.azurecr.io/helm/v1/repo/'
condition: ccd-case-document-am-api.enabled
- name: em-ccdorc
version: 2.0.25
repository: 'https://hmctspublic.azurecr.io/helm/v1/repo/'
condition: em-ccdorc.enabled
- name: em-stitching
version: 1.0.55
repository: 'https://hmctspublic.azurecr.io/helm/v1/repo/'
condition: em-stitching.enabled
51 changes: 51 additions & 0 deletions charts/civil-service/values.aat.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ java:
ROLE_ASSIGNMENT_URL: http://am-role-assignment-service-aat.service.core-compute-aat.internal
ROLE_INITIALISATION_ENABLED: true
CASE_FLAGS_LOGGING_ENABLED: true
COURT_LOCATION_WA_DMN_ENABLED: false
postgresql:
enabled: true
image:
Expand Down Expand Up @@ -59,6 +60,56 @@ idam-pr:
XUI:
- https://civil-service-xui-staging.aat.platform.hmcts.net/oauth2/callback

civil-general-applications:
enabled: true
java:
releaseNameOverride: ${SERVICE_NAME}-ga
ingressHost: civil-service-ga-staging.aat.platform.hmcts.net
keyVaults:
civil:
resourceGroup: civil
secrets:
- name: civil-idam-client-secret
alias: idam.client.secret
- name: microservicekey-civil-service
alias: CIVIL_CLIENT_TOTP_SECRET
- name: system-update-user-username
alias: CIVIL_SYSTEM_UPDATE_USERNAME
- name: system-update-user-password
alias: CIVIL_SYSTEM_UPDATE_PASSWORD
- name: cross-access-user-username
alias: CIVIL_CROSS_ACCESS_USERNAME
- name: cross-access-user-password
alias: CIVIL_CROSS_ACCESS_PASSWORD
- name: prd-admin-user-username
alias: CIVIL_PRD_ADMIN_USERNAME
- name: prd-admin-user-password
alias: CIVIL_PRD_ADMIN_PASSWORD
- name: appinsights-instrumentation-key
alias: azure.application-insights.instrumentation-key
- name: docmosis-api-key
alias: docmosis.tornado.key
- name: gov-notify-api-key
alias: GOV_NOTIFY_API_KEY
- name: sendgrid-api-key
alias: SENDGRID_API_KEY
- name: robotics-notification-sender
alias: robotics.notification.sender
- name: robotics-notification-recipient
alias: robotics.notification.recipient
- name: launch-darkly-sdk-key
alias: LAUNCH_DARKLY_SDK_KEY
- name: robotics-notification-multipartyrecipient
alias: robotics.notification.multipartyrecipient
civil-gen-apps:
resourceGroup: civil
secrets:
- name: microservicekey-civil-general-applications
alias: idam.s2s-auth.totp_secret
environment:
LAUNCH_DARKLY_ENV: service-staging
PAY_CALLBACK_URL: https://civil-service-ga-staging.aat.platform.hmcts.net/service-request-update

xui-webapp:
enabled: true
nodejs:
Expand Down
Loading

0 comments on commit bd8e4a2

Please sign in to comment.