]> git.somenet.org - pub/jan/aic18.git/blob - camunda-overlay/camunda-deploy.sh
Merge branch '19-make-docker-port-consistency' into 'master'
[pub/jan/aic18.git] / camunda-overlay / 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
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"
12 done
13
14 # deploy new verson
15 curl -i "${camunda_deployment}/create" \
16          -H "Expect:" \
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"