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



  • 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



  • 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.



  • 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.



  • 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!



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


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation