Added svn::export.
This commit is contained in:
parent
90fa634241
commit
78264923da
1 changed files with 39 additions and 0 deletions
|
@ -48,3 +48,42 @@ define svn::checkout($source, $revision="HEAD") {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Export directory from repository.
|
||||||
|
#
|
||||||
|
# === Parameters
|
||||||
|
#
|
||||||
|
# $name:
|
||||||
|
# Destination directory.
|
||||||
|
# $source:
|
||||||
|
# Source URL.
|
||||||
|
# $revision:
|
||||||
|
# Revision. Defaults to HEAD.
|
||||||
|
#
|
||||||
|
# === Sample usage
|
||||||
|
#
|
||||||
|
# svn::export { "/usr/local/src/graphingwiki":
|
||||||
|
# source => "http://svn.graphingwiki.webfactional.com/trunk/graphingwiki",
|
||||||
|
# revision => "1959",
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
define svn::export($source, $revision="HEAD") {
|
||||||
|
|
||||||
|
exec { "svn-export-clean-${name}":
|
||||||
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||||
|
command => "rm -fr ${name}",
|
||||||
|
onlyif => $revision ? {
|
||||||
|
"HEAD" => "test -r ${name}/.svnrevision && test $(svn info --non-interactive ${source} 2>&1 | awk '/^Last Changed Rev:/ { print \$4 }') != $(cat ${name}/.svnrevision)",
|
||||||
|
default => "test -r ${name}/.svnrevision && test ${revision} != $(cat ${name}/.svnrevision)",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { "svn-export-${name}":
|
||||||
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||||
|
command => "svn export --non-interactive -r ${revision} ${source} ${name} && svn info --non-interactive -r ${revision} ${source} 2>&1 | awk '/^Last Changed Rev:/ { print \$4 }' > ${name}/.svnrevision",
|
||||||
|
creates => "${name}",
|
||||||
|
require => Exec["svn-export-clean-${name}"],
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue