From b7d3d1f2e7908508a9472b02c812b9990c270c84 Mon Sep 17 00:00:00 2001 From: Marc Johnson Date: Tue, 25 Jul 2017 12:31:56 +0100 Subject: [PATCH] Introduce version number in id property in module descriptor --- DeploymentDescriptor.json | 2 +- ModuleDescriptor.json | 2 +- NEWS.md | 1 + activate-circulation-storage.json | 3 --- activate-inventory-storage.json | 3 --- activate.json | 3 +++ registration/activate.json | 2 +- stop-managed-demo.sh | 2 +- test-storage.sh | 20 ++++++++++++++------ test-via-okapi.sh | 22 +++++++++++++++------- 10 files changed, 37 insertions(+), 23 deletions(-) delete mode 100644 activate-circulation-storage.json delete mode 100644 activate-inventory-storage.json create mode 100644 activate.json diff --git a/DeploymentDescriptor.json b/DeploymentDescriptor.json index 6360f2ac4d..70f32db1ef 100644 --- a/DeploymentDescriptor.json +++ b/DeploymentDescriptor.json @@ -1,5 +1,5 @@ { - "srvcId" : "circulation", + "srvcId" : "circulation-4.1.0-SNAPSHOT", "descriptor" : { "exec" : "java -Dport=%p -jar ../mod-circulation/build/libs/mod-circulation.jar" } diff --git a/ModuleDescriptor.json b/ModuleDescriptor.json index 6030789403..3ec3729c71 100644 --- a/ModuleDescriptor.json +++ b/ModuleDescriptor.json @@ -1,5 +1,5 @@ { - "id": "circulation", + "id": "circulation-4.1.0-SNAPSHOT", "name": "Circulation Module", "provides": [ { diff --git a/NEWS.md b/NEWS.md index 3729f64a7e..da0d6b1d0c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ * Adds property `dueDate` to loan * Provides circulation interface version 2.1 * Requires loan-storage interface version 3.1 +* Include implementation version in `id` in Module Descriptor ## 4.0.0 2017-07-17 diff --git a/activate-circulation-storage.json b/activate-circulation-storage.json deleted file mode 100644 index 6d0ffa358a..0000000000 --- a/activate-circulation-storage.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "id": "circulation-storage" -} diff --git a/activate-inventory-storage.json b/activate-inventory-storage.json deleted file mode 100644 index a1a1d98c14..0000000000 --- a/activate-inventory-storage.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "id": "inventory-storage" -} diff --git a/activate.json b/activate.json new file mode 100644 index 0000000000..2f8ba4ba39 --- /dev/null +++ b/activate.json @@ -0,0 +1,3 @@ +{ + "id": "moduleidhere" +} diff --git a/registration/activate.json b/registration/activate.json index 16f66cc43c..caaaa65367 100644 --- a/registration/activate.json +++ b/registration/activate.json @@ -1,3 +1,3 @@ { - "id": "circulation" + "id": "circulation-4.1.0-SNAPSHOT" } diff --git a/stop-managed-demo.sh b/stop-managed-demo.sh index a7234a8bf1..888972f0d4 100755 --- a/stop-managed-demo.sh +++ b/stop-managed-demo.sh @@ -4,7 +4,7 @@ instance_id=${1:-} okapi_proxy_address=${2:-http://localhost:9130} tenant_id="demo_tenant" -module_id="circulation" +module_id="circulation-4.1.0-SNAPSHOT" ./okapi-registration/managed-deployment/unregister.sh \ ${module_id} \ diff --git a/test-storage.sh b/test-storage.sh index d1d1d2c61a..7a97e39ee2 100755 --- a/test-storage.sh +++ b/test-storage.sh @@ -3,6 +3,12 @@ okapi_proxy_address="http://localhost:9130" tenant_id="test_tenant" +#Needs to be the specific version of Inventory Storage you want to use for testing +inventory_storage_module_id="inventory-storage-5.1.1-SNAPSHOT" + +#Needs to be the specific version of Circulation Storage you want to use for testing +circulation_storage_module_id="circulation-storage-3.1.0-SNAPSHOT" + echo "Check if Okapi is contactable" curl -w '\n' -X GET -D - \ "${okapi_proxy_address}/_/env" || exit 1 @@ -10,8 +16,9 @@ curl -w '\n' -X GET -D - \ echo "Create ${tenant_id} tenant" ./create-tenant.sh ${tenant_id} -echo "Activate loan storage for ${tenant_id}" -activate_circulation_storage_json=$(cat ./activate-circulation-storage.json) +echo "Activate circulation storage for ${tenant_id}" +activate_circulation_storage_json=$(cat ./activate.json) +activate_circulation_storage_json="${activate_circulation_storage_json/moduleidhere/$circulation_storage_module_id}" curl -w '\n' -X POST -D - \ -H "Content-type: application/json" \ @@ -19,7 +26,8 @@ curl -w '\n' -X POST -D - \ "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules" echo "Activate inventory storage for ${tenant_id}" -activate_inventory_storage_json=$(cat ./activate-inventory-storage.json) +activate_inventory_storage_json=$(cat ./activate.json) +activate_inventory_storage_json="${activate_inventory_storage_json/moduleidhere/$inventory_storage_module_id}" curl -w '\n' -X POST -D - \ -H "Content-type: application/json" \ @@ -31,11 +39,11 @@ gradle clean cleanTest testStorageViaOkapi test_results=$? -echo "Deactivate loan storage for ${tenant_id}" -curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/circulation-storage" +echo "Deactivate circulation storage for ${tenant_id}" +curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/${circulation_storage_module_id}" echo "Deactivate inventory storage for ${tenant_id}" -curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/inventory-storage" +curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/${inventory_storage_module_id}" echo "Deleting ${tenant_id}" ./delete-tenant.sh ${tenant_id} diff --git a/test-via-okapi.sh b/test-via-okapi.sh index 540ae10d13..bd883a555b 100755 --- a/test-via-okapi.sh +++ b/test-via-okapi.sh @@ -4,7 +4,13 @@ okapi_proxy_address="http://localhost:9130" tenant_id="test_tenant" circulation_direct_address=http://localhost:9605 circulation_instance_id=localhost-9605 -circulation_module_id=circulation +circulation_module_id="circulation-4.1.0-SNAPSHOT" + +#Needs to be the specific version of Inventory Storage you want to use for testing +inventory_storage_module_id="inventory-storage-5.1.1-SNAPSHOT" + +#Needs to be the specific version of Circulation Storage you want to use for testing +circulation_storage_module_id="circulation-storage-3.1.0-SNAPSHOT" echo "Check if Okapi is contactable" curl -w '\n' -X GET -D - \ @@ -13,8 +19,9 @@ curl -w '\n' -X GET -D - \ echo "Create ${tenant_id} tenant" ./create-tenant.sh ${tenant_id} -echo "Activate loan storage for ${tenant_id}" -activate_circulation_storage_json=$(cat ./activate-circulation-storage.json) +echo "Activate circulation storage for ${tenant_id}" +activate_circulation_storage_json=$(cat ./activate.json) +activate_circulation_storage_json="${activate_circulation_storage_json/moduleidhere/$circulation_storage_module_id}" curl -w '\n' -X POST -D - \ -H "Content-type: application/json" \ @@ -22,7 +29,8 @@ curl -w '\n' -X POST -D - \ "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules" echo "Activate inventory storage for ${tenant_id}" -activate_inventory_storage_json=$(cat ./activate-inventory-storage.json) +activate_inventory_storage_json=$(cat ./activate.json) +activate_inventory_storage_json="${activate_inventory_storage_json/moduleidhere/$inventory_storage_module_id}" curl -w '\n' -X POST -D - \ -H "Content-type: application/json" \ @@ -50,11 +58,11 @@ echo "Unregister circulation module" ${circulation_module_id} \ ${tenant_id} -echo "Deactivate loan storage for ${tenant_id}" -curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/circulation-storage" +echo "Deactivate circulation storage for ${tenant_id}" +curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/${circulation_storage_module_id}" echo "Deactivate inventory storage for ${tenant_id}" -curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/inventory-storage" +curl -X DELETE -D - -w '\n' "${okapi_proxy_address}/_/proxy/tenants/${tenant_id}/modules/${inventory_storage_module_id}" echo "Deleting ${tenant_id}" ./delete-tenant.sh ${tenant_id}