upload_create_nightly.sh 594 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. set -e
  3. bucket=$1
  4. platform=$2
  5. artifact=$3
  6. now=$(date +'%Y-%m-%d')
  7. filename="odin-$platform-nightly+$now.zip"
  8. echo "Creating archive $filename from $artifact and uploading to $bucket"
  9. # If this is already zipped up (done before artifact upload to keep permissions in tact), just move it.
  10. if [ "${artifact: -4}" == ".zip" ]
  11. then
  12. echo "Artifact already a zip"
  13. mkdir -p "output"
  14. mv "$artifact" "output/$filename"
  15. else
  16. echo "Artifact needs to be zipped"
  17. 7z a -bd "output/$filename" -r "$artifact"
  18. fi
  19. b2 upload-file --noProgress "$bucket" "output/$filename" "nightly/$filename"