Shubham, Ankit | Add. Properties of manifest to be mandatory

This commit is contained in:
Kuamr Shubham
2020-03-10 16:18:44 +05:30
parent 0e6f5f2562
commit 70fe6eb130
4 changed files with 140 additions and 1 deletions

View File

@@ -17,5 +17,6 @@
"labels": {
"$ref": "file:/Users/kumarshubham/Downloads/Deployment-Portal/src/main/java/com/DeploymentPortal/api/Manifest/schema/labels.json"
}
}
},
"required": ["version","team"]
}

View File

@@ -164,4 +164,22 @@ public class SchemaTest {
assertTrue(validationUtils.isJsonValid(schemaFile, jsonFile));
}
@Test
void expectFalseWhenVersionFromDeploymentManifestIsMissing() throws IOException, ProcessingException {
File schemaFile = new File(schemaPath + "manifest.json");
File jsonFile = new File(testData + "invalidManifestData.json");
ValidationUtils validationUtils = new ValidationUtils();
assertFalse(validationUtils.isJsonValid(schemaFile, jsonFile));
}
@Test
void expectFalseWhenFewPropertiesFromDeploymentManifestAreMissing() throws IOException, ProcessingException {
File schemaFile = new File(schemaPath + "manifest.json");
File jsonFile = new File(testData + "manifestDataWithMissingTeam.json");
ValidationUtils validationUtils = new ValidationUtils();
assertFalse(validationUtils.isJsonValid(schemaFile, jsonFile));
}
}

View File

@@ -0,0 +1,61 @@
{
"deployment": {
"cluster": "nonprod.np.navi-tech.in",
"name": "spring-boot-demo",
"timeout": 600,
"instance": {
"count": 1,
"cpu": 0.25,
"memory": "300Mi"
},
"environmentVariables": [
{
"name": "DATASOURCE_URL",
"value": 2456
}
],
"loadBalancer": [
{
"type": "elb",
"accessPolicies": ["internetFacing", "internal"],
"endpoint": "dev-spring-boot-demo-service.np.navi-tech.in"
}
],
"exposedPorts": [
{
"name": "metrics",
"port": 4001
},
{
"name": "serviceport",
"port": 8080
}
],
"namespace": "dev",
"healthChecks": {
"livenessCheck": {
"type": "tcp",
"port": "metrics",
"successThreshold": 1,
"initialDelaySeconds": 120,
"periodSeconds": 15,
"failureThreshold": 5
},
"readinessCheck": {
"type": "http",
"port": "metrics",
"path": "/actuator/health",
"successThreshold": 1,
"initialDelaySeconds": 120,
"periodSeconds": 15,
"failureThreshold": 5
}
}
},
"team": {
"name": "Accounting"
},
"labels": {
"micrometer-prometheus": "enabled"
}
}

View File

@@ -0,0 +1,59 @@
{
"version": "v1",
"deployment": {
"cluster": "nonprod.np.navi-tech.in",
"name": "spring-boot-demo",
"timeout": 600,
"instance": {
"count": 1,
"cpu": 0.25,
"memory": "300Mi"
},
"environmentVariables": [
{
"name": "DATASOURCE_URL",
"value": 2456
}
],
"loadBalancer": [
{
"type": "elb",
"accessPolicies": ["internetFacing", "internal"],
"endpoint": "dev-spring-boot-demo-service.np.navi-tech.in"
}
],
"exposedPorts": [
{
"name": "metrics",
"port": 4001
},
{
"name": "serviceport",
"port": 8080
}
],
"namespace": "dev",
"healthChecks": {
"livenessCheck": {
"type": "tcp",
"port": "metrics",
"successThreshold": 1,
"initialDelaySeconds": 120,
"periodSeconds": 15,
"failureThreshold": 5
},
"readinessCheck": {
"type": "http",
"port": "metrics",
"path": "/actuator/health",
"successThreshold": 1,
"initialDelaySeconds": 120,
"periodSeconds": 15,
"failureThreshold": 5
}
}
},
"labels": {
"micrometer-prometheus": "enabled"
}
}