File: ensure-ruby-version.sh

package info (click to toggle)
ruby-launchy 3.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 304 kB
  • sloc: ruby: 1,051; makefile: 6
file content (14 lines) | stat: -rw-r--r-- 438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Ensure the correct Ruby version is installed and cached
#
cache_key="${SEMAPHORE_AGENT_MACHINE_OS_IMAGE}-${RUBY_VERSION}"

if cache has_key "${cache_key}"; then
  echo "Ruby ${RUBY_VERSION} found in cache"
  cache restore "${cache_key}"
  sem-version ruby "${RUBY_VERSION}" -f
else
  echo "Installing Ruby $RUBY_VERSION"
  sem-version ruby "${RUBY_VERSION}" -f
  cache store "${cache_key}" "${HOME}/.rbenv/versions/${RUBY_VERSION}"
fi