Shubham, Ankit | Add. Properties of manifest to be mandatory
This commit is contained in:
@@ -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"]
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user