Skip to content

Commit

Permalink
Feature/conditional resource configuration (#94)
Browse files Browse the repository at this point in the history
### Adding conditionals to sql statements to handle dynamic hpds resource registration
* Added conditionals to sql statement to render insertion records for auth and open hpds
* No new variables generated. Reusing the variables that handle whether the project is using open and auth hpds.

---------

Co-authored-by: Tom <[email protected]>
  • Loading branch information
TDeSain and Tom authored Oct 18, 2023
1 parent b5a5f1b commit 584a971
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app-infrastructure/configs/pic-sure-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ CREATE TABLE `resource` (
--
-- Dumping data for table `resource`
--

LOCK TABLES `resource` WRITE;
/*!40000 ALTER TABLE `resource` DISABLE KEYS */;
INSERT INTO `resource` VALUES (0x02E23F52F3544E8B992CD37C8B9BA140,NULL,'http://auth-hpds.${target_stack}.${env_private_dns_name}:8080/PIC-SURE/','Authorized Access HPDS resource','auth-hpds',NULL, NULL, NULL);
INSERT INTO `resource` VALUES (0x70c837be5ffc11ebae930242ac130002,NULL,'http://localhost:8080/pic-sure-aggregate-resource/pic-sure/aggregate-data-sharing','Open Access (aggregate) resource','open-hpds',NULL, NULL, NULL);
${include_auth_hpds ? "INSERT INTO `resource` VALUES (0x02E23F52F3544E8B992CD37C8B9BA140,NULL,'http://auth-hpds.${var.target_stack}.${var.env_private_dns_name}:8080/PIC-SURE/','Authorized Access HPDS resource','auth-hpds',NULL, NULL, NULL);" : ""}
${include_open_hpds ? "INSERT INTO `resource` VALUES (0x70c837be5ffc11ebae930242ac130002,NULL,'http://localhost:8080/pic-sure-aggregate-resource/pic-sure/aggregate-data-sharing','Open Access (aggregate) resource','open-hpds',NULL, NULL, NULL);" : ""}
INSERT INTO `resource` VALUES (0x36363664623161342d386538652d3131,NULL,'http://dictionary.${target_stack}.${env_private_dns_name}:8080/dictionary/pic-sure','Dictionary','dictionary',NULL, NULL, NULL);
INSERT INTO `resource` VALUES (0xCA0AD4A9130A3A8AAE00E35B07F1108B,NULL,'http://localhost:8080/pic-sure-visualization-resource/pic-sure/visualization','Visualization','visualization',NULL, NULL, NULL);
/*!40000 ALTER TABLE `resource` ENABLE KEYS */;
Expand Down
2 changes: 2 additions & 0 deletions app-infrastructure/wildfly-instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ data "template_file" "pic-sure-schema-sql" {
picsure_token_introspection_token = var.picsure_token_introspection_token
target_stack = var.target_stack
env_private_dns_name = var.env_private_dns_name
include_auth_hpds = var.include_auth_hpds
include_open_hpds = var.include_open_hpds
}
}

Expand Down

0 comments on commit 584a971

Please sign in to comment.