Skip to content

Commit

Permalink
Trigger Docker Hub builds from Linux sub-builds.
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
brixen committed Feb 28, 2016
1 parent 1cc41dd commit c677b61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -19,7 +19,7 @@ before_script:
- ./configure
script: rake ci
after_success:
- if [ $TRAVIS_BRANCH == $TRAVIS_TAG ]; then ./scripts/deploy.sh release github website docker triggers; fi
- if [ $TRAVIS_BRANCH == $TRAVIS_TAG ]; then ./scripts/deploy.sh release github website triggers; fi
branches:
only:
- master
Expand Down
24 changes: 11 additions & 13 deletions scripts/deploy.sh
Expand Up @@ -300,24 +300,23 @@ EOF
}

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

echo "Deploying Docker release $(rbx_revision_version)..."

local version release file url response sha
local -a paths=($(rbx_dist_version))
local version release path file url response sha

version=$(rbx_revision_version)
release=$(rbx_release_name)
path=$(rbx_dist_version)
file="Dockerfile"

for path in "${paths[@]}"; do
url="https://api.github.com/repos/rubinius/docker/contents/ubuntu/$path/$file"
response=$(curl "$url?access_token=$GITHUB_OAUTH_TOKEN")
url="https://api.github.com/repos/rubinius/docker/contents/ubuntu/$path/$file"
response=$(curl "$url?access_token=$GITHUB_OAUTH_TOKEN")

cat > "$file" <<EOF
cat > "$file" <<EOF
FROM ubuntu:$path
RUN apt-get update && apt-get install -y \\
Expand All @@ -335,14 +334,13 @@ ENV PATH /opt/rubinius/$version/bin:/opt/rubinius/$version/gems/bin:\$PATH
CMD ["bash"]
EOF

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:]]+\"')

rbx_github_update_file "$file" "${sha:1:${#sha}-2}" \
"Updated Dockerfile for $path to $version.\n\n[ci skip]" "$url"
rbx_github_update_file "$file" "${sha:1:${#sha}-2}" \
"Updated Dockerfile for $path to $version.\n\n[ci skip]" "$url"

rm "$file"
done
rm "$file"
}

function rbx_deploy_usage {
Expand Down

0 comments on commit c677b61

Please sign in to comment.