travis-racket/install-racket.sh
Greg Hendershott ebbc14e18b Support Travis CI containers. Fixes #5.
Change install-racket.sh to:

- Use a RACKET_DIR env var saying where to install Racket. For backwards
  compatibility, if undefined this defaults to /usr/racket.

- Don't use sudo unless installing to /usr*.

- Download nightly snapshot builds from Northwestern not Utah.
  See https://github.com/travis-ci/travis-ci/issues/3012

- Fix the here string (which was slightly broken all along, although in
  a way that had been harmless).

Change the example .travis.yml to:

- Split env into global and matrix sections.

- Specify RACKET_DIR as a global var.

- Specify the RACKET_VERSIONs as matrix vars.

- Set PATH from RACKET_DIR (because install-racket.sh can't do this --
  it can't change the env for the .travis.yml).
2015-01-12 22:07:23 -05:00

46 lines
1.4 KiB
Bash
Executable File

# IMPORTANT: Your .travis.yml must pipe this to bash (not to sh)!
# In the Travis CI environment a #!/bin/bash shebang here won't help.
set -e
if [[ "$RACKET_VERSION" = "HEAD" ]]; then
URL="http://plt.eecs.northwestern.edu/snapshots/current/installers/racket-test-current-x86_64-linux-precise.sh"
elif [[ "$RACKET_VERSION" = 5.9* ]]; then
URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket-${RACKET_VERSION}-x86_64-linux-ubuntu-quantal.sh"
elif [[ "$RACKET_VERSION" = 6.* ]]; then
URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket-${RACKET_VERSION}-x86_64-linux-ubuntu-precise.sh"
else
URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket/racket-${RACKET_VERSION}-bin-x86_64-linux-debian-squeeze.sh"
fi
# Older .travis.yml files don't set $RACKET_DIR (the Racket install
# directory) explicitly and expect it to be /usr/racket.
if [[ "$RACKET_DIR" = "" ]]; then
RACKET_DIR=/usr/racket
fi
INSTALLER="./racket-${RACKET_VERSION}.sh"
echo "Downloading $URL to $INSTALLER:"
curl -L -o $INSTALLER $URL
echo "Making $INSTALLER executable:"
chmod u+rx "$INSTALLER"
# Only use sudo if installing to /usr
if [[ "$RACKET_DIR" = /usr* ]]; then
RUN_INSTALLER="sudo ${INSTALLER}"
else
RUN_INSTALLER="${INSTALLER}"
fi
echo "Running $RUN_INSTALLER to install Racket:"
$RUN_INSTALLER <<EOF
no
"$RACKET_DIR"
EOF
exit 0