Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update plugins only if there is a newer version #108

Merged
merged 1 commit into from
Jan 20, 2015
Merged

Update plugins only if there is a newer version #108

merged 1 commit into from
Jan 20, 2015

Conversation

rudolfs
Copy link

@rudolfs rudolfs commented Jan 19, 2015

A 'git pull' always generates a change event in Puppet even if there are
no changes in the upstream repository. This is bad for monitoring, for
example the puppet dashboard always shows all the plugins installed by
rbenv-puppet as changes for every run on every node.

This change makes sure that 'git pull' is only run when there is a new
version of the plugin upstream.

A 'git pull' always generates a change event in Puppet even if there are
no changes in the upstream repository. This is bad for monitoring, for
example the puppet dashboard always shows all the plugins installed by
rbenv-puppet as changes for every run on every node.

This change makes sure that 'git pull' is only run when there is a new
version of the plugin upstream.
alup added a commit that referenced this pull request Jan 20, 2015
Update plugins only if there is a newer version
@alup alup merged commit b3ddecb into alup:master Jan 20, 2015
@@ -46,6 +46,7 @@
timeout => $timeout,
cwd => $destination,
require => Exec["rbenv::plugin::checkout ${user} ${plugin_name}"],
onlyif => 'git remote update; if [ "$(git rev-parse @{0})" = "$(git rev-parse @{u})" ]; then return 0; else return 1; fi ]',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason why we don't use vcsrepo here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no reason.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's see if i can patch this up to use vcsrepo instead…


see, #110

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't work.

==> default: Debug: Exec[rbenv::plugin::update vagrant ruby-build](provider=posix): Executing check 'git remote update; if [ "$(git rev-parse @{0})" = "$(git rev-parse @{u})" ]; then return 0; else return 1; fi ]'
==> default: Debug: Executing 'git remote update; if [ "$(git rev-parse @{0})" = "$(git rev-parse @{u})" ]; then return 0; else return 1; fi ]'
==> default: Debug: /Stage[main]/Devops/Devops::Ruby[devops_ruby]/Rbenv::Compile[1.9.3-p547]/Rbenv::Plugin::Rubybuild[rbenv::rubybuild::vagrant]/Rbenv::Plugin[rbenv::plugin::rubybuild::vagrant]/Exec[rbenv::plugin::update vagrant ruby-build]/onlyif: sh: -c: line 0: syntax error near unexpected token `]'

should be something more like this:

test `git remote update 1> /dev/null; if [ "$(git rev-parse @{0})" = "$(git rev-parse @{u})" ]; then echo 0; else echo 1; fi` -eq 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants