add new type: __rbenv
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
parent
839af573b1
commit
fe143d57b8
4 changed files with 103 additions and 0 deletions
25
cdist/conf/type/__rbenv/explorer/homedir
Executable file
25
cdist/conf/type/__rbenv/explorer/homedir
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# 2012 Nico Schottelius (nico-cdist at schottelius.org)
|
||||||
|
#
|
||||||
|
# This file is part of cdist.
|
||||||
|
#
|
||||||
|
# cdist is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# cdist is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Check whether repository exists
|
||||||
|
#
|
||||||
|
|
||||||
|
user="$__object_id"
|
||||||
|
su - "$user" -c "pwd -P"
|
43
cdist/conf/type/__rbenv/man.text
Normal file
43
cdist/conf/type/__rbenv/man.text
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
cdist-type__rbenv(7)
|
||||||
|
====================
|
||||||
|
Nico Schottelius <nico-cdist--@--schottelius.org>
|
||||||
|
|
||||||
|
|
||||||
|
NAME
|
||||||
|
----
|
||||||
|
cdist-type__rbenv - Manage rbenv installation
|
||||||
|
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
-----------
|
||||||
|
This cdist type allows you to manage rbenv installations.
|
||||||
|
It also installs ruby-build.
|
||||||
|
|
||||||
|
|
||||||
|
OPTIONAL PARAMETERS
|
||||||
|
-------------------
|
||||||
|
state::
|
||||||
|
Either "present" or "absent", defaults to "present"
|
||||||
|
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
--------
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
# Install rbenv including ruby-build for nico
|
||||||
|
__rbenv nico
|
||||||
|
|
||||||
|
# Bastian does not need rbenv anymore, he began to code C99
|
||||||
|
__rbenv bastian --state absent
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
SEE ALSO
|
||||||
|
--------
|
||||||
|
- cdist-type(7)
|
||||||
|
|
||||||
|
|
||||||
|
COPYING
|
||||||
|
-------
|
||||||
|
Copyright \(C) 2012 Nico Schottelius. Free use of this software is
|
||||||
|
granted under the terms of the GNU General Public License version 3 (GPLv3).
|
34
cdist/conf/type/__rbenv/manifest
Normal file
34
cdist/conf/type/__rbenv/manifest
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# 2012 Nico Schottelius (nico-cdist at schottelius.org)
|
||||||
|
#
|
||||||
|
# This file is part of cdist.
|
||||||
|
#
|
||||||
|
# cdist is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# cdist is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
homedir="$(cat "$__object/explorer/homedir")"
|
||||||
|
state_should=present
|
||||||
|
[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
|
||||||
|
|
||||||
|
rbenvdir="$homedir/.rbenv"
|
||||||
|
rubybuilddir="$rbenvdir/plugins/ruby-build"
|
||||||
|
|
||||||
|
__git "$rbenvdir" --source git://github.com/sstephenson/rbenv.git \
|
||||||
|
--state "$state_should"
|
||||||
|
|
||||||
|
require="__git/$rbendir" __git "$rubybuilddir" \
|
||||||
|
--source git://github.com/sstephenson/ruby-build.git \
|
||||||
|
--state "$state_should"
|
1
cdist/conf/type/__rbenv/parameter/optional
Normal file
1
cdist/conf/type/__rbenv/parameter/optional
Normal file
|
@ -0,0 +1 @@
|
||||||
|
state
|
Loading…
Reference in a new issue