Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Config files-variables not being replaced when deployed

    Scheduled Pinned Locked Moved Support
    buildmaster
    5 Posts 2 Posters 2 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jstarbird_7831
      last edited by

      I am trying to use the Configuration file management but it doesn't seem to be working.
      I have my config file in place and I have a couple of values that are based on variables but when I deploy it none of the values get replaced.
      Is there something else I am supposed to do? I noticed the older version used to have a flag to enable the variables to be replaced but there is no option for this anymore.

      Also, I initially thought that was what the templates were for but that didn't work like I thought either.
      Could you point me to something that shows a good example of using the config files and the templates or explain the usage a bit better.

      Thanks,
      Jon

      Product: BuildMaster
      Version: 4.9.5

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        Just wanted to add a little, when I try to use the Template method described in your docs the Config file ends up with just the template as it's content.

        So example, config file looks like:

        <appsettings>
        <add key="somekey" value="%myvarname%"/>
        </appsettings>

        Template has:
        myvarname=sometext

        All is saved with correct references to the template from the config file entry. THen on deplyment the config file ends up as:

        myvarname=sometext

        nothing else just whats in the template.

        So that's why I thought maybe I wasn't using it correctly.

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Hi Jon,

          If I'm reading correctly, it sounds like you have them backwards.

          Config File Template:

          <appsettings>
              <add key="Vendor.ApiKey" value="%VendorApiKey%"/>
          </appsettings>
          

          Config File Instance (Int):

          Vendor.ApiKey=123test456fake789key
          

          Config File Instance (Test):

          Vendor.ApiKey=123test456fake789key
          

          Config File Instance (Prod):

          Vendor.ApiKey=2n039f23flknslkvn2a
          

          Tjhis way, when you deploy the config file, the app key will be set with the appropriate key./.value pair.

          If you choose to you use variables inside of your config file (instead of, or in addition to, templates) , you will need to opt-in to apply a replacement on the file in the deploy config file action; it's a checkbox.

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            Thanks. I was going by a previous post, http://inedo.com/support/questions/5 , and the way it's worded is that the template contains the key value pairs.

            Even in your regular doc is sort of hard to tell which area you're supposed to put the key value pairs.

            In any event, thanks for the clarification!

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              Thanks Jon, I can how that was ambiguous! I've now updated it w/ more accurate info.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post
              Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation