Skip to content

Commit

Permalink
Switched to deploying from linux build.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Feb 28, 2016
1 parent cfca89f commit 846259f
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions scripts/deploy.sh
Expand Up @@ -71,7 +71,7 @@ function rbx_upload_files {

# Build and upload the release tarball to S3.
function rbx_deploy_release_tarball {
if [[ $1 == osx ]]; then
if [[ $1 == linux ]]; then
echo "Deploying release tarball $(rbx_release_name)..."

"$__dir__/release.sh" || fail "unable to build release tarball"
Expand Down Expand Up @@ -224,9 +224,13 @@ function rbx_deploy_travis_binary {
}

function rbx_trigger_deploy {
if [[ $1 != linux ]]; then
return
fi

local branch json_url response sha raw_url travis_yml version

branch=$1
branch=$2
json_url="https://api.github.com/repos/rubinius/rubinius-build/contents/.travis.yml"

response=$(curl "$json_url?ref=$branch&access_token=$GITHUB_OAUTH_TOKEN")
Expand All @@ -250,57 +254,53 @@ function rbx_trigger_deploy {
}

function rbx_deploy_github_release {
local os_name upload_url

os_name=$1
local upload_url

if [[ $os_name == osx ]]; then
if [[ $1 == linux ]]; then
upload_url=$(rbx_github_release "$(rbx_revision_version)" "$(rbx_revision_date)")

rbx_github_release_assets "$upload_url" "$(rbx_release_name)"
fi
}

function rbx_deploy_website_release {
local os_name releases updates version url response sha download_url
if [[ $1 != linux ]]; then
return
fi

os_name=$1
local releases updates version url response sha download_url

if [[ $os_name == osx ]]; then
releases="releases.yml"
updates="updated_$releases"
version=$(rbx_revision_version)
url="https://api.github.com/repos/rubinius/rubinius.github.io/contents/_data/releases.yml"
releases="releases.yml"
updates="updated_$releases"
version=$(rbx_revision_version)
url="https://api.github.com/repos/rubinius/rubinius.github.io/contents/_data/releases.yml"

response=$(curl "$url?access_token=$GITHUB_OAUTH_TOKEN")
response=$(curl "$url?access_token=$GITHUB_OAUTH_TOKEN")

download_url=$(echo "$response" | "$__dir__/json.sh" -b | \
egrep '\["download_url"\][[:space:]]\"[^"]+\"' | egrep -o '\"[^\"]+\"$')
curl -o "$releases" "${download_url:1:${#download_url}-2}?access_token=$GITHUB_OAUTH_TOKEN"
download_url=$(echo "$response" | "$__dir__/json.sh" -b | \
egrep '\["download_url"\][[:space:]]\"[^"]+\"' | egrep -o '\"[^\"]+\"$')
curl -o "$releases" "${download_url:1:${#download_url}-2}?access_token=$GITHUB_OAUTH_TOKEN"

grep "^- version: \"$version\"\$" "$releases"
if [ $? -eq 0 ]; then
return
fi
grep "^- version: \"$version\"\$" "$releases"
if [ $? -eq 0 ]; then
return
fi

sha=$(echo "$response" | "$__dir__/json.sh" -b | \
egrep '\["sha"\][[:space:]]\"[^"]+\"' | egrep -o '\"[[:xdigit:]]+\"')
sha=$(echo "$response" | "$__dir__/json.sh" -b | \
egrep '\["sha"\][[:space:]]\"[^"]+\"' | egrep -o '\"[[:xdigit:]]+\"')

cat > "$updates" <<EOF
cat > "$updates" <<EOF
- version: "$version"
date: $(rbx_revision_date)
date: $(rbx_revision_date)
EOF

cat "$releases" >> "$updates"
cat "$releases" >> "$updates"

rbx_github_update_file "$updates" "${sha:1:${#sha}-2}" "Version $version." "$url"
fi
rbx_github_update_file "$updates" "${sha:1:${#sha}-2}" "Version $version." "$url"
}

function rbx_deploy_docker_release {
local os_name=$1

if [[ $os_name != osx ]]; then
if [[ $1 != linux ]]; then
return
fi

Expand Down Expand Up @@ -381,26 +381,26 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
rbx_deploy_docker_release "$TRAVIS_OS_NAME"
;;
"trigger-heroku")
rbx_trigger_deploy heroku
rbx_trigger_deploy "$TRAVIS_OS_NAME" heroku
;;
"trigger-homebrew")
rbx_trigger_deploy homebrew
rbx_trigger_deploy "$TRAVIS_OS_NAME" homebrew
;;
"trigger-travis-osx")
rbx_trigger_deploy travis-osx
rbx_trigger_deploy "$TRAVIS_OS_NAME" travis-osx
;;
"trigger-travis-12.04")
rbx_trigger_deploy travis-12.04
rbx_trigger_deploy "$TRAVIS_OS_NAME" travis-12.04
;;
"trigger-travis-14.04")
rbx_trigger_deploy travis-14.04
rbx_trigger_deploy "$TRAVIS_OS_NAME" travis-14.04
;;
"triggers")
rbx_trigger_deploy heroku
rbx_trigger_deploy homebrew
rbx_trigger_deploy travis-osx
rbx_trigger_deploy travis-12.04
rbx_trigger_deploy travis-14.04
rbx_trigger_deploy "$TRAVIS_OS_NAME" heroku
rbx_trigger_deploy "$TRAVIS_OS_NAME" homebrew
rbx_trigger_deploy "$TRAVIS_OS_NAME" travis-osx
rbx_trigger_deploy "$TRAVIS_OS_NAME" travis-12.04
rbx_trigger_deploy "$TRAVIS_OS_NAME" travis-14.04
;;
"-h"|"--help"|*)
rbx_deploy_usage
Expand Down

0 comments on commit 846259f

Please sign in to comment.