summaryrefslogtreecommitdiff
path: root/lib/puppet/provider/vcsrepo/git.rb
AgeCommit message (Collapse)Author
2016-09-28Merge remote-tracking branch 'puppetlabs/master'HEADmastervarac
2016-02-23Merge branch 'master' of https://github.com/puppetlabs/puppetlabs-vcsrepovarac
2016-02-16Bring stderr output to the Puppet visible outputMarkus Frosch
2015-12-22Add mirror option for git cloningStrech (Sergey Fedorov)
Example: vcsrepo { '/path/to/repo': ensure => mirror, provider => git, source => 'git://example.com/repo.git', }
2015-12-02fix branch existence determintaion functionalitygodlikeachilles
this will stop failing in case there is a tag which is a substring of an existing branch name. for example if there is a tag 'release' and a branch 'release/integration' current code will match 'release/integration' with pattern 'release' and decide that a branch checkout is needed. but release branch does not exist so it will fail. this simple fix resolves the issue.
2015-09-01Merge pull request #257 from alexmv/masterDavid Schmitt
Explitly unset SSH_AUTH_SOCK; it is preferred to the -i flag
2015-08-25MODULES-1232 Make sure HOME is set correctlyMorgan Haskel
2015-08-17MODULES-2326 - Run Regexp.escape on the source URLMorgan Haskel
The URL can have special characters, making the regex match fail.
2015-08-14MODULES-2125 - Allow revision to be passed without sourceMorgan Haskel
Will also work with empty repositories.
2015-08-03MODULES-1800 - fix case where ensure => latest and no revision specifiedMorgan Haskel
This would explode when revision was unspecified when you were on a branch. Use the branch you're currently on when updating.
2015-07-22Explitly unset SSH_AUTH_SOCK; it is preferred to the -i flagAlex Vandiver
Even if the -i flag is explicitly passed via the command line, openssh ignores the identity file if an socket exists to an SSH authentication agent. In cases where puppet has been configured to use an explicit identity file, altering behavior based on the calling environment of puppet violates the principle of least surprise, and can lead to inconsistent deployments. Work around this odd corner case of ssh by explicitly unsetting SSH_AUTH_SOCK inside the ssh wrapper.
2015-06-29fix for detached HEAD on git 2.4+Samuel Keeley
2015-06-22Merge pull request #255 from jonnytpuppet/depth_fixDavid Schmitt
MODULES-2131 Git provider now takes account of revision property when using depth property.
2015-06-22MODULES-2131 Git provider now takes account of revision property when using ↵Jonathan Tripathy
depth property.
2015-05-28Merge pull request #232 from netors/masterDavid Schmitt
Consider the submodules flag on specific revision cloning
2015-05-13(MODULES-821) Don't use /tmpHunter Haugen
Very often /tmp is mounted noexec for security reasons related to it being writable by all users. This stopped vcsrepo's git provider from working. This pull request uses puppet's statedir as it is not writable by all users and is a good candidate for transient state like the git provider's identity script for the $GIT_SSH command. An alternative in the future that wouldn't require a temporary file is to set $GIT_SSH_COMMAND instead of $GIT_SSH, except this was added in git 2.3 and is too new to depend on.
2015-04-21Merge pull request #224 from puppet-by-examples/single-branchTP Honey
Shallow clone with one commit that corresponds to arbitrary tag from arbitrary branch
2015-03-25Fix remote hash ordering for unit testsColleen Murphy
Without this commit, the unit tests for the git provider changing multiple remotes mocks the remotes in a particular order. While in practice it doesn't matter which remote the update_remotes method updates first, the unit tests must be able to mock them in the correct order. For ruby 1.8.7, a Hash will not necessarily produce key value pairs in the same order on each run, which causes intermittent failures in the unit tests. This change sorts the :source property values before trying to update them, and updates the unit tests to expect the values in alphabetical order.
2015-01-30Bugfix: removed duplicated conditionErnesto Ruy Sanchez
2015-01-30Added submodules true condition before update_submodules on revision methodErnesto Ruy Sanchez
2015-01-29Use branch parameterWłodzimierz Gajda
2015-01-21Implemented multiple remotes feature for git provider.Jonathan Tripathy
2015-01-18Merge pull request #218 from dduvnjak/masterAaron Stone
Add submodules feature to git provider
2015-01-18Add submodules feature to git providerdduvnjak
2014-12-26MODULES-1596 - Repository repeatedly destroyed/created with forceMorgan Haskel
The `retrieve` method was calling `create` and `destroy` on every run with `force => true`. Retrieve should not be making any changes to the system, so removed that code, and updated `working_copy_exists` to make sure that the directory not only contains a `.git` directory, but also if `source` is specified it also matches `#{path}/.git/config` so that it will overwrite a git repo with a different source. Updated tests to not check for the old broken behavior. Added a regression test.
2014-10-21Merge pull request #200 from Paulche/change_uidAaron Stone
Change uid by Puppet execution API
2014-09-17Handle both Array/Enumerable and String values for excludes parameterAaron Stone
Thanks to @revhazroot for identifying the problem that excludes with a string or single-element array fails on Ruby >= 1.9.
2014-08-20Change uid by Puppet execution APIPaul Chechetin
2014-07-11(MODULES-660) Correct detached HEAD on latestHunter Haugen
Previously vcsrepo detached HEAD on checkout which caused further branch revisions to fail. This corrects the behavior, and works on git 1.7, 1.8, 1.9, and 2.0
2014-06-30Fix issue with node changing every checkinJoshua B. Bussdieker
2014-05-21Merge pull request #145 from hunner/fix_beaker_testsJohn Duarte
Update specs and fix FM-1361
2014-05-21Update specs and fix FM-1361Hunter Haugen
- Add install.rb for pre-suite - Add catches for failures/changes to manifest application - Correct root ssh key copying - Add sleeps for killing processes releasing ports - Fix FM-1361
2014-05-22Un-optional the non-optional commands.Daniele Sluijters
2014-05-15update to use -a and desired for hard resetTravis Fields
2014-05-15Fix detached head stateTravis Fields
2014-05-13Fix issue where force=>true was not destroying repository then recreatingTravis Fields
2014-02-12use `git rev-parse` to get tag canonical revision.Huan Du
2014-01-24Merge pull request #105 from mcanevet/no_suAshley Penney
Don't 'su' if passed user is current user
2014-01-11git: actually use the remote parameterMiguel Di Ciurcio Filho
When using the following sample, the provider does not use the value of remote when cloning a repository: vcsrepo {'/path/to/repo': ensure => 'present', provider => 'git', remote => 'test', source => 'git@somerepo:repo.git', } $ git remote origin This commit makes sure that the new repository has a remote with the supplied value. Closes #MODULES-430
2014-01-07Add the option to shallow clones with gitFelipe Reyes
The new parameter used to indicate that you want a shallow clone is `:depth`
2013-12-04Stripping git on_branch? return value; contains trailing newlineMike Gerwitz
This commit also contains git provider `latest' method formatting changes; squashed by request.
2013-12-02Using rev-parse to determine branch name of HEAD for on_branch? methodMike Gerwitz
2013-12-02origin/HEAD is not valid; use origin/master for latest when branch == 'master'Mike Gerwitz
2013-11-24Don't 'su' if passed user is current userMickaẽl Canévet
2013-09-07Due to a network anomaly during a vcsrepo git clone you can get aMicah Anderson
'non-repository' at the path. That can be even just an empty directory. This makes it so further puppet runs cannot ever complete properly, because of this error: change from absent to present failed: Could not create repository (non-repository at path) This requires manual intervention to resolve (ie. removing the directory). It is possible to pass the 'force => true' parameter to vcsrepo to handle this, however, all this will do is remove whatever is there, even if it is a valid repository. That means on every puppet run you get the tree removed and then a new clone is done. This is less than ideal for a number of reasons. So this commit adds a test to determine if the location contains a valid repository and then it is used when 'force => true' to determine if it should replace the existing content with a fresh clone. Note: the valid_repo? check is also added to the 'def bare_git_config_exists?' because the test that is done there is intended to look for a bare git repository by checking to see if there 'config' is in the directory. This isn't a particularly robust test because 'config' could be in a directory, when it isn't a bare git repository (such as is common in a rails app) causing vcsrepo to mistakenly think it was a proper bare repository, when it isn't.
2013-08-28update git provider to handle checking out into an existing (empty) dirJohn Iacona
2013-07-19Style adjustmentAaron Stone
2013-07-19WhitespaceAaron Stone
2013-07-17Use git checkout --force instead of short -f everywhereAaron Stone
2013-07-17Merge pull request #46 from Paulche/masterAaron Stone
Enable unlimited nesting for submodule updating