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