forked from oumkale/pipelines_run_1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
purge.sh
41 lines (35 loc) · 1.08 KB
/
purge.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
CUSTOMER=$1
RABBITMQ_ADMIN_USER=$2
RABBITMQ_ADMIN_PASSWORD=$3
RABBITMQ_ADMIN_URL=$4
function showUsage() {
echo "Usage: $0 customer_name"
exit
}
if [ -z "$CUSTOMER" ]; then
echo "Requires Customer"
showUsage
exit 0
fi
if [ -z "$RABBITMQ_ADMIN_USER" ]; then
echo "Requires RABBITMQ_ADMIN_USER"
showUsage
exit 0
fi
if [ -z "$RABBITMQ_ADMIN_PASSWORD" ]; then
echo "Requires RABBITMQ_ADMIN_PASSWORD"
showUsage
exit 0
fi
if [ -z "$RABBITMQ_ADMIN_URL" ]; then
echo "Requires RABBITMQ_ADMIN_URL"
showUsage
exit 0
fi
purge_queue() {
QUEUE_NAME=$1
VHOST_NAME="${CUSTOMER}_pipelinesRoot"
curl -i -u "$RABBITMQ_ADMIN_USER:$RABBITMQ_ADMIN_PASSWORD" -XDELETE "https://$RABBITMQ_ADMIN_URL/api/queues/$VHOST_NAME/$QUEUE_NAME/contents"
}
deletePipelineById for id: 28 returned error: deletePipelineStepById for id: 107 returned error: pipelineSteps.destroy failed for id: 107 returned error: update or delete on table "pipelineSteps" violates foreign key constraint "pipelineSteplets_pipelineStepId_fkey" on table "pipelineSteplets"