New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a script to upload nightly packages to S3 #11943
Merged
+47
−0
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
Loading status checks…
Add a script to upload nightly packages to S3
The nightly package name includes the date, and so we use a glob to locate the package file without hard coding a value. However, globbing will not work with our Buildbot steps setup because we perform word splitting ourselves and pass an array to Buildbot, which will directly exec the array instead of passing it to the shell, meaning globbing does not occur. Instead, add a script to the servo repo where we can use globbing, and use `shopt -s failglob` to guard against bad globs.
- Loading branch information
commit 9dc96434876334617a658c87f3b0f0451b0f53a7
| @@ -0,0 +1,47 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -o errexit | ||
| set -o nounset | ||
| set -o pipefail | ||
| shopt -s failglob | ||
|
|
||
|
|
||
| usage() { | ||
| printf "usage: ${0} android|linux|mac|windows\n" | ||
| } | ||
|
|
||
|
|
||
| upload() { | ||
| s3cmd put "${2}" "s3://servo-developer-preview/nightly/${1}" | ||
| } | ||
|
|
||
|
|
||
| main() { | ||
| if [[ "$#" != 1 ]]; then | ||
| usage >&2 | ||
| return 1 | ||
| fi | ||
|
|
||
| local platform package | ||
| platform="${1}" | ||
|
|
||
| if [[ "${platform}" == "android" ]]; then | ||
| package=target/arm-linux-androideabi/release/*.apk | ||
| elif [[ "${platform}" == "linux" ]]; then | ||
|
||
| package=target/*.tar.gz | ||
| elif [[ "${platform}" == "mac" ]]; then | ||
| package=target/*.dmg | ||
| elif [[ "${platform}" == "windows" ]]; then | ||
| package=target/*.tar.gz | ||
| else | ||
| usage >&2 | ||
| return 1 | ||
| fi | ||
|
|
||
| # Lack of quotes on package allows glob expansion | ||
| # Note that this is not robust in the case of embedded spaces | ||
| # TODO(aneeshusa): make this glob robust using e.g. arrays or Python | ||
| upload "${platform}" ${package} | ||
| } | ||
|
|
||
| main "$@" | ||
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Can you also allow "windows" here, until we have a .msi builder in place?