Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Oct 25, 2018 @ 12:03
    Michaël Vanbrabandt
    0

    usyncbackoffice config transform during release pipeline

    Hi Kevin,

    working with usync for the first time here with the following setup:

    1. Laptop development environment
    2. VPS staging enviroment
    3. VPS production environment

    Each environment has its own database so first installed Umbraco nuget package in VS without running the installation process and deployed it to staging and production.

    Then we have run the installer local on laptop, on staging server and on production server.

    So each environment is completely seperated.

    I have installed uSync local and disabled import but in the release pipeline to staging and production this should be set to true.

    I am using VSTS Devops for CI/CD so was wondering if we can transform the usyncbackoffice.config just like a web config using:

    https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/transforms-variable-substitution?view=vsts

    or will this fail and should we do it in another way or do we have to set this to false always and run the import manual on each environment?

    /Michaël

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Oct 25, 2018 @ 12:08
    Dave Woestenborghs
    100

    We use SlowCheetah plugin file for having config transforms on other files than web.config

    Dave

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Oct 25, 2018 @ 12:22
    Michaël Vanbrabandt
    0

    Dave,

    thanks will have a look at it!

    /Michaël

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Oct 28, 2018 @ 09:47
    Michaël Vanbrabandt
    0

    Worked perfectly Dave! Thx!

    /Michaël

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Oct 25, 2018 @ 12:48
    Kevin Jump
    4

    there are a couple of things you can transform directly in the web.conifg (and they over take the settings in the file)

    <add key="uSync.Import" value="true|false" />
    <add key="uSync.ExportAtStartup" value="true|false" />
    <add key="uSync.ExportOnSave" value="true|false" />
    <add key="uSync.HandlerGroup" value="[groupname]" />
    

    will override the settings in the uSyncBackoffice.config file.

    but personally on VSTS i use parameters.xml

    https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/web-deployment-in-the-enterprise/configuring-parameters-for-web-package-deployment

    which looks something like this :

      <parameter name="uSync.HandlerGroup"
                 description="Handler Group for uSync"
                 defaultValue="#{uSync.HandlerGroup}#"
                 tags ="">
    
        <parameterEntry
            kind="XmlFile"
            scope="uSyncBackOffice\.config$"
            match="/uSyncBackOfficeSettings/HandlerGroup/text()" />   
      </parameter>
    

    and when setup will replace the value from the VSTS Variables (in this case uSync.HandlerGroup)

  • Bjarne Fyrstenborg 1284 posts 4038 karma points MVP 8x c-trib
    Nov 01, 2022 @ 07:44
    Bjarne Fyrstenborg
    0

    Hi Kevin

    Is it also possible to override Folder via transform of web.config?

    e.g. locally in Config/uSync8.config:

    <Folder AllowUnsafe="True">~/../MyOtherProject.Presentation/data/uSync/v8/</Folder>
    

    and then use this in web.config transform.

    <add key="uSync.Folder" value="~/uSync/v8/" />
    
  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Nov 01, 2022 @ 08:00
    Kevin Jump
    0

    Hi,

    Yes that should work - The web.config value will take precedence over the one in the uSync8.config.

    So if its present in web.config it will always win, but if the value is put in via a transform (e.g it's in web.release.config) then it would be true on your builds and not your local site.

Please Sign in or register to post replies

Write your reply to:

Draft