-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
647b41d
commit e512696
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Ensure that the bundle is installed and cached | ||
# | ||
|
||
bundle config set --local deployment true | ||
bundle config set --local path vendor/bundle | ||
gem update --no-doc bundler | ||
|
||
gemfile_checksum=$(checksum Gemfile.lock) | ||
cache_key="${SEMAPHORE_AGENT_MACHINE_OS_IMAGE}-${RUBY_VERSION}-${gemfile_checksum}" | ||
|
||
if cache has_key "${cache_key}"; then | ||
echo "Bundle for ${RUBY_VERSION} and Gemfile.lock found in cache" | ||
cache restore "${cache_key}" | ||
else | ||
echo "Caching Bundle for ${RUBY_VERSION} and Gemfile.lock" | ||
bundle install | ||
cache store "${cache_key}" vendor/bundle | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
|