Skip to content

Commit

Permalink
Moved release, package tar to Bash.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Dec 18, 2015
1 parent c36d538 commit 99c1ff5
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 8 deletions.
6 changes: 6 additions & 0 deletions scripts/configuration.sh
Expand Up @@ -47,3 +47,9 @@ function rbx_revision_date {
function rbx_revision_hash {
rbx_get_revision | cut -d ' ' -f 3
}

function rbx_write_revision_file {
if [[ -d $(rbx_git_directory) ]]; then
rbx_get_revision > "$(rbx_revision_file)"
fi
}
14 changes: 6 additions & 8 deletions scripts/deploy.sh
@@ -1,8 +1,8 @@
#!/bin/bash

source "scripts/io.sh"
source "scripts/aws.sh"
source "scripts/configuration.sh"
source "scripts/aws.sh"
source "scripts/io.sh"

function rbx_url_prefix {
local bucket=$1
Expand Down Expand Up @@ -49,10 +49,10 @@ function rbx_upload_files {
if [[ $TRAVIS_OS_NAME == osx && $CC == gcc && $RVM == "rbx-2" ]]; then
echo "Deploying release tarball $(rbx_revision_version)..."

rake release || fail "unable to build release tarball"
./scripts/release || fail "unable to build release tarball"

bucket="rubinius-releases-rubinius-com"
release_name="rubinius-$(rbx_revision_version).tar.bz2"
release_name="$(rbx_release_name)"

rbx_upload_files "$bucket" "$release_name" "$release_name"
fi
Expand All @@ -64,8 +64,6 @@ if [[ $RVM == "rbx-2" ]]; then
rake package:binary || fail "unable to build binary"

bucket="rubinius-binaries-rubinius-com"
revision_version=$(rbx_revision_version)
release_name="rubinius-$revision_version.tar.bz2"

declare -a paths os_releases versions

Expand All @@ -81,7 +79,7 @@ if [[ $RVM == "rbx-2" ]]; then
done
fi

IFS="." read -r -a array <<< "$revision_version"
IFS="." read -r -a array <<< "$(rbx_revision_version)"

let i=0
version=""
Expand All @@ -95,7 +93,7 @@ if [[ $RVM == "rbx-2" ]]; then

for path in "${paths[@]}"; do
for version in "${versions[@]}"; do
rbx_upload_files "$bucket" "rubinius$version.tar.bz2" "$release_name" "$path"
rbx_upload_files "$bucket" "rubinius$version.tar.bz2" "$(rbx_release_name)" "$path"
done
done
fi
22 changes: 22 additions & 0 deletions scripts/package.sh
@@ -0,0 +1,22 @@
function rbx_digest_file {
local name digest

name=$1
digest=${2:-"sha512"}

openssl dgst -"$digest" -hex "$name" | cut -d ' ' -f 2 > "$name.$digest"
}

function rbx_package_tar {
local archive files prefix

archive="$(rbx_release_name)"
rm -rf "$archive"

files="$(git ls-files; ls .revision; ls vendor/cache/*.gem)"

echo "$files" | sort | uniq | \
tar -c -s "|^|rubinius-$(rbx_revision_version)/|" -T - -f - | bzip2 > "$archive"

rbx_digest_file "$archive" "sha512"
}
13 changes: 13 additions & 0 deletions scripts/release.sh
@@ -0,0 +1,13 @@
#!/bin/bash

source "scripts/configuration.sh"
source "scripts/package.sh"

function rbx_release_name {
echo "rubinius-$(rbx_revision_version).tar.bz2"
}

rbx_write_revision_file
rbx_package_tar

exit 1

0 comments on commit 99c1ff5

Please sign in to comment.