This project is a work-in-progress and not yet ready for production.
Installs Jabba - java version manager.
- Ubuntu 12.04, 14.04, 16.04
- Debian 7.11, 8.2
- CentOS 6.5, 7.2
The specified platforms have been tested, however, the cookbook is trivial and should work nearly anywhere.
- Chef 12.0 or later
Installs Jabba for target user at target location. If user is not set,
performs global installation (by default in /usr/local/share/jabba
)
and symlinks the binary to /usr/local/bin/jabba
. This is not (yet)
suited for Windows, of course.
jabba 'latest' do
version 'latest'
user 'etki'
directory '.jabba'
action :install, :delete
end
Attribute | Constraints | Default | Explanation |
---|---|---|---|
version |
Existing Jabba version | latest |
Jabba version to install |
user |
Existing user or nil | nil | User JDK will be installed for |
directory |
.jabba or /usr/local/share/jabba |
Directory for Jabba root, will be created automatically | |
action |
:install or :delete |
:install |
Installs JDK for target user. If user is not set, it will perform global installation.
NB: Jabba for specified user has to be installed in advance. This may change in the future
jabba_jdk '1.8' do
version '[email protected]'
url 'tgz+http://example.com/distribution.tar.gz'
user 'etki'
directory '.jabba'
action :install, :delete
end
Attribute | Constraints | Default | Explanation |
---|---|---|---|
version |
Jabba-compatible JDK version | Resource name | JDK version to install |
url |
See Jabba readme | nil | Custom installer URL |
user |
Existing user or nil | nil | User JDK will be installed for |
directory |
Directory where Jabba is installed | .jabba |
Directory with Jabba, relative to user home or absolute |
action |
:install or :delete |
:install |
Sets or removes default JDK version. Basically just a wrapper around
jabba_alias
.
jabba_default '1.6.65' do
version '1.6.65'
user 'etki'
directory '.jabba'
action :set, :unset
end
Attribute | Constraints | Default | Explanation |
---|---|---|---|
version |
Jabba-compatible JDK version | Resource name | JDK version to set as default |
user |
Existing user or nil | nil | Target user |
directory |
Directory where user Jabba is installed | .jabba |
Directory with Jabba, relative to user home or absolute |
action |
:set or :unset |
:set |
Sets or removes Jabba alias.
jabba_alias 'default' do
version '1.6.65'
user 'etki'
directory '.jabba'
action :create, :delete
end
Attribute | Constraints | Default | Explanation |
---|---|---|---|
name |
Resource name | Alias name | |
version |
Existing Jabba JDK installation | ||
user |
Existing user or nil | nil | User JDK will be installed for |
directory |
Directory where user Jabba is installed | .jabba |
Directory with Jabba, relative to user home or absolute |
action |
:create or :delete |
:create |
jabba_link '[email protected]' do
version '[email protected]'
target '/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk'
user 'etki'
directory '.jabba'
action :create, :delete
end
Attribute | Constraints | Default | Explanation |
---|---|---|---|
version |
Jabba-compatible JDK version name | Resource name | |
target |
Existing non-Jabba JDK installation | ||
user |
Existing user or nil | nil | User JDK will be installed for |
directory |
Directory where user Jabba is installed | .jabba |
Directory with Jabba, relative to user home or absolute |
action |
:create or :delete |
:create |
While resources are fun for fine-grained control, end user (that's you) most likely would love to not to have boilerplate, so there are some predefined recipes.
Recipes use attributes with following structure:
system:
directory: /usr/local/share/jabba
install: '0.6.1'
jdk:
- [email protected]
- [email protected]
default_jdk: [email protected]
alias:
1.7: [email protected]
1.8: [email protected]
link:
[email protected]: /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk
user:
etki:
directory: .jabba
install: latest
jdk:
- [email protected]
- [email protected]
- [email protected]
default_jdk: [email protected]
alias:
1.6: [email protected]
1.7: [email protected]
1.8: [email protected]
link: [] # empty array could be omitted, shown for clarity
Each key in structure (in system
or user.%user%
section)
corresponds with same-named recipe. Every attribute is optional and
be set to noop default if not present.
Simply runs jabba::install
, jabba::jdk
, jabba::default_jdk
,
jabba::alias
and jabba::link
one by one.
Installs Jabba version specified in system.install
and
user.%user%.install
attributes.
User may
Installs JDKs specified in system.jdk
and user.%user%.jdk
attributes.
Sets JDK versions specified in system.default_jdk
and
user.%user%.default_jdk
attributes.
Sets JDK aliases specified in system.alias
and user.%user%.alias
attributes.
Sets JDK links specified in system.link
and user.%user%.link
attributes.
This cookbook uses semantic versioning convention, however, cookbook is
considered unstable until 1.0.0 is released, so minor versions may
introduce breaking changes as well. Post-1.0.0 releases should be used
safely with ~> MAJOR.MINOR
constraint.
Cookbook is developed using git-flow convention: master
is pointing
to the most fresh release, dev
stands for next release,
release/major.minor
branches exist for bug hunting, every version
may be referenced as MAHOR.MINOR.PATCH
tag.
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request for
dev
branch using Github
License: MIT
Authors:
- Etki [email protected]
All rights for the commandline utility belong to Jabba authors.