-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
42 lines (32 loc) · 796 Bytes
/
entrypoint.sh
File metadata and controls
42 lines (32 loc) · 796 Bytes
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
42
#!/bin/sh
set -e
echo "Executing entrypoint"
if [ -z "$PLUGIN_USERNAME" ]; then
echo "username not set!";
exit 1;
fi
if [ -z "$PLUGIN_PASSWORD" ]; then
echo "password not set!";
exit 1;
fi
if [ -z "$PLUGIN_HOST" ]; then
echo "host not set!";
exit 1;
fi
if [ -z "$PLUGIN_PROJECT_ORGANIZATION" ]; then
echo "project_organization not set!";
exit 1;
fi
if [ -z "$PLUGIN_PROJECT_NAME" ]; then
echo "project_name not set!";
exit 1;
fi
sleep 5
response=$(curl -s -u $PLUGIN_USERNAME:$PLUGIN_PASSWORD $PLUGIN_HOST/api/qualitygates/project_status?projectKey=$PLUGIN_PROJECT_ORGANIZATION:$PLUGIN_PROJECT_NAME | jq '.projectStatus.status')
case "$response" in
*ERROR*)
echo "Quality gate not passed";
exit 1;
;;
esac
echo "Quality gate passed !";