Skip to content

Commit

Permalink
Showing 5 changed files with 83 additions and 17 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ before_script:
- if [ $TRAVIS_OS_NAME == osx ]; then travis_retry ./configure; fi
script: rake ci
after_success:
- if [ $TRAVIS_OS_NAME == linux ]; then ./scripts/build_support.sh archive_core; fi
- if [ $TRAVIS_BRANCH == $TRAVIS_TAG ]; then ./scripts/deploy.sh release github website triggers; fi
branches:
only:
48 changes: 48 additions & 0 deletions scripts/build_support.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

__dir__="$(cd "$(dirname "$0")" && pwd)"

# shellcheck source=scripts/configuration.sh
source "$__dir__/configuration.sh"
# shellcheck source=scripts/aws.sh
source "$__dir__/aws.sh"
# shellcheck source=scripts/io.sh
source "$__dir__/io.sh"

function rbx_archive_core {
local archive ext url bucket

archive="$(rbx_runtime_core_name)"
ext=".sha512"
bucket="$(rbx_binary_bucket)"
url=$(rbx_url_prefix "$bucket")

rm -f "$archive" "$archive$ext"

"$__dir__/package.sh" core || fail "unable to package runtime core"

rbx_s3_upload "$url" "$bucket" "$archive" "$archive" "/runtime/" ||
fail "unable to upload runtime core archive"
rbx_s3_upload "$url" "$bucket" "$archive$ext" "$archive$ext" "/runtime/" ||
fail "unable to upload runtime core archive digest"

rm -f "$archive" "$archive$ext"
}

function rbx_build_support_usage {
cat >&2 <<-EOM
Usage: ${0##*/} archive_core
EOM
exit 1
}

if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
case "$1" in
"archive_core")
rbx_archive_core
;;
"-h"|"--help"|*)
rbx_build_support_usage
;;
esac
fi
21 changes: 21 additions & 0 deletions scripts/configuration.sh
Original file line number Diff line number Diff line change
@@ -56,3 +56,24 @@ function rbx_release_name {
function rbx_heroku_release_name {
echo "ruby-2.2.2-rbx-$(rbx_revision_version).tar.bz2"
}

function rbx_runtime_core_name {
echo "rubinius-runtime-core.tar.bz2"
}

function rbx_release_bucket {
echo "rubinius-releases-rubinius-com"
}

function rbx_binary_bucket {
echo "rubinius-binaries-rubinius-com"
}

function rbx_url_prefix {
local bucket=$1
echo "https://${bucket}.s3-us-west-2.amazonaws.com"
}

function rbx_dist_version {
egrep -o '[[:digit:]]+\.[[:digit:]]+' /etc/issue
}
17 changes: 0 additions & 17 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -13,23 +13,6 @@ source "$__dir__/aws.sh"
# shellcheck source=scripts/io.sh
source "$__dir__/io.sh"

function rbx_release_bucket {
echo "rubinius-releases-rubinius-com"
}

function rbx_binary_bucket {
echo "rubinius-binaries-rubinius-com"
}

function rbx_url_prefix {
local bucket=$1
echo "https://${bucket}.s3-us-west-2.amazonaws.com"
}

function rbx_dist_version {
egrep -o '[[:digit:]]+\.[[:digit:]]+' /etc/issue
}

function rbx_upload_files {
local bucket dest src path url name index
local -a file_exts
13 changes: 13 additions & 0 deletions scripts/package.sh
Original file line number Diff line number Diff line change
@@ -42,6 +42,16 @@ function rbx_package_heroku {
rbx_digest_file "$(rbx_heroku_release_name)" "sha1"
}

function rbx_package_core {
echo "Packaging runtime/core..."

rm -rf "$(rbx_runtime_core_name)"

tar -c -f - runtime/core | bzip2 > "$(rbx_runtime_core_name)"

rbx_digest_file "$(rbx_runtime_core_name)" "sha512"
}

if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
case "$1" in
"tar")
@@ -56,6 +66,9 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
"heroku")
rbx_package_heroku
;;
"core")
rbx_package_core
;;
*)
echo "Usage: ${0##*/} package_type"
exit 1

0 comments on commit 06916ce

Please sign in to comment.