Deploying .bpmn via Docker

Hello!

I’ve made some definitions in the modeller and deployed them via the GUI. I’m now looking to distribute my process definitions automatically in a build by dropping them into a folder and starting the Camunda engine

I have Camunda being deployed via Docker (this shouldn’t make a difference, I have access to the main dir (/camunda and /camunda/webapps) and its all working perfectly)

I appreciate there are curl commands to do this but I’d like to build them into the image itself without any need for runtime scripts. I’ve tried to drop them into the webapps folder both in a .war and in a folder, however I’m not familiar with Java and I don’t seem to see the .bpmn files imported when I put them in webapps

Is there a way to do this? Am I just missing something easy in the docs?

What distribution are you using? Springboot? Camunda run?

There is a auto deployment feature that will deploy BPMN/DMNs in the resource folder

It’s the latest tag on Docker Hub. I believe it is TomCat.

The resources folder auto deployment sounds like what I’m after, let me do some googling / doc reading / experimenting.

Can you use Camunda Run?
https://docs.camunda.org/manual/latest/user-guide/camunda-bpm-run/#starting-with-camunda-platform-run

https://docs.camunda.org/manual/latest/user-guide/camunda-bpm-run/#starting-camunda-platform-run-using-docker

Briliant, switched it to the run version, saw the resource folder, dropped the models in there and its working perfectly.

Thanks!

1 Like

Great! Good luck.

#!/bin/bash

# deploy diagrams placed in subdirs

set -e
source ../.env
auth='-u camunda:'$(echo $CAMUNDA_PASSWORD | base64 --decode -w0)

for filename in service/*.bpmn; do
   model=$(cat $filename |grep '  <bpmn:process id="' | cut -d'"' -f 2)
   upload='upload=@"./'$filename'"'
   deployname='deployment-name='$model
   curl -k -H "Content-Type: multipart/form-data" -X POST -F $upload -F $deployname -F 'deploy-changed-only=true' \
      https://localhost:$CLUSTER_GATE_PORT/engine-rest/deployment/create $auth
done