Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

publish website in specified path using msbuild command line

i want to publish my web site using msbuild command line.my requirement is below mentod

  1. get the latest code from sever and stored in specified folder.this is done by folloing code

    <Target Name="GetSource">
    <Message Text="Checking out trunk into $(SourceDirectory)" />
    <SvnCheckout RepositoryPath="$(SvnCheckoutPath)"
        LocalPath="$(CheckOutPath)"
        UserName="aaa"
        Password="aa">
    
    
      <Output TaskParameter="Revision" PropertyName="Revision" />
    
    </SvnCheckout>
    <Message Text="Have got revision: $(Revision)"/>
         </Target>
    

    i have achived to get update code in specified folder.(1st reqirement is done)

2.build 3.publish to spcific path

so could you please tell me how to achieve 2 and 3 requirement.??

like image 256
user2459106 Avatar asked Sep 09 '26 21:09

user2459106


1 Answers

You could create a new target for "Publish" and from a command line, specify the target and include a parameter that contains the path where you'd want to publish the web site.

<Target Name="Publish">
<PropertyGroup>
  <PublishDirectory>$(PublishDirectory)</PublishDirectory>
</PropertyGroup>

<!-- publish logic using a copy files task or custom task goes here -->
</Target>

From a command line, invoke MSBUILD specifying the target to execute and the path to publish:

msbuild.exe /t:Publish /p:PublishDirectory="D:\InetPubExt\HomeApp\"

That should get you started :)

like image 60
Nicodemeus Avatar answered Sep 12 '26 10:09

Nicodemeus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!