TAMULib / mod-camunda

Apache License 2.0
0 stars 0 forks source link

Issue 219: Make changes needed to successfully register deploy module. #235

Closed kaladay closed 8 months ago

kaladay commented 8 months ago

resolves #219

Changes

Prepend 'workflow.' to each permission.

Remove mod-workflow from the context path. Having mod-workflow 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-camunda, 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 target/.
  5. A POST request to {{okapi_url}}/_/discovery/modules. Rather than using the DeploymentDescriptor.json generally found under target/, use the following as the payload body.
    {
    "srvcId": "mod-camunda-{{mod_camunda_version}}",
    "instId": "mod-camunda-{{mod_camunda_version}}",
    "url": "{{mod_camunda_url}}"
    }

    The {{mod_camunda_url}} in particular needs to point to an address of the locally running mod-camunda 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-camunda-{{mod_camunda_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-camunda-{{mod_camunda_version}}.

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