Commit c376f995 authored by Shinny Upatree's avatar Shinny Upatree 🎅🏻

support files for Santa's drone functions

parent 714ba109
Pipeline #138 canceled with stages
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAsvB0ov2pCU0zr9olk0P2CZw9ZDgQVcsM9t37tK+ddah7pe3z
11wLQG9EWSCLKfFdQgaMlo+x6wRSjpzODqIAjLfvDwr3TFlCv93oYoTzwmwdHIWB
60FxGSryDK+CPRuCcrYfQDrbpAyB/i8JrNNQHwrJsh0aF66irexFAKNIwH4a3Bzv
tX+5Oh7zR5zwBXFT08ijP2wEfz6DPkoK0P0zHm+vmGajZ3lOZQ6wufbRBaAJYp5Y
XnAIMwYGI1y6hiIGTSPpa4LT6j325z6jGfUqCLox2uFPByPo+HGKMvFd+MV/OE+G
4iM6lp1HZmcZcd3ZPxEqw1VrBp/CRv0U676K9QIDAQABAoIBAF56fWsNubGSlKbV
7J8L9B1w5C1FOMLDui2iWWM2klHsSpT6xZPBIqO72/+fIjtcGFxjLtnUNyGan6hy
/I1XVij2eP+dT6N9QbQii69w+W9/PAOyLj2zyO578V9nT8HKA59jr65vJUdB32UB
Gv+odxZc0M/9c6hrabOhG3HRxPj0+k29qPm4+U4bFoufaNT1a1p4Zq1ZQy0KAWuE
WsoeXVBu5e+J2lGcTEWSNScGKkjkHtHIvQmtPOeoa6dyDjANN8nOIrCnHwY5GxKk
eeGpffyQ3EnM7uGW09IHN6Kt3M7RVGzQPAzTt7L+Ez+dW27+nnKcSxiW6N15jW7s
w+QmFCUCgYEA23OeCUa58xnYs/RVpfqBkRlMs/9nKJ2+55fWa1eTOl4sXTDOe3EV
ptR48se1ynVSww3zFl8ksh1GCD3ecPawHG3WAb4MU66UDtLYYPcr5IrX6tZfsiPi
MaXmiUjcXSZZc/+smz6Bg1C5lGA3/+mI/Rgern2LF2mEZYolOMdDyp8CgYEA0L2V
K7qVEkSNYjelgmZF3bP/ahHJvk7ZlsVbCVTnFj3j6XU7Fng86x5lxEUiO2a2q/Id
B1daYUHL5Kef0ZcdKTNirOwxkwHUu4l27DCgIBBVGyJMFtX4wIMW9xrp9PUl78mi
5FJolyq9XhDELjkD1OKp6UdSXISurQqn8XFLlesCgYEArTjXDzVvxC+ruWhtTuWs
7m7M9+vrbskNjttwmix3f4Qkeq7y3ceGsrhWfDUeDyCK4oKZVhhl695lkE3dzsc6
fkZIvflY25kbL5RIzklssSrTgoAS65edjVkJ32XO5AxIYeL4SVaOfqvywOcubOfX
hQhL96oLZ8CXjFr+RJIttbsCgYAc9kDtOU0XpMVNHFVte000TpYgnGk2a3BLOATC
jbImZt3pdWeGXZZuNOB/0+vE/CJaRxR6AUe7+MoWZp+JEANuxP9q6LaUJAvlHVSP
vstox3tXcXHHNVb3NvkHvgc6Ao2J8JsWPMzgNIDjvUXK+AQtFGnowQmPZqVpwvG8
UTDgkwKBgEZ/OIhjkXHltomC8HMjFxSZ7/YF94aTEdgo3GNb44VlLgz4SJD4ztcz
d2M+rIaGtrXPylHdoHrGHyDMhc8Lnh8fNNKbMFLL8Zd8sKRt92bDHR9/JO+k/PKr
ZWwI1hlAs8o9z81481/mKgA417dFRDTT1LgRdaKiiL/H/trWepgl
-----END RSA PRIVATE KEY-----
\ No newline at end of file
Version 0.2.0
Summary:
This release mainly focuses on a number of bugfixes, which should
significantly improve the reliability of Git and SVN. Thanks to
our many contributors for all of these fixes!
Features:
- Git:
- Add autorequire for Package['git']
- HG:
- Allow user and identity properties.
- Bzr:
- "ensure => latest" support.
- SVN:
- Added configuration parameter.
- Add support for master svn repositories.
- CVS:
- Allow for setting the CVS_RSH environment variable.
Fixes:
- Handle Puppet::Util[::Execution].withenv for 2.x and 3.x properly.
- Change path_empty? to not do full directory listing.
- Overhaul spec tests to work with rspec2.
- Git:
- Improve Git SSH usage documentation.
- Add ssh session timeouts to prevent network issues from blocking runs.
- Fix git provider checkout of a remote ref on an existing repo.
- Allow unlimited submodules (thanks to --recursive).
- Use git checkout --force instead of short -f everywhere.
- Update git provider to handle checking out into an existing (empty) dir.
- SVN:
- Handle force property. for svn.
- Adds support for changing upstream repo url.
- Check that the URL of the WC matches the URL from the manifest.
- Changed from using "update" to "switch".
- Handle revision update without source switch.
- Fix svn provider to look for '^Revision:' instead of '^Last Changed Rev:'.
- CVS:
- Documented the "module" attribute.
source 'https://rubygems.org'
group :development, :test do
gem 'rake', :require => false
gem 'rspec-puppet', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-system', :require => false
gem 'rspec-system-puppet', :require => false
gem 'rspec-system-serverspec', :require => false
gem 'serverspec', :require => false
gem 'puppet-lint', :require => false
gem 'pry', :require => false
gem 'simplecov', :require => false
end
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end
# vim:ft=ruby
Copyright (C) 2010-2012 Puppet Labs Inc.
Puppet Labs can be contacted at: info@puppetlabs.com
This program and entire repository 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 2 of the License, or any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
name 'puppetlabs/vcsrepo'
version '0.2.0'
summary 'Manage repositories from various version control systems'
description 'Manage repositories from various version control systems'
Using vcsrepo with Bazaar
=========================
To create a blank repository
----------------------------
Define a `vcsrepo` without a `source` or `revision`:
vcsrepo { "/path/to/repo":
ensure => present,
provider => bzr
}
To branch from an existing repository
-------------------------------------
Provide the `source` location:
vcsrepo { "/path/to/repo":
ensure => present,
provider => bzr,
source => 'lp:myproj'
}
For a specific revision, use `revision` with a valid revisionspec
(see `bzr help revisionspec` for more information on formatting a revision):
vcsrepo { "/path/to/repo":
ensure => present,
provider => bzr,
source => 'lp:myproj',
revision => 'menesis@pov.lt-20100309191856-4wmfqzc803fj300x'
}
For sources that use SSH (eg, `bzr+ssh://...`, `sftp://...`)
------------------------------------------------------------
Manage your SSH keys with Puppet and use `require` in your `vcsrepo`
to ensure they are present. For more information, see the `require`
metaparameter documentation[1].
More Examples
-------------
For examples you can run, see `examples/bzr/`
[1]: http://docs.puppetlabs.com/references/stable/metaparameter.html#require
Using vcsrepo with CVS
======================
To create a blank repository
----------------------------
Define a `vcsrepo` without a `source` or `revision`:
vcsrepo { "/path/to/repo":
ensure => present,
provider => cvs
}
To checkout/update from a repository
------------------------------------
To get the current mainline:
vcsrepo { "/path/to/workspace":
ensure => present,
provider => cvs,
source => ":pserver:anonymous@example.com:/sources/myproj"
}
To get a specific module on the current mainline:
vcsrepo {"/vagrant/lockss-daemon-source":
ensure => present,
provider => cvs,
source => ":pserver:anonymous@lockss.cvs.sourceforge.net:/cvsroot/lockss",
module => "lockss-daemon",
}
You can use the `compression` parameter (it works like CVS `-z`):
vcsrepo { "/path/to/workspace":
ensure => present,
provider => cvs,
compression => 3,
source => ":pserver:anonymous@example.com:/sources/myproj"
}
For a specific tag, use `revision`:
vcsrepo { "/path/to/workspace":
ensure => present,
provider => cvs,
compression => 3,
source => ":pserver:anonymous@example.com:/sources/myproj",
revision => "SOMETAG"
}
For sources that use SSH
------------------------
Manage your SSH keys with Puppet and use `require` in your `vcsrepo`
to ensure they are present. For more information, see the `require`
metaparameter documentation[1].
More Examples
-------------
For examples you can run, see `examples/cvs/`
[1]: http://docs.puppetlabs.com/references/stable/metaparameter.html#require
Using vcsrepo with Git
======================
To create a blank repository
----------------------------
Define a `vcsrepo` without a `source` or `revision`:
vcsrepo { "/path/to/repo":
ensure => present,
provider => git
}
If you're defining this for a central/"official" repository, you'll
probably want to make it a "bare" repository. Do this by setting
`ensure` to `bare` instead of `present`:
vcsrepo { "/path/to/repo":
ensure => bare,
provider => git
}
To clone/pull a repository
----------------------------
To get the current [master] HEAD:
vcsrepo { "/path/to/repo":
ensure => present,
provider => git,
source => "git://example.com/repo.git"
}
For a specific revision or branch (can be a commit SHA, tag or branch name):
vcsrepo { "/path/to/repo":
ensure => present,
provider => git,
source => 'git://example.com/repo.git',
revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31'
}
vcsrepo { "/path/to/repo":
ensure => present,
provider => git,
source => 'git://example.com/repo.git',
revision => '1.1.2rc1'
}
vcsrepo { "/path/to/repo":
ensure => present,
provider => git,
source => 'git://example.com/repo.git',
revision => 'development'
}
Check out as a user:
vcsrepo { "/path/to/repo":
ensure => present,
provider => git,
source => 'git://example.com/repo.git',
revision => '0c466b8a5a45f6cd7de82c08df2fb4ce1e920a31',
user => 'someUser'
}
Keep the repository at the latest revision (note: this will always overwrite local changes to the repository):
vcsrepo { "/path/to/repo":
ensure => latest,
provider => git,
source => 'git://example.com/repo.git',
revision => 'master',
}
For sources that use SSH (eg, `username@server:...`)
----------------------------------------------------
If your SSH key is associated with a user, simply fill the `user` parameter to use his keys.
Example:
user => 'toto' # will use toto's $HOME/.ssh setup
Otherwise, manage your SSH keys with Puppet and use `require` in your `vcsrepo` to ensure they are present.
For more information, see the `require` metaparameter documentation[1].
More Examples
-------------
For examples you can run, see `examples/git/`
[1]: http://docs.puppetlabs.com/references/stable/metaparameter.html#require
Using vcsrepo with Mercurial
============================
To create a blank repository
----------------------------
Define a `vcsrepo` without a `source` or `revision`:
vcsrepo { "/path/to/repo":
ensure => present,
provider => hg
}
To clone/pull & update a repository
-----------------------------------
To get the default branch tip:
vcsrepo { "/path/to/repo":
ensure => present,
provider => hg,
source => "http://hg.example.com/myrepo"
}
For a specific changeset, use `revision`:
vcsrepo { "/path/to/repo":
ensure => present,
provider => hg,
source => "http://hg.example.com/myrepo",
revision => '21ea4598c962'
}
You can also set `revision` to a tag:
vcsrepo { "/path/to/repo":
ensure => present,
provider => hg,
source => "http://hg.example.com/myrepo",
revision => '1.1.2'
}
Check out as a user:
vcsrepo { "/path/to/repo":
ensure => present,
provider => hg,
source => "http://hg.example.com/myrepo",
user => 'user'
}
Specify an SSH identity key:
vcsrepo { "/path/to/repo":
ensure => present,
provider => hg,
source => "ssh://hg@hg.example.com/myrepo",
identity => "/home/user/.ssh/id_dsa,
}
For sources that use SSH (eg, `ssh://...`)
------------------------------------------
Manage your SSH keys with Puppet and use `require` in your `vcsrepo`
to ensure they are present. For more information, see the `require`
metaparameter documentation[1].
More Examples
-------------
For examples you can run, see `examples/hg/`
[1]: http://docs.puppetlabs.com/references/stable/metaparameter.html#require
Using vcsrepo with Subversion
=============================
To create a blank repository
----------------------------
To create a blank repository suitable for use as a central repository,
define a `vcsrepo` without a `source` or `revision`:
vcsrepo { "/path/to/repo":
ensure => present,
provider => svn
}
To checkout from a repository
-----------------------------
Provide a `source` qualified to the branch/tag you want:
vcsrepo { "/path/to/repo":
ensure => present,
provider => svn,
source => "svn://svnrepo/hello/branches/foo"
}
You can provide a specific `revision`:
vcsrepo { "/path/to/repo":
ensure => present,
provider => svn,
source => "svn://svnrepo/hello/branches/foo",
revision => '1234'
}
Using a specified Subversion configuration directory
-----------------------------
Provide a `configuration` parameter which should be a directory path on the local system where your svn configuration
files are. Typically, it is /path/to/.subversion:
vcsrepo { "/path/to/repo":
ensure => present,
provider => svn,
source => "svn://svnrepo/hello/branches/foo",
configuration => "/path/to/.subversion"
}
For sources that use SSH (eg, `svn+ssh://...`)
----------------------------------------------
Manage your SSH keys with Puppet and use `require` in your `vcsrepo`
to ensure they are present. For more information, see the `require`
metaparameter documentation[1].
More Examples
-------------
For examples you can run, see `examples/svn/`
[1]: http://docs.puppetlabs.com/references/stable/metaparameter.html#require
vcsrepo
=======
[![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-vcsrepo.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-vcsrepo)
Purpose
-------
This provides a single type, `vcsrepo`.
This type can be used to describe:
* A working copy checked out from a (remote or local) source, at an
arbitrary revision
* A "blank" working copy not associated with a source (when it makes
sense for the VCS being used)
* A "blank" central repository (when the distinction makes sense for the VCS
being used)
Supported Version Control Systems
---------------------------------
This module supports a wide range of VCS types, each represented by a
separate provider.
For information on how to use this module with a specific VCS, see
`README.<VCS>.markdown`.
License
-------
See LICENSE.
require 'puppetlabs_spec_helper/rake_tasks'
require 'tmpdir'
require 'digest/md5'
require 'fileutils'
# Abstract
class Puppet::Provider::Vcsrepo < Puppet::Provider
private
def set_ownership
owner = @resource.value(:owner) || nil
group = @resource.value(:group) || nil
FileUtils.chown_R(owner, group, @resource.value(:path))
end
def path_exists?
File.directory?(@resource.value(:path))
end
def path_empty?
# Path is empty if the only entries are '.' and '..'
d = Dir.new(@resource.value(:path))
d.read # should return '.'
d.read # should return '..'
d.read.nil?
end
# Note: We don't rely on Dir.chdir's behavior of automatically returning the
# value of the last statement -- for easier stubbing.
def at_path(&block) #:nodoc:
value = nil
Dir.chdir(@resource.value(:path)) do
value = yield
end
value
end
def tempdir
@tempdir ||= File.join(Dir.tmpdir, 'vcsrepo-' + Digest::MD5.hexdigest(@resource.value(:path)))
end
end
require File.join(File.dirname(__FILE__), '..', 'vcsrepo')
Puppet::Type.type(:vcsrepo).provide(:bzr, :parent => Puppet::Provider::Vcsrepo) do
desc "Supports Bazaar repositories"
optional_commands :bzr => 'bzr'
has_features :reference_tracking
def create
if !@resource.value(:source)
create_repository(@resource.value(:path))
else
clone_repository(@resource.value(:revision))
end
end
def working_copy_exists?
File.directory?(File.join(@resource.value(:path), '.bzr'))
end
def exists?
working_copy_exists?
end
def destroy
FileUtils.rm_rf(@resource.value(:path))
end
def revision
at_path do
current_revid = bzr('version-info')[/^revision-id:\s+(\S+)/, 1]
desired = @resource.value(:revision)
begin
desired_revid = bzr('revision-info', desired).strip.split(/\s+/).last
rescue Puppet::ExecutionFailure
# Possible revid available during update (but definitely not current)
desired_revid = nil
end
if current_revid == desired_revid
desired
else
current_revid
end
end
end
def revision=(desired)
at_path do
begin
bzr('update', '-r', desired)
rescue Puppet::ExecutionFailure
bzr('update', '-r', desired, ':parent')
end
end
end
def latest
at_path do
bzr('version-info', ':parent')[/^revision-id:\s+(\S+)/, 1]
end
end
def latest?
at_path do
return self.revision == self.latest
end
end
private
def create_repository(path)
bzr('init', path)
end
def clone_repository(revision)
args = ['branch']
if revision
args.push('-r', revision)
end
args.push(@resource.value(:source),
@resource.value(:path))
bzr(*args)
end
end
require File.join(File.dirname(__FILE__), '..', 'vcsrepo')
Puppet::Type.type(:vcsrepo).provide(:cvs, :parent => Puppet::Provider::Vcsrepo) do
desc "Supports CVS repositories/workspaces"
optional_commands :cvs => 'cvs'
has_features :gzip_compression, :reference_tracking, :modules, :cvs_rsh
def create
if !@resource.value(:source)
create_repository(@resource.value(:path))
else
checkout_repository
end
update_owner
end
def exists?
if @resource.value(:source)
directory = File.join(@resource.value(:path), 'CVS')
else
directory = File.join(@resource.value(:path), 'CVSROOT')
end
File.directory?(directory)
end
def working_copy_exists?
File.directory?(File.join(@resource.value(:path), 'CVS'))
end
def destroy
FileUtils.rm_rf(@resource.value(:path))
end
def latest?
debug "Checking for updates because 'ensure => latest'"
at_path do
# We cannot use -P to prune empty dirs, otherwise
# CVS would report those as "missing", regardless
# if they have contents or updates.
is_current = (runcvs('-nq', 'update', '-d').strip == "")
if (!is_current) then debug "There are updates available on the checkout's current branch/tag." end
return is_current
end
end
def latest
# CVS does not have a conecpt like commit-IDs or change
# sets, so we can only have the current branch name (or the
# requested one, if that differs) as the "latest" revision.
should = @resource.value(:revision)
current = self.revision
return should != current ? should : current
end
def revision
if !@rev
if File.exist?(tag_file)
contents = File.read(tag_file).strip
# Note: Doesn't differentiate between N and T entries
@rev = contents[1..-1]
else
@rev = 'HEAD'
end
debug "Checkout is on branch/tag '#{@rev}'"
end
return @rev
end
def revision=(desired)
at_path do
runcvs('update', '-dr', desired, '.')
update_owner
@rev = desired
end
end
private
def tag_file
File.join(@resource.value(:path), 'CVS', 'Tag')
end
def checkout_repository
dirname, basename = File.split(@resource.value(:path))
Dir.chdir(dirname) do
args = ['-d', @resource.value(:source)]
if @resource.value(:compression)
args.push('-z', @resource.value(:compression))
end
args.push('checkout')
if @resource.value(:revision)
args.push('-r', @resource.value(:revision))
end
args.push('-d', basename, module_name)
runcvs(*args)
end
end
# When the source:
# * Starts with ':' (eg, :pserver:...)