« Previous Next »

Thread: Why I have to run the msdeploy twice to make rename rule working

Last post 11-18-2008 7:41 PM by yaminij. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 11-18-2008, 3:53 AM

    Why I have to run the msdeploy twice to make rename rule working

    I want to rename different config files into web.config,

    Here is my rule of renaming qa.config into web.config

    <rule name="MYQA" enabled="false"
            type="Microsoft.Web.Deployment.DeploymentReplaceRule" isDefault="true"
            objectName="filepath" targetAttributename="path"
            match="qa.config" replace="web.config"/>

    <rule name="MYPROD" enabled="false"
            type="Microsoft.Web.Deployment.DeploymentReplaceRule" isDefault="true"
            objectName="filepath" targetAttributename="path"
            match="prod.config" replace="web.config"/>

       

    Here is my command

    MSDeploy.exe -verb:sync -source:contentPath=C:\1abc  -dest:contentPath=C:\2abc  -enablerule:MYQA

     

    I am puzzuled by the result. 

    When I run the command for the first time, all files are copied, but MYQA rule doesn't trigger

    If I run the command again, then rules kicks in.

    Is there anything I did wrong?

     

    Thanks

     

  • 11-18-2008, 2:13 PM In reply to

    • yaminij
    • Top 50 Contributor
    • Joined on 09-25-2007, 12:41 AM
    • Posts 182

    Re: Why I have to run the msdeploy twice to make rename rule working

    It seems to work well for me. Is your directory structure very simple? If yes, can you share it out with us?

    Thanks
    Yamini Jagadeesan, SDET, Microsoft IIS Team
  • 11-18-2008, 6:20 PM In reply to

    Re: Why I have to run the msdeploy twice to make rename rule working

    Thank you for your response.

    My directory structure is indeed super simple test site, just a root with two sub folder.

    Root: c:\1abc (root folder with 6 files and 2 sub -folders)

    • qa.config
    • prod.config
    • dev.config
    • web.config
    • test.htm
    • test.aspx
    c:\1abc\admin (a sub folder with 6 files )
    • qa.config
    • prod.config
    • dev.config
    • web.config
    • test.htm
    • test.aspx
     c:\1abc\user (another sub folder with 6 files )
    • qa.config
    • prod.config
    • dev.config
    • web.config
    • test.htm
    • test.aspx
     
     
  • 11-18-2008, 7:12 PM In reply to

    Re: Why I have to run the msdeploy twice to make rename rule working

     Here is the console display for the first run

    C:\Program Files\IIS\Microsoft Web Deploy>MSDeploy.exe -verb:sync -source:conten
    tPath=C:\1abc  -dest:contentPath=C:\2abc  -enablerule:MYQA
    Action: Adding child dirPath (C:\2abc\admin)
    Action: Adding child filePath (C:\2abc\admin\dev.config)
    Action: Adding child filePath (C:\2abc\admin\prod.config)
    Action: Adding child filePath (C:\2abc\admin\web.config)
    Action: Adding child filePath (C:\2abc\admin\test.aspx)
    Action: Adding child filePath (C:\2abc\admin\test.htm)
    Action: Adding child filePath (C:\2abc\admin\web.config)
    Action: Adding child dirPath (C:\2abc\user)
    Action: Adding child filePath (C:\2abc\user\dev.config)
    Action: Adding child filePath (C:\2abc\user\prod.config)
    Action: Adding child filePath (C:\2abc\user\web.config)
    Action: Adding child filePath (C:\2abc\user\test.aspx)
    Action: Adding child filePath (C:\2abc\user\test.htm)
    Action: Adding child filePath (C:\2abc\user\web.config)
    Action: Adding child filePath (C:\2abc\dev.config)
    Action: Adding child filePath (C:\2abc\prod.config)
    Action: Adding child filePath (C:\2abc\web.config)
    Action: Adding child filePath (C:\2abc\test.aspx)
    Action: Adding child filePath (C:\2abc\test.htm)
    Action: Adding child filePath (C:\2abc\web.config)
    Change count: 20
     

    Here is the display from second run 

     
    C:\Program Files\IIS\Microsoft Web Deploy>MSDeploy.exe -verb:sync -source:conten
    tPath=C:\1abc  -dest:contentPath=C:\2abc  -enablerule:MYQA
    Action: Adding child filePath (C:\2abc\admin\web.config)
    Action: Adding child filePath (C:\2abc\user\web.config)
    Action: Adding child filePath (C:\2abc\web.config)
    Change count: 3

     

    THANKS again for looking into this issue

  • 11-18-2008, 7:41 PM In reply to

    • yaminij
    • Top 50 Contributor
    • Joined on 09-25-2007, 12:41 AM
    • Posts 182

    Re: Why I have to run the msdeploy twice to make rename rule working

    From your output, it does look like the MYQA rule did kick in on the first sync. As per the MYQA rule, all the qa.config files should become web.config files. If you look at c:\2abc after your first sync, you should only find web.config files, which is what you expect. But again, since you already have a web.config file under the same path, it might get overwritten. You can do a -verbose to see how its getting overwritten.

    Thanks
    Yamini Jagadeesan, SDET, Microsoft IIS Team
Page 1 of 1 (5 items)