Giter Club home page Giter Club logo

Comments (6)

ncstate-mafields avatar ncstate-mafields commented on June 26, 2024

In my opinion, switching to a webhook based workflow instead of a regular cronjob is a better solution for what you're looking for. Having r10k only run when there are changes to the control repo means that every time r10k runs there is something that did change. You can then use the $modifiedenvs value passed to the postrun script for the script to know which environments need to be reloaded, and only reload those environments.

from r10k.

tparkercbn avatar tparkercbn commented on June 26, 2024

I agree that webhooks is 100% the way to go however there are lots of ocasions where I have a module change that is defined in my control repo as 'main' that needs to trigger a pull on r10k but that doesn't always trigger a change to the control repo... Is there a list of environment variables documented somewhere that are passed to the postrun script? (I'm going to grep the source now that you have provided me with one)

from r10k.

ncstate-mafields avatar ncstate-mafields commented on June 26, 2024

Nothing is passed into the script by default, so you have to explicitly define it as an argument in the config file.

postrun: ['/usr/local/bin/r10k-postrun', '$modifiedenvs']

The only reference to it I've found in the docs has been here: https://github.com/puppetlabs/r10k/blob/28232fa24f04925af666f3dc603df5bcbfdb2bc7/doc/dynamic-environments/configuration.mkd

from r10k.

nabertrand avatar nabertrand commented on June 26, 2024

I agree that webhooks is 100% the way to go however there are lots of ocasions where I have a module change that is defined in my control repo as 'main' that needs to trigger a pull on r10k but that doesn't always trigger a change to the control repo...

In this case, you could still use a webhook that triggers a different command to run, e.g.

r10k deploy module main

This causes all environments that have the module main to pull in the change. I believe you can then additionally use the $modifiedenvs variable with a postrun script to trigger reloads, etc.

from r10k.

ncstate-mafields avatar ncstate-mafields commented on June 26, 2024

Yes, we use the webhook functionality provided by the voxpupili r10k puppet module, which has two endpoints: one for control-repositories which will deploy environments, and one for modules which will deploy the module.

https://github.com/voxpupuli/puppet-r10k/blob/master/templates/webhook.bin.erb

from r10k.

binford2k avatar binford2k commented on June 26, 2024

Closing, as the webhook functionality appears to be a better approach.

from r10k.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.