TAMULib / mod-workflow

Apache License 2.0
0 stars 0 forks source link

Issue 113: Make changes needed to successfully register deploy module. #123

Closed kaladay closed 10 months ago

kaladay commented 10 months ago

resolves #113

Changes

Prepend 'camunda.' to each permission.

The provides dependencies are for individual module parts and not the entire module. Change the behavior to use the individual mod-workflow parts as a dependency.

Remove mod-camunda from the context path. Having mod-camunda in the context path is preventing proper deployment in OKAPI.

Local Deployment Test Process

This assumes proper login and other relating configuration. This uses {{}} syntax to loosely represent variables. Consider using the stripes-cli to perform the appropriate tasks.

  1. Make sure to start up a local docker or vagrant version of folio, like the FOLIO Nolana vagrant. For example, the OKAPI login using stripes-cli might look like this:
    stripes okapi login diku_admin --okapi http://127.0.0.1:9130 --tenant diku
  2. Perform the appropriate maven packaging of the project.
  3. Spin up a local instance of mod-workflow, such as mvn spring-boot:run, java -jar ..., or an appropriate docker command.
  4. A POST request to {{okapi_url}}/_/proxy/modules in order to register the module. Make sure to use the build ModuleDescriptor.json as the payload body, generally found under service/target/.
  5. A POST request to {{okapi_url}}/_/discovery/modules. Rather than using the DeploymentDescriptor.json generally found under service/target/, use the following as the payload body.
    {
    "srvcId": "mod-workflow-{{mod_workflow_version}}",
    "instId": "mod-workflow-{{mod_workflow_version}}",
    "url": "{{mod_workflow_url}}"
    }

    The {{mod_workflow_url}} in particular needs to point to an address of the locally running mod-workflow that the local FOLIO instance can access.

  6. A POST request to {{okapi_url}}/_/proxy/tenants/{{tenant_name}}/modules, using the following as the body payload:
    {
    "id": "mod-workflow-{{mod_workflow_version}}"
    }

There may be permissions problems, in which case, they could be resolved using the stripes-cli. Example:

echo "okapi.proxy.modules.post" | stripes perm assign --okapi http://127.0.0.1:9130 --user diku_admin --tenant diku

To disable the module, a DELETE to {{okapi_url}}/_/proxy/tenants/{{tenant_name}}/modules/mod-workflow-{{mod_workflow_version}}.

To undeploy the module, a DELETE to {{okapi_url}}/_/discovery/modules/mod-workflow-{{mod_workflow_version}}.