]> git.somenet.org - pub/jan/aic18.git/blob - sentiment-analysis/camunda-deploy.sh
maybe form is used
[pub/jan/aic18.git] / sentiment-analysis / 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_path="./src/main/resources/"
7 file_name="sentiment-analysis.bpmn"
8
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"
14 done
15
16 # deploy new verson
17 curl -i "${camunda_deployment}/create" -H "Expect:" -F "deployment-name=${deployment_name}" -F "${file_name}=@${file_path}${file_name}"