-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a70c382
commit 79b15f7
Showing
6 changed files
with
53 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash -e | ||
|
||
if [ "$#" -ne 2 ]; then | ||
echo "usage: $0 <API_KEY> <FILE>" | ||
exit 1 | ||
fi | ||
|
||
FILES="" | ||
|
||
if [ -f "$2" ]; then | ||
FILES="-F file=@\"$2\"" | ||
elif [ -d "$2" ]; then | ||
for entry in "$2"/*; do | ||
# skip dirs | ||
[ -f "$entry" ] || continue | ||
|
||
FILES="$FILES -F file[]=@\"$entry\"" | ||
done | ||
else | ||
echo "$2 does not exist" | ||
exit 2 | ||
fi | ||
|
||
REVISION="$(git rev-parse --short=7 HEAD)" | ||
AUTHOR="$(git log -1 "$REVISION" --pretty="%aN")" | ||
DATE="$(git log -1 "$REVISION" --pretty="%aI")" | ||
MESSAGE="$(git log -1 "$REVISION" --pretty="%s")" | ||
|
||
curl -X POST \ | ||
-H "Authorization: Bearer $1" \ | ||
-H "X-Commit-Revision: $REVISION" \ | ||
-H "X-Commit-Author: $AUTHOR" \ | ||
-H "X-Commit-Date: $DATE" \ | ||
-H "X-Commit-Message: $MESSAGE" \ | ||
$FILES -L \ | ||
https://avocado-builds.czekanski.info/api/upload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters