From e024d772b34fc180f57f64d2aa8dc4aeb87745de Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Sat, 3 Nov 2018 16:24:14 +0100 Subject: [PATCH] modularize, documentation --- camunda-deploy.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/camunda-deploy.sh b/camunda-deploy.sh index a548c0f..9c686bc 100755 --- a/camunda-deploy.sh +++ b/camunda-deploy.sh @@ -1,11 +1,16 @@ #!/bin/sh camunda="http://localhost:8080" -camunda="http://127.0.0.1:8080" camunda_deployment="${camunda}/engine-rest/deployment" +deployment_name="Sentiment Analysis" +file_name="sentiment_analysis.bpmn" -old_ids=`curl -s ${camunda_deployment}/ | python3 -c "import sys, json; doc = json.load(sys.stdin); items = [x['id'] for x in doc if x['name'] == 'Sentiment Analysis']; print (*items, sep = '\n')"` +# find old deployments named ${deployment_name} +old_ids=`curl -s ${camunda_deployment}/ | python3 -c "import sys, json; doc = json.load(sys.stdin); items = [deployment['id'] for deployment in doc if deployment['name'] == '${deployment_name}']; print (*items, sep = '\n')"` +# delete all old deployments for old_id in ${old_ids}; do curl -s -X DELETE "${camunda_deployment}/${old_id}?cascade=true" done -curl -i "${camunda_deployment}/create" -H "Expect:" -F "deployment-name=Sentiment Analysis" -F "sentiment_analysis.bpmn=@sentiment_analysis.bpmn" + +# deploy new verson +curl -i "${camunda_deployment}/create" -H "Expect:" -F "deployment-name=${deployment_name}" -F "${file_name}=@${file_name}" -- 2.43.0