Uploaded image for project: 'R10K (moved to puppet.atlassian.net)'
  1. R10K (moved to puppet.atlassian.net)
  2. RK-378

Add "environment" getter to DSL

    XMLWordPrintable

Details

    • New Feature
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • r10k 3.13.1
    • None
    • 45486,46313
    • 2
    • Not Needed
    • Needs Assessment

    Description

       Customer runs into a problem where they're using the private API of an older version of r10k in their Puppetfile like this:

      We use the puppet_environment variable to set the default branch. For example:
       
      puppet_environment = File.basename(@librarian.basedir)
      default_branch = case puppet_environment
      when/^feature_/
      'development'
      else
      puppet_environment.split('_').first
      end
       
      Then for our repos we use the default_branch parameter
      :default_branch => default_branch
      

      It's been suggested that we add an environment or environment_name to get this functionality back ("So it looks like they want the "basedir" so they can get the name of the current environment so they can have a particular default_branch when doing feature branches. I think it would be a valid workflow (feature branch specifics are hard because you want them one way in the PR, but different when they're merged). I'd be happy to add an environment or environment_name getter to the DSL if other's are okay with it." - Justin Stoller)

      Outcomes

      • Add back the basedir getter
      • Add a deprecation warning for using basedir
      • Add an environment getter
      • Open a ticket for removing basedir in 4.0.0
      • Update docs in the r10k repo

      Attachments

        Issue Links

          Activity

            People

              jarret.lavallee Jarret Lavallee
              eric.putnam Eric Putnam
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support