Use s3cmd instead of s3-cli since we can pass keys as arg

This commit is contained in:
Girish Ramakrishnan
2015-02-11 10:54:36 -08:00
parent a83cc0f647
commit 79250cd0ec
2 changed files with 7 additions and 3 deletions
-1
View File
@@ -81,7 +81,6 @@
"mocha": "*",
"nock": "~0.43.1",
"redis": "~0.12.1",
"s3-cli": "~0.11.1",
"sinon": "~1.10.3"
},
"scripts": {
+7 -2
View File
@@ -2,7 +2,12 @@
set -eu
[[ ! -f "${HOME}/.s3cfg" ]] && echo "~/.s3cfg missing" && exit 1
: ${AWS_BOX_RELEASE_ACCESS_KEY:=}
: ${AWS_BOX_RELEASE_SECRET_KEY:=}
if [[ -z "${AWS_BOX_RELEASE_ACCESS_KEY}" || -z "${AWS_BOX_RELEASE_SECRET_KEY}" ]]; then
echo "AWS_BOX_RELEASE_ACCESS_KEY and AWS_BOX_RELEASE_SECRET_KEY env is not set"
exit 1
fi
# Only GNU getopt supports long options. OS X comes bundled with the BSD getopt
# brew install gnu-getopt to get the GNU getopt on OS X
@@ -39,7 +44,7 @@ cd "${bundle_dir}" && npm install --production
cd "${bundle_dir}" && tar czvf "${bundle_file}" .
echo "Uploading bundle to S3"
${SOURCE_DIR}/node_modules/.bin/s3-cli put --acl-public "${bundle_file}" "s3://cloudron-releases/box-${version}.tar.gz"
s3cmd --acl-public --access_key="${AWS_BOX_RELEASE_ACCESS_KEY}" --secret_key="${AWS_BOX_RELEASE_SECRET_KEY}" --no-mime-magic put "${bundle_file}" "s3://cloudron-releases/box-${version}.tar.gz"
echo "Cleaning up ${bundle_dir}"
rm -rf "${bundle_dir}" "${bundle_file}"