forked from voxpupuli/puppet-jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial support for direct download package installation
- Loading branch information
Geoff Williams
committed
Mar 17, 2015
1 parent
29421c4
commit 948c119
Showing
5 changed files
with
82 additions
and
11 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
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 @@ | ||
# | ||
# Support for directly downloading a package file - for when no repository | ||
# is available | ||
# | ||
class jenkins::direct_download { | ||
if $caller_module_name != $module_name { | ||
fail("Use of private class ${name} by ${caller_module_name}") | ||
} | ||
|
||
validate_string($::jenkins::package_provider) | ||
validate_string($::jenkins::direct_download) | ||
validate_absolute_path($::jenkins::package_cache_dir) | ||
if $::jenkins::version { | ||
validate_string($::jenkins::version) | ||
} | ||
|
||
# stdlib 4.6 has 'basename' | ||
#$package_file = basename($::jenkins::download_url) | ||
$package_file = regsubst($::jenkins::direct_download, '(.*?)([^/]+)$', '\2') | ||
$local_file = "${::jenkins::package_cache_dir}/${package_file}" | ||
|
||
validate_absolute_path($local_file) | ||
|
||
if $::jenkins::version { | ||
# make download optional if we are removing... | ||
staging::file { $package_file: | ||
source => $jenkins::direct_download, | ||
target => $local_file, | ||
before => Package[$::jenkins::package_name], | ||
} | ||
} | ||
|
||
package { $::jenkins::package_name: | ||
ensure => $::jenkins::version, | ||
provider => $::jenkins::package_provider, | ||
source => $local_file, | ||
} | ||
} |
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
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
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