Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Commit

Permalink
Revert to 99c2e52
Browse files Browse the repository at this point in the history
  • Loading branch information
dharmendrak committed May 17, 2021
1 parent 4b74db0 commit d96633f
Show file tree
Hide file tree
Showing 90 changed files with 748 additions and 724 deletions.
49 changes: 33 additions & 16 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import uk.gov.hmcts.contino.AppPipelineConfig

def type = "java"
def product = "civil"
def product = "civil-damages"
def component = "ccd"
AppPipelineConfig pipelineConf

Expand All @@ -26,8 +26,8 @@ def secrets = [
secret('ccd-api-gateway-oauth2-client-secret', 'CCD_API_GATEWAY_IDAM_CLIENT_SECRET'),
secret('postcode-info-address-lookup-token', 'ADDRESS_LOOKUP_TOKEN')
],
'civil-${env}': [
secret('microservicekey-civil-service', 'S2S_SECRET'),
'unspec-${env}': [
secret('microservicekey-unspec-service', 'S2S_SECRET'),
secret('ccd-importer-username', 'CCD_CONFIGURER_IMPORTER_USERNAME'),
secret('ccd-importer-password', 'CCD_CONFIGURER_IMPORTER_PASSWORD')
]
Expand All @@ -45,13 +45,13 @@ def archiveCoreCaseDataDefinitions(env) {
}

dir("${WORKSPACE}/build") {
steps.archiveArtifacts artifacts: "ccd-release-config/civil-ccd-${env}.xlsx"
steps.archiveArtifacts artifacts: "ccd-release-config/civil-damages-ccd-${env}.xlsx"
}
}

def uploadCoreCaseDataDefinitions(env) {
dir("${WORKSPACE}/bin"){
ccdDefinitionFilePath="${WORKSPACE}/build/ccd-release-config/civil-ccd-${env}.xlsx"
ccdDefinitionFilePath="${WORKSPACE}/build/ccd-release-config/civil-damages-ccd-${env}.xlsx"
sh """
eval \$(./variables/load-${env}-environment-variables.sh)
${WORKSPACE}/bin/utils/ccd-import-definition.sh ${ccdDefinitionFilePath}
Expand All @@ -63,7 +63,7 @@ withPipeline(type, product, component) {
pipelineConf = config
disableLegacyDeployment()
enableAksStagingDeployment()
enableSlackNotifications('#civil_notifications')
enableSlackNotifications('#unspec_notification')

onPR {
loadVaultSecrets(secrets)
Expand All @@ -76,6 +76,23 @@ withPipeline(type, product, component) {
}

after('checkout') {
onMaster {
withCredentials([usernamePassword(credentialsId: 'jenkins-github-hmcts-api-token', usernameVariable: 'USERNAME', passwordVariable: 'BEARER_TOKEN')]) {
try {
sh '''
set -e
git remote set-url origin $(git config remote.origin.url | sed "s/github.com/${BEARER_TOKEN}@github.com/g")
git fetch origin demo:demo
git push --force origin HEAD:demo
'''
} catch (err) {
notifyBuildEvent channel: '#unspec_notification', color: 'warning', message: 'civil-damages-ccd-definition: failed to update demo branch'
}
}
}

onDemo {
def subscription = 'nonprod'
withSubscription(subscription) {
Expand All @@ -92,11 +109,11 @@ withPipeline(type, product, component) {
eval \$(./bin/variables/load-preview-environment-variables.sh ${CHANGE_ID})
./bin/add-roles.sh
./bin/import-ccd-definition.sh
./bin/pull-latest-release-asset.sh civil-camunda-bpmn-definition civil-camunda-bpmn-definition.zip
./bin/pull-latest-release-asset.sh civil-damages-camunda-bpmn-definition civil-damages-camunda-bpmn-definition.zip
./bin/import-bpmn-diagram.sh .
"""
env.URL="https://xui-civil-ccd-pr-${CHANGE_ID}.service.core-compute-preview.internal"
env.CIVIL_SERVICE_URL="http://civil-ccd-pr-${CHANGE_ID}.service.core-compute-preview.internal"
env.URL="https://xui-civil-damages-ccd-pr-${CHANGE_ID}.service.core-compute-preview.internal"
env.UNSPEC_SERVICE_URL="http://civil-damages-ccd-pr-${CHANGE_ID}.service.core-compute-preview.internal"
}

after('smoketest:preview') {
Expand All @@ -106,9 +123,9 @@ withPipeline(type, product, component) {
before('functionalTest:preview') {
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 = "http://ccd-data-store-api-civil-ccd-pr-${CHANGE_ID}.service.core-compute-preview.internal"
env.CCD_DATA_STORE_URL = "http://ccd-data-store-api-civil-damages-ccd-pr-${CHANGE_ID}.service.core-compute-preview.internal"
env.DM_STORE_URL = "http://dm-store-aat.service.core-compute-aat.internal"
env.CIVIL_SERVICE_URL="http://civil-ccd-pr-${CHANGE_ID}.service.core-compute-preview.internal"
env.UNSPEC_SERVICE_URL="http://civil-damages-ccd-pr-${CHANGE_ID}.service.core-compute-preview.internal"
}

after('functionalTest:preview') {
Expand All @@ -120,11 +137,11 @@ withPipeline(type, product, component) {
eval \$(./bin/variables/load-staging-environment-variables.sh)
./bin/add-roles.sh
./bin/import-ccd-definition.sh
./bin/pull-latest-release-asset.sh civil-camunda-bpmn-definition civil-camunda-bpmn-definition.zip
./bin/pull-latest-release-asset.sh civil-damages-camunda-bpmn-definition civil-damages-camunda-bpmn-definition.zip
./bin/import-bpmn-diagram.sh .
"""
env.URL="https://civil-ccd-xui-staging.aat.platform.hmcts.net"
env.CIVIL_SERVICE_URL="http://civil-ccd-staging.service.core-compute-aat.internal"
env.URL="https://civil-damages-ccd-xui-staging.aat.platform.hmcts.net"
env.UNSPEC_SERVICE_URL="http://civil-damages-ccd-staging.service.core-compute-aat.internal"
archiveCoreCaseDataDefinitions('staging')
uploadCoreCaseDataDefinitions('staging')
}
Expand All @@ -136,9 +153,9 @@ withPipeline(type, product, component) {
before('functionalTest:aat') {
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 = "http://civil-ccd-data-store-staging-aat.service.core-compute-aat.internal"
env.CCD_DATA_STORE_URL = "http://civil-damages-ccd-data-store-staging-aat.service.core-compute-aat.internal"
env.DM_STORE_URL = "http://dm-store-aat.service.core-compute-aat.internal"
env.CIVIL_SERVICE_URL="http://civil-ccd-staging.service.core-compute-aat.internal"
env.UNSPEC_SERVICE_URL="http://civil-damages-ccd-staging.service.core-compute-aat.internal"
}

after('functionalTest:aat') {
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# civil-ccd-definition
# civil-damages-ccd-definition

Civil CCD Definition and E2E tests
Civil Damages CCD Definition and E2E tests

### Contents:
- [Building and deploying application](#building-and-deploying-the-application)
Expand All @@ -10,11 +10,11 @@ Civil CCD Definition and E2E tests

### Dependencies

The project is dependent on other Civil repositories:
- [civil-service](https://github.com/hmcts/civil-service)
- [civil-camunda-bpmn-definition](https://github.com/hmcts/civil-camunda-bpmn-definition)
The project is dependent on other Civil Damages repositories:
- [civil-damages-service](https://github.com/hmcts/civil-damages-service)
- [civil-damages-camunda-bpmn-definition](https://github.com/hmcts/civil-damages-camunda-bpmn-definition)

To set up complete local environment for Civil check [civil-sdk](https://github.com/hmcts/civil-sdk)
To set up complete local environment for Civil Damages check [civil-damages-sdk](https://github.com/hmcts/civil-damages-sdk)

### Preview environment

Expand All @@ -23,10 +23,10 @@ Camunda BPMN definitions will be pulled from the latest GitHub release.
Service instance will be running the latest image version deployed to ACR.

To access XUI visit url (make sure that it starts with `https`, otherwise IDAM won't let you log in):
- `https://xui-civil-ccd-pr-PR_NUMBER.service.core-compute-preview.internal`
- `https://xui-civil-damages-ccd-pr-PR_NUMBER.service.core-compute-preview.internal`

To access Camunda visit url (login and password are both `admin`):
- `https://camunda-civil-ccd-pr-PR_NUMBER.service.core-compute-preview.internal`
- `https://camunda-civil-damages-ccd-pr-PR_NUMBER.service.core-compute-preview.internal`

## Testing
The repo uses codeceptjs framework for e2e tests.
Expand Down
10 changes: 5 additions & 5 deletions audit.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"100001_Unexpected Content-Type was returned_http://civil-service-aat.service.core-compute-aat.internal/_GET": "ignore",
"100000_A Client Error response code was returned by the server_http://civil-service-aat.service.core-compute-aat.internal/cases/callbacks/version/version/callback-type_POST": "ignore",
"100000_A Client Error response code was returned by the server_http://civil-service-aat.service.core-compute-aat.internal/cases/callbacks/version/version/callback-type/page-id_POST": "ignore",
"100000_A Client Error response code was returned by the server_http://civil-service-aat.service.core-compute-aat.internal/cases/callbacks/callback-type_POST": "ignore",
"100000_A Client Error response code was returned by the server_http://civil-service-aat.service.core-compute-aat.internal/cases/callbacks/callback-type/page-id_POST": "ignore"
"100001_Unexpected Content-Type was returned_http://unspec-service-aat.service.core-compute-aat.internal/_GET": "ignore",
"100000_A Client Error response code was returned by the server_http://unspec-service-aat.service.core-compute-aat.internal/cases/callbacks/version/version/callback-type_POST": "ignore",
"100000_A Client Error response code was returned by the server_http://unspec-service-aat.service.core-compute-aat.internal/cases/callbacks/version/version/callback-type/page-id_POST": "ignore",
"100000_A Client Error response code was returned by the server_http://unspec-service-aat.service.core-compute-aat.internal/cases/callbacks/callback-type_POST": "ignore",
"100000_A Client Error response code was returned by the server_http://unspec-service-aat.service.core-compute-aat.internal/cases/callbacks/callback-type/page-id_POST": "ignore"
}
2 changes: 1 addition & 1 deletion bin/build-release-ccd-definition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi
root_dir=$(realpath $(dirname ${0})/..)
config_dir=${root_dir}/ccd-definition
build_dir=${root_dir}/build/ccd-release-config
release_definition_output_file=${build_dir}/civil-ccd-${environment}.xlsx
release_definition_output_file=${build_dir}/civil-damages-ccd-${environment}.xlsx

mkdir -p ${build_dir}

Expand Down
20 changes: 10 additions & 10 deletions bin/create-github-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ if [ -z "$BUILD_URL" ]; then
exit 1
fi

zip -r civil-ccd-definition.zip ccd-definition
zip -r civil-e2e.zip e2e codecept.conf.js package.json steps.d.ts yarn.lock
cp build/ccd-release-config/civil-ccd-aat.xlsx civil-ccd-aat.xlsx
zip -r civil-damages-ccd-definition.zip ccd-definition
zip -r civil-damages-e2e.zip e2e codecept.conf.js package.json steps.d.ts yarn.lock
cp build/ccd-release-config/civil-damages-ccd-aat.xlsx civil-damages-ccd-aat.xlsx

az login --identity
releaseId=$(createNewRelease civil-ccd-definition)
releaseId=$(createNewRelease civil-damages-ccd-definition)

uploadReleaseAsset civil-ccd-definition $releaseId civil-ccd-definition.zip
uploadReleaseAsset civil-ccd-definition $releaseId civil-e2e.zip
uploadReleaseAsset civil-ccd-definition $releaseId civil-ccd-aat.xlsx
uploadReleaseAsset civil-damages-ccd-definition $releaseId civil-damages-ccd-definition.zip
uploadReleaseAsset civil-damages-ccd-definition $releaseId civil-damages-e2e.zip
uploadReleaseAsset civil-damages-ccd-definition $releaseId civil-damages-ccd-aat.xlsx

rm civil-ccd-definition.zip
rm civil-e2e.zip
rm civil-ccd-aat.xlsx
rm civil-damages-ccd-definition.zip
rm civil-damages-e2e.zip
rm civil-damages-ccd-aat.xlsx
2 changes: 1 addition & 1 deletion bin/import-bpmn-diagram.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -eu
workspace=${1}

serviceToken=$($(realpath $workspace)/bin/utils/idam-lease-service-token.sh civil_service \
serviceToken=$($(realpath $workspace)/bin/utils/idam-lease-service-token.sh unspec_service \
$(docker run --rm toolbelt/oathtool --totp -b ${S2S_SECRET:-AABBCCDDEEFFGGHH}))
filepath="$(realpath $workspace)/camunda"

Expand Down
2 changes: 1 addition & 1 deletion bin/import-ccd-definition.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

definition_input_dir=$(realpath 'ccd-definition')
definition_output_file="$(realpath ".")/build/ccd-development-config/ccd-civil-dev.xlsx"
definition_output_file="$(realpath ".")/build/ccd-development-config/ccd-unspec-dev.xlsx"
params="$@"

./bin/utils/import-ccd-definition.sh "${definition_input_dir}" "${definition_output_file}" "${params}"
2 changes: 1 addition & 1 deletion bin/variables/load-aat-environment-variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ echo "export CCD_IDAM_REDIRECT_URL=https://ccd-case-management-web-aat.service.c
echo "export CCD_DEFINITION_STORE_API_BASE_URL=http://ccd-definition-store-api-aat.service.core-compute-aat.internal"

# definition placeholders
echo "export CCD_DEF_CASE_SERVICE_BASE_URL=http://civil-service-aat.service.core-compute-aat.internal"
echo "export CCD_DEF_CASE_SERVICE_BASE_URL=http://civil-damages-service-aat.service.core-compute-aat.internal"
2 changes: 1 addition & 1 deletion bin/variables/load-demo-environment-variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ echo "export CCD_IDAM_REDIRECT_URL=https://www-ccd.demo.platform.hmcts.net/oauth
echo "export CCD_DEFINITION_STORE_API_BASE_URL=http://ccd-definition-store-api-demo.service.core-compute-demo.internal"

# definition placeholders
echo "export CCD_DEF_CASE_SERVICE_BASE_URL=http://civil-service-demo.service.core-compute-demo.internal"
echo "export CCD_DEF_CASE_SERVICE_BASE_URL=http://civil-damages-service-demo.service.core-compute-demo.internal"
6 changes: 3 additions & 3 deletions bin/variables/load-preview-environment-variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ echo 'export ENVIRONMENT=preview'
echo "export SERVICE_AUTH_PROVIDER_API_BASE_URL=http://rpe-service-auth-provider-aat.service.core-compute-aat.internal"
echo "export IDAM_API_BASE_URL=https://idam-api.aat.platform.hmcts.net"
echo "export CCD_IDAM_REDIRECT_URL=https://ccd-case-management-web-aat.service.core-compute-aat.internal/oauth2redirect"
echo "export CCD_DEFINITION_STORE_API_BASE_URL=https://ccd-definition-store-civil-ccd-pr-${pr}.service.core-compute-preview.internal"
echo "export CAMUNDA_BASE_URL=https://camunda-civil-ccd-pr-${pr}.service.core-compute-preview.internal"
echo "export CCD_DEFINITION_STORE_API_BASE_URL=https://ccd-definition-store-civil-damages-ccd-pr-${pr}.service.core-compute-preview.internal"
echo "export CAMUNDA_BASE_URL=https://camunda-civil-damages-ccd-pr-${pr}.service.core-compute-preview.internal"

# definition placeholders
echo "export CCD_DEF_CASE_SERVICE_BASE_URL=http://civil-ccd-pr-${pr}.service.core-compute-preview.internal"
echo "export CCD_DEF_CASE_SERVICE_BASE_URL=http://civil-damages-ccd-pr-${pr}.service.core-compute-preview.internal"
6 changes: 3 additions & 3 deletions bin/variables/load-staging-environment-variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ echo 'export ENVIRONMENT=aat'
echo "export SERVICE_AUTH_PROVIDER_API_BASE_URL=http://rpe-service-auth-provider-aat.service.core-compute-aat.internal"
echo "export IDAM_API_BASE_URL=https://idam-api.aat.platform.hmcts.net"
echo "export CCD_IDAM_REDIRECT_URL=https://ccd-case-management-web-aat.service.core-compute-aat.internal/oauth2redirect"
echo "export CCD_DEFINITION_STORE_API_BASE_URL=http://civil-ccd-definition-store-staging-aat.service.core-compute-aat.internal"
echo "export CAMUNDA_BASE_URL=http://civil-ccd-camunda-staging-aat.service.core-compute-aat.internal"
echo "export CCD_DEFINITION_STORE_API_BASE_URL=http://civil-damages-ccd-definition-store-staging-aat.service.core-compute-aat.internal"
echo "export CAMUNDA_BASE_URL=http://civil-damages-ccd-camunda-staging-aat.service.core-compute-aat.internal"

# definition placeholders
echo "export CCD_DEF_CASE_SERVICE_BASE_URL=http://civil-ccd-staging.service.core-compute-aat.internal"
echo "export CCD_DEF_CASE_SERVICE_BASE_URL=http://civil-damages-ccd-staging.service.core-compute-aat.internal"
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ task lintUserInterfaceTests(type: Exec, description: 'Runs linting of E2E tests.

task awaitApplicationReadiness(type: Exec, description: 'Awaits until application is ready.') {
commandLine './bin/wait-for.sh', System.env.URL
commandLine './bin/wait-for.sh', System.env.CIVIL_SERVICE_URL
commandLine './bin/wait-for.sh', System.env.UNSPEC_SERVICE_URL
}

task runSmokeTests(type: Exec, description: 'Runs smoke tests.') {
Expand Down Expand Up @@ -190,8 +190,8 @@ project.tasks['sonarqube'].dependsOn test, jacocoTestReport

sonarqube {
properties {
property "sonar.projectName", "CIVIL :: ccd-definition"
property "sonar.projectKey", "civil-ccd-definition"
property "sonar.projectName", "UNSPEC :: civil-damages-camunda-bpmn-definition"
property "sonar.projectKey", "civil-damages-camunda-bpmn-definition"
property "sonar.coverage.jacoco.xmlReportPaths", "${jacocoTestReport.reports.xml.destination.path}"
property "sonar.host.url", "https://sonar.reform.hmcts.net/"
}
Expand Down Expand Up @@ -315,7 +315,7 @@ dependencies {
smokeTestImplementation sourceSets.main.runtimeClasspath
}

mainClassName = 'uk.gov.hmcts.reform.civil.Application'
mainClassName = 'uk.gov.hmcts.reform.unspec.Application'

bootJar {
getArchiveFileName().set(provider {
Expand Down Expand Up @@ -343,7 +343,7 @@ pact {
tags = [System.getenv("PACT_BRANCH_NAME") ?: getCheckedOutGitCommitHash(), 'latest']
version = project.pactVersion
if(pactBrokerUrl != 'https://pact-broker.platform.hmcts.net/'){
excludes = ['civil_service-Idam_api']
excludes = ['unspec_service-Idam_api']
}
}
}
Expand Down
Loading

0 comments on commit d96633f

Please sign in to comment.