]> git.somenet.org - pub/jan/aic18.git/blob - camunda-deploy.sh
Use one of my bots for this course. :)
[pub/jan/aic18.git] / camunda-deploy.sh
1 #!/bin/sh
2
3 camunda="http://localhost:8080"
4 camunda_deployment="${camunda}/engine-rest/deployment"
5 deployment_name="Sentiment Analysis"
6 file_name="sentiment_analysis.bpmn"
7
8 # find old deployments named ${deployment_name}
9 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')"`
10 # delete all old deployments
11 for old_id in ${old_ids}; do
12         curl -s -X DELETE "${camunda_deployment}/${old_id}?cascade=true"
13 done
14
15 # deploy new verson
16 curl -i "${camunda_deployment}/create" -H "Expect:" -F "deployment-name=${deployment_name}" -F "${file_name}=@${file_name}"