2017-05-17 15:07:04 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#1: GIT_USERNAME
|
|
|
|
#2: GIT_TOKEN
|
|
|
|
#3: BRANCH
|
|
|
|
#4: LOG_USERNAME
|
|
|
|
#5: LOG_PASSWORD
|
|
|
|
#6: DRONE_BUILD_NUMBER
|
|
|
|
|
2017-05-17 15:35:02 +03:00
|
|
|
ruby scripts/lint/lint-up.rb $1 $2 $3
|
2017-08-31 10:49:22 +03:00
|
|
|
returnValue=$?
|
2017-11-22 16:41:57 +03:00
|
|
|
|
|
|
|
# exit codes:
|
|
|
|
# 0: count was reduced
|
|
|
|
# 1: count was increased
|
|
|
|
# 2: count stayed the same
|
|
|
|
|
2017-12-11 16:59:17 +03:00
|
|
|
echo "Branch: $3"
|
|
|
|
|
2017-12-11 17:14:35 +03:00
|
|
|
if [ $3 = "master" -a $returnValue -ne 1 ]; then
|
2017-05-17 15:07:04 +03:00
|
|
|
echo "New master at: https://nextcloud.kaminsky.me/index.php/s/tXwtChzyqMj6I8v"
|
2017-05-17 15:35:02 +03:00
|
|
|
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/droneLogs/master.html --upload-file build/reports/lint/lint.html
|
2017-06-13 09:02:35 +03:00
|
|
|
exit 0
|
2017-12-11 17:14:35 +03:00
|
|
|
else
|
|
|
|
if [ -e $6 ]; then
|
2017-11-12 17:12:47 +03:00
|
|
|
6="master-"$(date +%F)
|
|
|
|
fi
|
2017-05-17 15:07:04 +03:00
|
|
|
echo "New results at https://nextcloud.kaminsky.me/index.php/s/tXwtChzyqMj6I8v ->" $6.html
|
2017-05-17 15:35:02 +03:00
|
|
|
curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/droneLogs/$6.html --upload-file build/reports/lint/lint.html
|
2017-12-11 17:14:35 +03:00
|
|
|
|
|
|
|
if [ $returnValue -eq 2 ]; then
|
|
|
|
exit 0
|
|
|
|
else
|
2017-12-11 18:08:37 +03:00
|
|
|
exit $returnValue
|
2017-12-11 17:14:35 +03:00
|
|
|
fi
|
2017-05-17 15:35:02 +03:00
|
|
|
fi
|