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

Commit

Permalink
Add date and version to app upload
Browse files Browse the repository at this point in the history
  • Loading branch information
binwiederhier committed Mar 17, 2015
1 parent 13635e9 commit 1997ab3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
16 changes: 9 additions & 7 deletions gradle/upload/upload-application.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ fi
cd "$PWD"

# List files to upload
release=$(get_property $properties_file "applicationRelease")
version=$(urlencode "$(get_property $properties_file 'applicationVersionFull')")
date=$(urlencode "$(get_property $properties_file 'applicationDate')")
release=$(get_property $properties_file 'applicationRelease')
snapshot=$([ "$release" == "true" ] && echo "false" || echo "true") # Invert 'release'

echo ""
Expand All @@ -65,22 +67,22 @@ file_reports=$(ls $REPODIR/build/upload/reports.zip)
file_docs=$(ls $REPODIR/build/upload/docs.zip)

echo "Uploading DEB: $(basename $file_deb) ..."
upload_app "$file_deb" "deb" "$snapshot" # Most likely to fail first
upload_app "$file_deb" "deb" "$version" "$date" "$snapshot" # Most likely to fail first

echo "Uploading EXE: $(basename $file_exe) ..."
upload_app "$file_exe" "exe" "$snapshot"
upload_app "$file_exe" "exe" "$version" "$date" "$snapshot"

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

echo "Uploading ZIP: $(basename $file_zip) ..."
upload_app "$file_zip" "zip" "$snapshot"
upload_app "$file_zip" "zip" "$version" "$date" "$snapshot"

echo "Uploading REPORTS: $(basename $file_reports) ..."
upload_app "$file_reports" "reports" "$snapshot"
upload_app "$file_reports" "reports" "$version" "$date" "$snapshot"

echo "Uploading DOCS: $(basename $file_docs) ..."
upload_app "$file_docs" "docs" "$snapshot"
upload_app "$file_docs" "docs" "$version" "$date" "$snapshot"

echo ""
echo "DONE."
Expand Down
11 changes: 7 additions & 4 deletions gradle/upload/upload-functions
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ urlencode() {
local c="${1:i:1}"
case $c in
[a-zA-Z0-9._-]) printf "$c" ;;
" ") printf "+" ;;
*) printf '%%%02X' "'$c"
esac
done
Expand Down Expand Up @@ -96,18 +97,20 @@ upload_plugin() {
}

upload_app() {
# upload_app <filename> <type> <snapshot>
# upload_app <filename> <type> <appVersion> <date> <snapshot>

file="$1"
type="$2"
snapshot="$3"
appVersion="$3"
date="$4"
snapshot="$5"

if [ -z "$file" -o -z "$type" -o -z "$snapshot" ]; then
if [ -z "$file" -o -z "$type" -o -z "$appVersion" -o -z "$date" -o -z "$snapshot" ]; then
echo "ERROR: Invalid arguments for upload_app. None of the arguments can be zero."
exit 2
fi

upload_file "$file" "app" "type=$type&snapshot=$snapshot"
upload_file "$file" "app" "type=$type&appVersion=$appVersion&date=$date&snapshot=$snapshot"
}

get_property() {
Expand Down

0 comments on commit 1997ab3

Please sign in to comment.