-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate.sh
executable file
·33 lines (26 loc) · 992 Bytes
/
update.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
#!/bin/bash
VERSIONEYE_SERVER=https://www.versioneye.com
API_KEY=<YOUR_SECRET_API_KEY> # Get it from here: https://www.versioneye.com/settings/api
PROJECT_ID=<YOUR_PROJECT_ID> # https://www.versioneye.com/user/projects/<PROJECT_ID>
ORGA_NAME=<YOUR_ORGANISATION_NAME>
json=$( curl -F name=project_file -F orga_name=${ORGA_NAME} -F project_file=@$1 "${VERSIONEYE_SERVER}/api/v2/projects/${PROJECT_ID}?api_key=${API_KEY}" )
project_id=$(echo $json | jq '.id' | sed 's/"//g' )
dep_number=$(echo $json | jq '.dep_number')
out_number=$(echo $json | jq '.out_number')
violations=$(echo $json | jq '.licenses_red')
sec_issues=$(echo $json | jq '.sv_count')
echo ""
echo "Project ID: $project_id"
echo "Dependencies: $dep_number"
echo "Outdated: $out_number"
echo "License violations: $violations"
echo "Security vulnerabilities: $sec_issues"
echo ""
if [ $violations = "0" ]; then
echo "exit with status code 0"
exit 0
else
echo "exit with status code 2"
exit 2
fi
echo "Never ever!"