3 camunda="http://localhost:8080"
4 camunda_deployment="${camunda}/engine-rest/deployment"
5 deployment_name="Sentiment Analysis"
7 # find old deployments named ${deployment_name}
8 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')"`
9 # delete all old deployments
10 for old_id in ${old_ids}; do
11 curl -s -X DELETE "${camunda_deployment}/${old_id}?cascade=true"
15 curl -i "${camunda_deployment}/create" \
17 -F "deployment-name=${deployment_name}" \
18 -F "sentiment-analysis.bpmn=@sentiment-analysis.bpmn" \
19 -F "input-forms.html=@forms/input-terms.html" \
20 -F "download-pdf.html=@forms/download-pdf.html"