Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
API upload refinements
Browse files Browse the repository at this point in the history
  • Loading branch information
binwiederhier committed Mar 10, 2015
1 parent 9105e33 commit 1a91431
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
30 changes: 6 additions & 24 deletions gradle/upload/upload-application.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,18 @@ fi
mkdir -p $REPODIR/build/upload/

# Gather Docs & Test Reports
echo ""
echo "Gathering Docs & Test Reports ..."
echo "------------------------------------"

PWD=`pwd`
cd $REPODIR/build
rm docs.zip || true 2> /dev/null
rm reports.zip || true 2> /dev/null
rm docs.zip 2> /dev/null || true
rm reports.zip 2> /dev/null || true

if [ -d docs ]; then
zip -r docs.zip docs/
zip --recurse-paths --quiet docs.zip docs/
mv docs.zip $REPODIR/build/upload/
fi

if [ -d reports ]; then
tar -czf reports.zip reports/
zip --recurse-paths --quiet reports.zip reports/
mv reports.zip $REPODIR/build/upload/
fi

Expand All @@ -55,13 +51,6 @@ cd $REPODIR/build/upload/
sha256sum * 2>/dev/null
cd "$PWD"

if [ $(ls $REPODIR/build/upload/ | wc -l) != "6" ]; then # 4 releases, docs and reports
echo "ERROR: Wrong files in $REPODIR/build/upload/: "
ls -l $REPODIR/build/upload/

exit 2
fi

echo ""
echo "Uploading"
echo "---------"
Expand All @@ -73,13 +62,6 @@ file_exe=$(ls $REPODIR/build/upload/syncany*.exe)
file_reports=$(ls $REPODIR/build/upload/reports.zip)
file_docs=$(ls $REPODIR/build/upload/docs.zip)

[ -f "$file_targz" ] || (echo "ERROR: Not found: $file_targz" && exit 3)
[ -f "$file_zip" ] || (echo "ERROR: Not found: $file_zip" && exit 3)
[ -f "$file_deb" ] || (echo "ERROR: Not found: $file_deb" && exit 3)
[ -f "$file_exe" ] || (echo "ERROR: Not found: $file_exe" && exit 3)
[ -f "$file_reports" ] || (echo "ERROR: Not found: $file_reports" && exit 3)
[ -f "$file_docs" ] || (echo "ERROR: Not found: $file_docs" && exit 3)

echo "Uploading TAR.GZ: $(basename $file_targz) ..."
upload_app "$file_targz" "tar.gz" "$snapshot"

Expand All @@ -93,8 +75,8 @@ echo "Uploading EXE: $(basename $file_exe) ..."
upload_app "$file_exe" "exe" "$snapshot"

echo "Uploading REPORTS: $(basename $file_reports) ..."
upload_file "$file_reports" "app/reports" "snapshot=$snapshot"
upload_app "$file_reports" "reports" "$snapshot"

echo "Uploading DOCS: $(basename $file_docs) ..."
upload_file "$file_docs" "app/docs" "snapshot=$snapshot"
upload_app "$file_docs" "docs" "$snapshot"

2 changes: 1 addition & 1 deletion gradle/upload/upload-functions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SYNCANY_API_ENDPOINT="https://api.syncany.org/v3"
#SYNCANY_API_ENDPOINT="http://tests.lan/syncany-website/api.syncany.org/html/v3"
SYNCANY_API_ENDPOINT="http://tests.lan/api.syncany.org/html/v3"

if [ "$SYNCANY_API_KEY" == "" ]; then
echo "ERROR: SYNCANY_API_KEY environment variable not set."
Expand Down

0 comments on commit 1a91431

Please sign in to comment.