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
Showing
8 changed files
with
116 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,2 @@ | ||
mod 'git', | ||
:git => "git://github.com/anchor/puppet-git" |
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,40 @@ | ||
# Giddyup! | ||
|
||
Giddyup is a git-based software deployment tool. See | ||
http://theshed.hezmatt.org/giddyup for more info. | ||
|
||
This is a basic module to install giddyup and provide you the ability to | ||
create new giddyup environments. | ||
|
||
|
||
## Usage | ||
|
||
To setup a giddyup environment to deploy to, use the giddyup | ||
type, like this: | ||
|
||
giddyup { "/some/base/directory": | ||
environment => "production", | ||
hookdir => "config/hooks", | ||
keepreleases => "5", | ||
debug => "false", | ||
user => "someone" | ||
} | ||
|
||
The namevar is the directory to be giddyupified; any giddyup configuration | ||
variable is allowed as an attribute. The only other attribute allowed is | ||
'user', which specifies the user that the deployment tree will be owned by. | ||
|
||
There is nothing else to it. | ||
|
||
|
||
## Dependencies | ||
|
||
This module depends on the 'git' module to install git so we can configure | ||
the giddyup deployment environment, and also because it's a bit hard to use | ||
git without having git installed. | ||
|
||
|
||
## Compatibility | ||
|
||
Should be fairly distribution-agnostic. Only tested on Debian Squeeze so | ||
far. |
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 @@ | ||
../functions.sh |
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 @@ | ||
../giddyup |
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 @@ | ||
../update-hook |
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 @@ | ||
define giddyup::config($base, | ||
$user, | ||
$var, | ||
$value = undef) { | ||
if $value { | ||
exec { "set giddyup.${var} in ${base}": | ||
command => "/usr/bin/git config -f '${base}/repo/config' 'giddyup.${var}' '${value}'", | ||
unless => "/usr/bin/test \"\$(git config -f ${base}/repo/config giddyup.${var})\" = '${value}'", | ||
cwd => "/", | ||
user => $user, | ||
require => [ Noop["git/installed"], Exec["giddyup create ${base}"], User[$user] ] | ||
} | ||
} | ||
} |
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,38 @@ | ||
define giddyup($environment = undef, | ||
$hookdir = undef, | ||
$keepreleases = undef, | ||
$debug = undef, | ||
$user) { | ||
include giddyup::install | ||
include git::packages | ||
|
||
exec { "giddyup create ${name}": | ||
command => "/usr/local/lib/giddyup/giddyup ${name}", | ||
creates => $name, | ||
user => $user, | ||
require => [ File["/usr/local/lib/giddyup/giddyup"], User[$user] ] | ||
} | ||
|
||
giddyup::config { | ||
"giddyup.environment for ${name}": | ||
base => $name, | ||
user => $user, | ||
var => "environment", | ||
value => $environment; | ||
"giddyup.hookdir for ${name}": | ||
base => $name, | ||
user => $user, | ||
var => "hookdir", | ||
value => $hookdir; | ||
"giddyup.keepreleases for ${name}": | ||
base => $name, | ||
user => $user, | ||
var => "keepreleases", | ||
value => $keepreleases; | ||
"giddyup.debug for ${name}": | ||
base => $name, | ||
user => $user, | ||
var => "debug", | ||
value => $debug; | ||
} | ||
} |
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,19 @@ | ||
class giddyup::install { | ||
file { | ||
"/usr/local/lib/giddyup": | ||
ensure => directory, | ||
mode => 0755; | ||
"/usr/local/lib/giddyup/giddyup": | ||
source => "puppet:///modules/giddyup/giddyup", | ||
mode => 0555, | ||
require => [ File["/usr/local/lib/giddyup/update-hook"], | ||
File["/usr/local/lib/giddyup/functions.sh"] | ||
]; | ||
"/usr/local/lib/giddyup/update-hook": | ||
source => "puppet:///modules/giddyup/update-hook", | ||
mode => 0555; | ||
"/usr/local/lib/giddyup/functions.sh": | ||
source => "puppet:///modules/giddyup/functions.sh", | ||
mode => 0444; | ||
} | ||
} |