Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GitLab
omnibus
Commits
4531e2b1
Unverified
Commit
4531e2b1
authored
Jan 19, 2018
by
Scott Hain
Committed by
GitHub
Jan 19, 2018
Browse files
Merge pull request #809 from chef/shain/allow_cache_suffix
Add ability to create a cache suffix
parents
f6f9973b
288d9e72
Changes
3
Hide whitespace changes
Inline
Side-by-side
appveyor.yml
View file @
4531e2b1
...
...
@@ -22,7 +22,7 @@ install:
-
echo %PATH%
-
ruby --version
-
gem --version
-
gem install bundler -v 1.10.6 --quiet --no-ri --no-rdoc
-
gem install bundler -v 1.10.6 --quiet --no-ri --no-rdoc
--force
-
bundler --version
-
cp C:\Ruby23-x64\DevKit\mingw\bin\bsdtar.exe C:\Ruby23-x64\DevKit\mingw\bin\tar.exe
-
appveyor DownloadFile http://curl.haxx.se/ca/cacert.pem -FileName C:\cacert.pem
...
...
lib/omnibus/config.rb
View file @
4531e2b1
...
...
@@ -101,9 +101,9 @@ module Omnibus
# @return [String]
default
(
:base_dir
)
do
if
Ohai
[
"platform"
]
==
"windows"
"C:/omnibus-ruby"
File
.
join
(
*
[
"C:/omnibus-ruby"
,
cache_suffix
].
compact
)
else
"/var/cache/omnibus"
File
.
join
(
*
[
"/var/cache/omnibus"
,
cache_suffix
].
compact
)
end
end
...
...
@@ -113,6 +113,12 @@ module Omnibus
# @return [String]
default
(
:cache_dir
)
{
File
.
join
(
base_dir
,
"cache"
)
}
# The suffix added (typically the software name) to create a wholly
# separate base cache directory for the software.
#
# @return [String]
default
(
:cache_suffix
,
nil
)
# The absolute path to the directory on the virtual machine where
# git caching will occur and software's will be progressively cached.
#
...
...
spec/unit/config_spec.rb
View file @
4531e2b1
...
...
@@ -93,5 +93,15 @@ module Omnibus
include_examples
"a configurable"
,
:build_dir
,
"/foo/bar/build"
include_examples
"a configurable"
,
:package_dir
,
"/foo/bar/pkg"
end
context
"when cache_suffix is specified"
do
before
{
described_class
.
cache_suffix
(
"projecto"
)
}
include_examples
"a configurable"
,
:cache_dir
,
"/var/cache/omnibus/projecto/cache"
include_examples
"a configurable"
,
:git_cache_dir
,
"/var/cache/omnibus/projecto/cache/git_cache"
include_examples
"a configurable"
,
:source_dir
,
"/var/cache/omnibus/projecto/src"
include_examples
"a configurable"
,
:build_dir
,
"/var/cache/omnibus/projecto/build"
include_examples
"a configurable"
,
:package_dir
,
"/var/cache/omnibus/projecto/pkg"
end
end
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment