Commit Graph

69 Commits

Author SHA1 Message Date
Clark Boylan 3737cccbc1 Checkout local revision if not tag/remote branch.
When the supplied git revision is not a tag or remote branch checkout
the revision locally.

Change-Id: I42bdd4e089036d7520d63067862b0be7245c998f
Reviewed-on: https://review.openstack.org/17568
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-12-21 01:08:02 +00:00
Clark Boylan c038985e59 Checkout tags properly.
Previously the tag checkout code would checkout a new branch for the tag
using the current branch (master) as the base for the new branch.
Instead use the actual tag as the base for the tag branch.

Change-Id: Ic18bad7d19da3298b73f3e4185ca0bb5d4b3bf04
Reviewed-on: https://review.openstack.org/16030
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2012-11-14 18:45:21 +00:00
Monty Taylor 44eb9ad8f7 Fix git vcsrepo support.
ensure => latest should work and trigger when the remote has new
revs, and not at other times. It will handle tags and branches apparently
and will also handle not specifying a branch in the revision.
2012-08-12 00:46:58 -04:00
Monty Taylor 224e2ce3d5 Fix support for wanting a specific tag. 2012-08-11 14:30:29 -04:00
Eric Hayes 4d2942edc2 Run git operations as a specific user (puppetlabs ticket 4773), added ssh options to ensure no prompting (also fixed in pull request #1 by riseuplabs), added ability to keep repository up to date with latest (puppetlabs ticket 11278) 2012-06-29 02:50:12 -07:00
James Turnbull 493dc2172b Merge pull request #24 from jesusaurus/feature/git
Add the ability to specify a git remote
2012-05-23 10:22:57 -07:00
Jesusaurus dce22cfd2d Add the ability to specify a git remote
Rather than fill the git provider with hard-coded references to
origin, it would be better to abstract out which remote the resource
is fetching from.  But since this is only relevant to decentralized
version-control systems, a multiple_remotes feature was added for
the parameter to depend on.  So far this is only implemented for git
remotes, but it could be implemented for other VCSs as well.
2012-05-13 01:55:47 -07:00
Andreas Gerstmayr 0f362a13bf add begin/except for hg pull (mercurial 2.1 returns 1 for hg pull when no changes are found; this change gets reverted in mercurial 2.1.1) 2012-03-18 17:26:54 +01:00
Andreas Gerstmayr c9bcd68953 don't recreate bare repo if it exists already (fixes #12303) 2012-02-26 18:15:10 +01:00
Matt Robinson b931190b32 (#11798) Fix git checkout of revisions
The git provider had some problems checking out SHA1s - it couldn't.
And what's worse, it lied about what it was doing saying that it did
checkout the SHA1.

There was also a bug where if you specified a different branch than you
were on, it was doing a `reset --hard` to the specified branch.  For
example, if master was checked out, and you set "revision => stable", it
would `git reset --hard stable` on the master branch instead of just
checking out stable.  Maybe the original author did this to get around
being unable to checkout when you had local changes, but the --force
flag to checkout will fix that.

With this change, you should now be able to specify a branch, tag, or
SHA1 in the revision attribute and have it work.
2012-01-19 15:20:40 -08:00
James Turnbull c3dabc322b Merge pull request #15 from webfactory/fix_10787
Fix (#10787) - Various fixes/tweaks for the CVS provider
2011-12-26 15:42:13 -08:00
James Turnbull 33cca5123c Merge pull request #14 from webfactory/fix_10788
Fix (#10788) - Avoid unnecessary remote operations in the vcsrepo type
2011-11-26 00:51:31 -08:00
James Turnbull b4d763cef6 Merge pull request #13 from webfactory/cvs_module_name
Suggested fix for (#10751) by adding a "module" parameter
2011-11-26 00:51:03 -08:00
Marc Fournier a5ee22e457 Added missing 'working_copy_exists?' method. 2011-11-19 18:16:40 +01:00
James Turnbull 7d03bfca49 Merge pull request #12 from webfactory/fix_9083
Fix (#9083) as suggested by the original bug reporter.
2011-11-12 09:07:07 -08:00
Matthias Pigulla 924e13367b Fix owner/group as well (#10787) 2011-11-12 14:08:13 +01:00
Matthias Pigulla 9aa17796f9 Fix (#10787) - Various fixes/tweaks for the CVS provider 2011-11-12 13:31:01 +01:00
Matthias Pigulla 89e2583aa9 Fix (#10788) - Avoid unnecessary remote operations in the vcsrepo type 2011-11-12 13:27:56 +01:00
Matthias Pigulla 5866bba816 Fix (#10751) by adding a new "module" parameter for the CVS provider 2011-11-11 19:27:12 +01:00
Matthias Pigulla b5110938f5 Fix (#9083) as suggested by the original bug reporter. 2011-11-11 19:10:39 +01:00
Scott O'Neil 328d88ee59 Run update_owner_and_excludes after update_preferences and get_revision
These are called when the type is retrieve'd. Without this, the ownerships
for any .git metafiles fetch'd durring the retrieve will be owned by
root. This patch fixes that by invoking update_owner_and_excludes after
fetch'ng
2011-11-08 18:46:41 -06:00
Matthias Pigulla 18c039c8d1 Fix (#10440) by making all commands optional
This will work around the issue in http://projects.puppetlabs.com/issues/6907, as the agent run will no longer fail if one of the commands is not installed.

This gives you enough time to install the necessary packages through Puppet (make sure you get the dependencies right), as the agent won't fail unless you really start accessing the repository.
2011-11-03 00:44:18 +01:00
James Turnbull 4a89ed4d3b Fixed Bug #9219 - vcsrepo updates too often
If vcsrepo is used with ensure => latest to keep something from a larger repository checked out it will trigger an update every time something changes anywhere in the repository, not just in the part that’s actually checked out.

In combination with a busy development team and a vcsrepo resource with notify => Service[foo] this means frequent restarts of a service for no good reason.

The attached patch solves the issue by looking at the “Last Changed Rev” line from svn info instead of “Revision”.

Patch thanks to: Knut Arne Bjørndal
2011-08-29 01:15:51 -07:00
Nibalizer 18d4cf890c Merge pull request #6 from justintime/svn-basic-auth
Adding basic_auth feature and adding --non-interactive to all svn command
2011-08-18 10:56:51 -07:00
Justin Ellison d84d3e29c9 Forgot to add the parameters to the type definition. 2011-08-18 08:30:09 -05:00
Justin Ellison 75b2b690ab Adding in missing support for owner and group properties. 2011-08-17 11:10:34 -05:00
Justin Ellison abdcd73c60 Adding basic_auth feature and adding --non-interactive to all svn commands.
The basic_auth feature allows the manifest to specify an optional
basic_auth_username and basic_auth_password to be sent to the subversion
server over HTTP(S).

Adding --non-interactive to all svn commands just lets svn know that
there's not a user on the other end to send y/n questions.
2011-08-17 10:07:40 -05:00
Nate Mueller 26308908c7 Updated for ruby 1.9. Not sure how important this actually is. Works on both now. 2011-07-27 19:52:36 -07:00
Nate Mueller 16e2e1efc2 Fixed an issue with 8e51aebd4c that broke git when you didn't specify a revision 2011-07-27 19:52:03 -07:00
Nate Mueller 93815a9e4a Add an identity param, respected by the git provider, to use a non-standard ssh identity file 2011-07-27 19:28:23 -07:00
James Turnbull f2214bfe3d Merge pull request #3 from ody/bug/master/7797
Makes git tags actually work as a revision option.
2011-06-06 16:19:04 -07:00
Cody Herriges 8e51aebd4c (#7797) Makes git tags actually work.
Fixes a number of issues with the git provider.  remote_branch_revision?
  method was always returning true because it would always at least return
  something, even if that something was a zero length array.  You normally
  don't desire a tag to become a branch since it creates ambiguity so I
  removed that.  latest method had no concept of (no branch) and so would
  fail if you switched to a remote branch or a tag.  Then finally
  revision sha1 returned by 'git rev-parse' for tags is not the revision
  of the commit the tag represents.  We have to use 'git show' and do
  some text parsing to actually figure out which commit goes with which
  tag.
2011-06-06 10:42:24 -07:00
Marc Fournier 1dcf1647a7 Fix #7534: provider.revision should not get called when repo doesn't exist. 2011-06-03 21:57:36 +10:00
Aleksey Lim f31853d1c3 git: Update submodules recursively 2011-05-20 18:04:06 -07:00
Adam Gandelman 5b89b20928 git.rb: update_references before touching tags. tags created since last vcsrepo run fail otherwise 2011-05-20 18:04:06 -07:00
Aaron Bull Schaefer e481dec2c8 support setting the owner/group in hg provider 2010-12-27 15:47:00 +08:00
Aaron Bull Schaefer f1120f2d9b restructure conditional to fix Regexp.quote(nil) error 2010-12-27 15:47:00 +08:00
Aaron Bull Schaefer c002392871 add definitions for latest{,?} in hg provider 2010-12-27 15:47:00 +08:00
Aaron Bull Schaefer ca531df00f fix undefined method 'working_copy_exists?' error for ProviderHg 2010-12-27 15:46:59 +08:00
Brett Lentz d6f233e759 git: rework how to do excludes 2010-09-14 14:14:45 -07:00
Brett Lentz 21faae5015 git: correct checking out latest revision of a branch. 2010-09-14 11:24:14 -07:00
Brett Lentz 81787d4940 new features for vcsrepo.
* support recursive chown on repo
* support checking out tags (git)
* support adding excludes/ignored files
* dropped a few unused methods
* rework git provider logic a bit
2010-09-13 16:32:26 -07:00
James Turnbull f9f8a808fa Merge branch 'master' of git://github.com/reductivelabs/puppet-vcsrepo 2010-09-14 09:02:02 +10:00
James Turnbull e572002ab6 Fixed bomb out with an error concerning working_copy_exists? not
being defined for svn repos

Thanks to Bret S. Lambert for the patch
2010-09-14 09:00:34 +10:00
Aleksey Lim a71777b4ec Take into account :latest status in git provider 2010-08-20 14:25:11 +08:00
Aleksey Lim e984b0810e Support latest value for ensure property in git provider 2010-08-14 04:41:08 +08:00
James Turnbull 295b3cb16d Git provider fails to create a repo if it does not exist 2010-07-29 09:47:53 +10:00
mikeknox dd31bce565 When ensure => latest, svn didn't update.
svn provider now gets the latest revision from the repo, rather than the checkout
Test with revision => <some value> as well

now when ensure => latest, only refresh dependent resources if the
repo is actually updated

Tidied up debug messages
2010-07-22 09:19:38 +10:00
James Turnbull 4d40715919 Fixed git provider to retrieve tags 2010-06-01 10:04:15 +10:00
Bruce Williams 128e3e4a1d Fix typo.
Signed-off-by: Bruce Williams <bruce@codefluency.com>
2010-03-18 18:09:27 -07:00