Close

Plugin deleted when running the batch files to deploy the website

creative3k
13 years ago
#70 Quote
Avatar
  • 18
Hi ,

I came across a problem , all your extensions worked fine on my localhost, but when i ran the batch files to deploy it on-line , all the extension plugin were deleted , I have to reconfigure it on the server , Is this known issue or I might have done something wrong , just need to confirm it
Support
13 years ago
#71 Quote
Avatar
  • Moderator
  • 1044
Hi creative3k,

You need to manually copy any plugins that are not part of nopCommerce default plugins.
Here is some more information about how the Deploy.bat works.

Running Deploy.bat does the following:
1. Deletes the Deployable folder content. That's why everything there gets deleted.
2. Builds your NopCommerce.sln solution .
3. Copies what is needed in the Deployable folder - the web site and the plugins.

Deploy.bat file does NOT copy everything from Presentation\Nop.Web\Plugins folder. It copies only the plugins that nopCommerce knows about.
You can control, which plugins to be copied to the Deployable folder in the nop.plugins.targets file located in your Build folder.
As our plugins are not included in nop.plugins.target file you can't expect them to be automatically copied in the Deployable folder.
So it is not an issues and you are not doing anything wrong it is just how nopCommerce deployment process works.

Hope this helps!

Best Regards,
Nop-Templates Team
creative3k
13 years ago
#72 Quote
Avatar
  • 18
Hi ,

Should i modify the nop.plugins.targets something like this:

<Target Name="Plugins-CopyToWeb"
            DependsOnTargets="
            Plugins-CopyDiscounts;
            Plugins-CopyExchangeRates;
            Plugins-CopyExternalAuth;
            Plugins-CopyFeeds;
            Plugins-CopyMisc;
            Plugins-CopyPayments;
            Plugins-CopyShippings;
            Plugins-CopySms;
            Plugins-CopyTaxes;
            Plugins-CopyWidgets;
      Plugins-CopySevenSpikes">
      
      
      <!--SevenSpikes plugins-->
    <Target Name="Plugins-CopyExchangeRates">
        <MSBuild Projects ="$(MSBuildProjectFullPath)"
                        Targets="Plugin-CopyToWeb"
                        Properties="
                        PluginProjectName=Nop.Plugins.HomePageSliders"/>
        <MSBuild Projects ="$(MSBuildProjectFullPath)"
                        Targets="Plugin-CopyToWeb"
                        Properties="
                        PluginProjectName=Nop.Plugins.NopQuickTabsange"/>
    <MSBuild Projects ="$(MSBuildProjectFullPath)"
                        Targets="Plugin-CopyToWeb"
                        Properties="
                        PluginProjectName=Nop.Plugins.SmartSEO"/>
    </Target>
Support
13 years ago
#73 Quote
Avatar
  • Moderator
  • 1044
Yes, but for our plugins you should call 7SpikesPlugin-CopyToWeb target instead of Plugin-CopyToWeb. Don't forget to add the new target in the file nop.plugins.targets
Here are detailed steps how to do it:

1. Add 7SpikesPlugin-CopyToWeb target in the nop.plugins.targets file.


<Target Name="7SpikesPlugin-CopyToWeb">      
      <Message Text="Copy $(PluginProjectName) plugin to Web" />  
    
        <PropertyGroup>
            <From>$(WebPluginsFolder)\$(PluginProjectName)</From>
            <To>$(PluginOutput)\$(PluginProjectName)</To>
        </PropertyGroup>
        <RemoveDir Directories="$(To)" />
        <MakeDir Directories="$(To)" />

    <!-- Copy all folders recursively as some of our plugins have folders i.e Styles, Resources etc. -->
        <CreateItem Include="$(From)\**\*.*">
            <Output TaskParameter="Include" ItemName="CompileOutput" />
        </CreateItem>
        <Copy SourceFiles="@(CompileOutput)"
                DestinationFolder="$(To)\%(RecursiveDir)" />
        
        <!--<RoboCopy SourceFolder="$(From)" DestinationFolder="$(To)"/>-->
        <Error Condition="!Exists('$(To)')" Text="There was a problem coping plugin '$(PluginProjectName)'." />
        <Message Text="Succesfully copied plugin '$(PluginProjectName)'" Condition="Exists('$(To)')"  />
    </Target>

2. Add another target Plugins-CopySevenSpikes in which call all needed 7Spikes plugins one by one i.e Home Page Sliders plugin.

<Target Name="Plugins-CopySevenSpikes">  
    <Message Text="Copy Seven Spikes plugins" />

<MSBuild Projects ="$(MSBuildProjectFullPath)"
                        Targets="7SpikesPlugin-CopyToWeb"
                        Properties="PluginProjectName=SevenSpikes.Core"/>

<MSBuild Projects ="$(MSBuildProjectFullPath)"
                        Targets="7SpikesPlugin-CopyToWeb"
                        Properties="PluginProjectName=SevenSpikes.Nop.Plugins.HomePageSliders"/>
</Target>
  
3. In the Deploy target in nop.proj file call the Plugins-CopySevenSpikes target.

<!--Lets copy 7Spikes plugins to the deployed directory-->
    <MSBuild Projects ="$(MSBuildProjectFullPath)"
                    Targets="Plugins-CopySevenSpikes"
                    Properties="
                        PluginOutput=$(DeployFolder)\$(DeployPrefix)\Plugins\"/>

That's all you have to do in order the Deploy.bat file to copy our plugins to the Deployable folder given our plugins are already in Presentation\Nop.Web\Plugins
creative3k
13 years ago
#75 Quote
Avatar
  • 18
Will do that later tonight and will update you on it , by the way this can be added in the extensions manuals.