Last active
April 15, 2018 15:11
-
-
Save rafaelmartins/857aa806d90759deb5555e754fe2ddb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Add this to your .travis.yml: | |
# | |
# script: curl -sSf https://yatr.rgm.io/run.sh | bash | |
# | |
set -e | |
I() { | |
if [[ "x${TRAVIS}" != "xtrue" ]]; then | |
echo "Not running on Travis-CI" | |
exit 1 | |
fi | |
# travis only supports amd64 | |
local arch="amd64" | |
local os="$(uname -s | tr '[:upper:]' '[:lower:]')" | |
local index="$(curl --silent https://distfiles.rgm.io/yatr/LATEST/)" | |
local archive="$(echo "${index}" | sed -n "s/.*\(yatr-${os}-${arch}-.*\)\.sha512.*/\1/p")" | |
local folder="$(echo "${index}" | sed -n "s/.*\(yatr-${os}-${arch}-.*\)\.tar.*\.sha512.*/\1/p")" | |
local p="$(echo "${folder}" | sed "s/yatr-${os}-${arch}-\(.*\)/yatr-\1/")" | |
curl --fail --silent --output "${archive}" "https://distfiles.rgm.io/yatr/${p}/${archive}" | |
curl --fail --silent --output "${archive}.sha512" "https://distfiles.rgm.io/yatr/${p}/${archive}.sha512" | |
sha512sum --check --status "${archive}.sha512" | |
tar --extract --file="${archive}" | |
exec "${folder}/yatr" | |
} | |
I |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment