Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gdrive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
REMY Arnaud
gdrive
Commits
342082f8
There was an error fetching the commit references. Please try again later.
Commit
342082f8
authored
9 years ago
by
Petter Rasmussen
Browse files
Options
Downloads
Patches
Plain Diff
Update upload script
parent
34e963de
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
_release/upload.sh
+91
-13
91 additions, 13 deletions
_release/upload.sh
with
91 additions
and
13 deletions
_release/upload.sh
+
91
−
13
View file @
342082f8
#!/bin/bash
#!/usr/local/bin/bash
# Grab application version
VERSION
=
$(
_release/bin/gdrive-osx-x64 version |
awk
'NR==1 {print $2}'
)
declare
-a
filenames
filenames
=(
"gdrive-osx-x64"
"gdrive-osx-386"
"gdrive-osx-arm"
"gdrive-linux-x64"
"gdrive-linux-386"
"gdrive-linux-rpi"
"gdrive-linux-arm64"
"gdrive-linux-arm"
"gdrive-linux-mips64"
"gdrive-linux-mips64le"
"gdrive-linux-ppc64"
"gdrive-linux-ppc64le"
"gdrive-windows-386.exe"
"gdrive-windows-x64.exe"
"gdrive-dragonfly-x64"
"gdrive-freebsd-x64"
"gdrive-freebsd-386"
"gdrive-freebsd-arm"
"gdrive-netbsd-x64"
"gdrive-netbsd-386"
"gdrive-netbsd-arm"
"gdrive-openbsd-x64"
"gdrive-openbsd-386"
"gdrive-openbsd-arm"
"gdrive-solaris-x64"
"gdrive-plan9-x64"
"gdrive-plan9-386"
)
# Note: associative array requires bash 4+
declare
-A
descriptions
descriptions
=(
[
"gdrive-osx-x64"
]=
"OS X 64-bit"
[
"gdrive-osx-386"
]=
"OS X 32-bit"
[
"gdrive-osx-arm"
]=
"OS X arm"
[
"gdrive-linux-x64"
]=
"Linux 64-bit"
[
"gdrive-linux-386"
]=
"Linux 32-bit"
[
"gdrive-linux-rpi"
]=
"Linux Raspberry Pi"
[
"gdrive-linux-arm64"
]=
"Linux arm 64-bit"
[
"gdrive-linux-arm"
]=
"Linux arm 32-bit"
[
"gdrive-linux-mips64"
]=
"Linux mips 64-bit"
[
"gdrive-linux-mips64le"
]=
"Linux mips 64-bit le"
[
"gdrive-linux-ppc64"
]=
"Linux PPC 64-bit"
[
"gdrive-linux-ppc64le"
]=
"Linux PPC 64-bit le"
[
"gdrive-windows-386.exe"
]=
"Window 32-bit"
[
"gdrive-windows-x64.exe"
]=
"Windows 64-bit"
[
"gdrive-dragonfly-x64"
]=
"DragonFly BSD 64-bit"
[
"gdrive-freebsd-x64"
]=
"FreeBSD 64-bit"
[
"gdrive-freebsd-386"
]=
"FreeBSD 32-bit"
[
"gdrive-freebsd-arm"
]=
"FreeBSD arm"
[
"gdrive-netbsd-x64"
]=
"NetBSD 64-bit"
[
"gdrive-netbsd-386"
]=
"NetBSD 32-bit"
[
"gdrive-netbsd-arm"
]=
"NetBSD arm"
[
"gdrive-openbsd-x64"
]=
"OpenBSD 64-bit"
[
"gdrive-openbsd-386"
]=
"OpenBSD 32-bit"
[
"gdrive-openbsd-arm"
]=
"OpenBSD arm"
[
"gdrive-solaris-x64"
]=
"Solaris 64-bit"
[
"gdrive-plan9-x64"
]=
"Plan9 64-bit"
[
"gdrive-plan9-386"
]=
"Plan9 32-bit"
)
# Markdown helpers
HEADER
=
'### Downloads'
ROW_TEMPLATE
=
'- [{{name}}]({{url}})'
HEADER
=
'### Downloads
| Filename | Version | Description | Shasum |
|:-----------------------|:--------|:-------------------|:-----------------------------------------|'
# Grab application version
VERSION
=
$(
_release/bin/drive-osx-x64
--version
|
awk
'{print $2}'
|
sed
-e
's/v//'
)
ROW_TEMPLATE
=
"| [{{name}}]({{url}}) |
$VERSION
| {{description}} | {{sha}} |"
# Print markdown header
# Print header
echo
"
$HEADER
"
for
bin_path
in
_release/bin/drive-
*
;
do
for
name
in
${
filenames
[@]
}
;
do
bin_path
=
"_release/bin/
$name
"
# Upload file
URL
=
$(
drive upload
--file
$bin_path
--share
|
awk
'/https/ {print $9}'
)
url
=
$(
gdrive upload
--share
$bin_path
|
awk
'/https/ {print $7}'
)
# Shasum
sha
=
"
$(
shasum
-b
$bin_path
|
awk
'{print $1}'
)
"
# Filename
name
=
"
$(
basename
$bin_path
)
"
# Render markdown row
row
=
${
ROW_TEMPLATE
//
"{{name}}"
/
$name
}
row
=
${
row
//
"{{url}}"
/
$url
}
row
=
${
row
//
"{{description}}"
/
${
descriptions
[
$name
]
}}
row
=
${
row
//
"{{sha}}"
/
$sha
}
# Render markdown row and print to screen
NAME
=
"
$(
basename
$bin_path
)
v
${
VERSION
}
"
ROW
=
${
ROW_TEMPLATE
//
"{{name}}"
/
$NAME
}
ROW
=
${
ROW
//
"{{url}}"
/
$URL
}
echo
"
$ROW
"
# Print row
echo
"
$row
"
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment