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

Commit

Permalink
GUI upload cont'd
Browse files Browse the repository at this point in the history
  • Loading branch information
binwiederhier committed Mar 19, 2015
1 parent e16eb08 commit 7930b39
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 21 deletions.
12 changes: 6 additions & 6 deletions gradle/upload/upload-application.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,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" "$version" "$date" "$snapshot" # Most likely to fail first
upload_app "$file_deb" "cli" "deb" "$version" "$date" "$snapshot" # Most likely to fail first

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

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

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

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

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

echo ""
echo "DONE."
Expand Down
20 changes: 12 additions & 8 deletions gradle/upload/upload-functions
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SYNCANY_API_ENDPOINT="https://api.syncany.org/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 Expand Up @@ -97,20 +98,24 @@ upload_plugin() {
}

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

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

if [ -z "$file" -o -z "$type" -o -z "$appVersion" -o -z "$date" -o -z "$snapshot" ]; then
if [ -z "$file" -o -z "$dist" -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&appVersion=$appVersion&date=$date&snapshot=$snapshot"
os=$(get_os_from_filename "$(basename "$file")")
arch=$(get_arch_from_filename "$(basename "$file")")

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

get_property() {
Expand Down Expand Up @@ -151,4 +156,3 @@ get_arch_from_filename() {
echo "all"
fi
}

24 changes: 17 additions & 7 deletions gradle/upload/upload-plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,29 @@ fi

source "$SCRIPTDIR/upload-functions"

properties_file=$(ls build/resources/main/org/syncany/plugins/*/plugin.properties)
plugin_properties_file=$(ls build/resources/main/org/syncany/plugins/*/plugin.properties)
application_properties_file=$REPODIR/core/syncany-lib/build/resources/main/application.properties

if [ ! -f "$properties_file" ]; then
echo "ERROR: Cannot find properties file with plugin details."
if [ ! -f "$plugin_properties_file" ]; then
echo "ERROR: Cannot find plugin properties file with plugin details."
exit 2
fi

if [ ! -f "$application_properties_file" ]; then
echo "ERROR: Cannot find application properties file application details."
exit 2
fi

mkdir -p $REPODIR/build/upload/

plugin_id=$(get_property $properties_file "pluginId")
release=$(get_property $properties_file "pluginRelease")
# List files to upload
plugin_id=$(get_property $plugin_properties_file "pluginId")
release=$(get_property $plugin_properties_file "pluginRelease")
snapshot=$([ "$release" == "true" ] && echo "false" || echo "true") # Invert 'release'

version=$(urlencode "$(get_property $application_properties_file 'applicationVersionFull')")
date=$(urlencode "$(get_property $application_properties_file 'applicationDate')")

echo ""
echo "Files to upload for $plugin_id"
echo "------------------------------"
Expand Down Expand Up @@ -56,11 +66,11 @@ if [ "$plugin_id" == "gui" ]; then

for file in $files_exe; do
echo "Uploading EXE: $(basename $file) ..."
upload_plugin "$file" "exe" "$plugin_id" "$snapshot"
upload_app "$file" "gui" "exe" "$version" "$date" "$snapshot"
done

for file in $files_appzip; do
echo "Uploading APP.ZIP: $(basename $file) ..."
upload_plugin "$file" "app.zip" "$plugin_id" "$snapshot"
upload_app "$file" "gui" "app.zip" "$version" "$date" "$snapshot"
done
fi

0 comments on commit 7930b39

Please sign in to comment.