0 votes
16 views
ago by (30.6k points)
We want a pipeline (Jenkins / Tekton) that takes a snapshot from Workflow Center on the development cluster and installs it on the test and production Workflow Servers in other clusters. Which APIs exist on the Cloud Pak for that, and what about offline servers?

1 Answer

0 votes
ago by (30.6k points)

The mechanisms are the same as on traditional BAW - online Workflow Servers connected to a Workflow Center, or offline servers fed with installation packages - and all of them are scriptable through the Operations REST API:

  1. Create the snapshot from the track (Workflow Center): the Operations REST create snapshot operation on the container's track, or Studio / the Workflow Center UI; tag the Git commit of your source export with the snapshot name.
  2. Export / archive the snapshot as .twx or as an offline installation package for servers that are not connected: POST /ops/std/bpm/containers/{acronym}/versions/{snapshot}/offline_package?server=<server name> - the package is a zip that the target server installs.
  3. Install on an online server: POST /ops/std/bpm/servers/workflow/{server}/install?container=CLM&version=2.3; on an offline server upload the package: POST /ops/std/bpm/containers/install (multipart file). Both return an asynchronous operation id; poll GET /ops/system/queue/{id} until it finishes.
  4. Configure the new version on the target: copy env vars / EPVs / team bindings from the previous version with the .../sync resources (previous answer), then activate it and make it the default: POST .../versions/{snapshot}/activate and .../default.
  5. Migrate instances if wanted: POST /ops/std/bpm/containers/migrate?container=CLM&source_version=2.2&target_version=2.3, then deactivate / archive the old version once its instance count is zero.
# Tekton / Jenkins step (bash): install package on an offline production Workflow Server and wait
OP=$(curl -sk -X POST "$PROD/ops/std/bpm/containers/install" -H "Authorization: ZenApiKey $KEY" -H "BPMCSRFToken: $TOKEN" \
     -F "file=@CLM-2.3-package.zip" | jq -r .id)
until [ "$(curl -sk "$PROD/ops/system/queue/$OP" -H "Authorization: ZenApiKey $KEY" -H "BPMCSRFToken: $TOKEN" | jq -r .status)" != "running" ]; do sleep 10; done
curl -sk -X POST "$PROD/ops/std/bpm/containers/CLM/versions/2.3/env_vars/sync?source_version=2.2" -H "Authorization: ZenApiKey $KEY" -H "BPMCSRFToken: $TOKEN"
curl -sk -X POST "$PROD/ops/std/bpm/containers/CLM/versions/2.3/activate" -H "Authorization: ZenApiKey $KEY" -H "BPMCSRFToken: $TOKEN" 

The exact paths and parameter names are in the Swagger of your release (GET /ops/docs); the operations listed above exist on 21.0.3+ under the containers and servers groups. Keep the twx exports in Git (question on source control applies) and let the pipeline promote the same package to every environment.

References

Related questions

723 questions

807 answers

98 comments

4.8k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...