github.com/asifdxtreme/cli@v6.1.3-0.20150123051144-9ead8700b4ae+incompatible/bin/set-stable-release.sh (about) 1 #!/bin/bash 2 3 set -e 4 5 if [ -z "$AWS_ACCESS_KEY_ID" ]; then 6 echo "Need to set AWS_ACCESS_KEY_ID" 7 exit 1 8 fi 9 10 if [ -z "$AWS_SECRET_ACCESS_KEY" ]; then 11 echo "Need to set AWS_SECRET_ACCESS_KEY" 12 exit 1 13 fi 14 15 VERSION=$1 16 if [ -z "$VERSION" ]; then 17 echo "Usage: set-stable-release VERSION" 18 echo "Example: set-stable-release v6.1.1" 19 exit 1 20 fi 21 22 root_dir=$(cd $(dirname $0) && pwd)/.. 23 s3_config_file=$root_dir/ci/s3cfg 24 25 mkdir -p tmp 26 cd tmp 27 touch empty-file 28 29 files=( 30 cf-linux-amd64.tgz 31 cf-linux-386.tgz 32 cf-darwin-amd64.tgz 33 cf-windows-amd64.zip 34 cf-windows-386.zip 35 cf-cli_amd64.deb 36 cf-cli_i386.deb 37 cf-cli_amd64.rpm 38 cf-cli_i386.rpm 39 installer-osx-amd64.pkg 40 installer-windows-amd64.zip 41 installer-windows-386.zip 42 ) 43 44 for file in ${files[*]} 45 do 46 echo "uploading file" $file 47 header="x-amz-website-redirect-location:/releases/$VERSION/$file" 48 s3cmd put empty-file s3://go-cli/releases/latest/$file --config=$s3_config_file --add-header $header > /dev/null 2>&1 49 done