We're using addon support to extend ycommercewebservices. It's cool and convenient feature, however we've got a problem - we need to execute ant task addoninstall on every machine to add our addon dependency to ycommercewebservices template:
ant addoninstall -Daddonnames="someAddon" -DaddonStorefront.ycommercewebservices="ycommercewebservices"
What is the best way to automate this process?
You should not be building from ycommercewebservices every time. This is a template extension, hence starting with 'y'.
Generate a new extension from ycommercewebservices using extgen. Add your addons to the new extension. Commit this new extension to your repo. Never touch the templates directly.
So there should never be a need to automate this.
But its just an ant task. How hard is that to automate?
I hit this same issue and created an ant build callback to automatically install a list of addons.
Add the following lines to the _before_build macro in the buildcallbacks.xml of the extension to which you want the addon(s) installed:
<!--
We have included installing the relevant addons as a build callback so that each developer does not need to insatll them manually.
The Hybris installer script cannot be used as it resets the environment configuration (local.properties) every time it runs.
-->
<echo message="Installing the following addons: ${EXTENSION_NAME.requiredAddons}" />
<var name="addonnames" value="${EXTENSION_NAME.requiredAddons}" />
<var name="storefrontTemplates" value="yacceleratorstorefront" />
<var name="addonStorefront.${storefrontTemplates}" value="EXTENSION_NAME" />
<addoninstall />
<!--
This regex replace removes the additional blank lines that the addoninstall macro adds each time it is called.
It stops the extensioninfo.xml file continuously growing.
-->
<replaceregexp file="${ext.EXTENSION_NAME.path}/extensioninfo.xml"
match="\n{3,}"
replace="${line.separator}${line.separator}"
flags="g"
byline="false" />
You will need to replace all occurrences of EXTENSION_NAME with the real name of your extension.
You will also need to add a new property to the project.properties of your extension EXTENSION_NAME.requiredAddons which will have a comma-separated list of the addons you wish to have installed.
Using this macro, the addons will be re-installed on every build, which should be fine. I personally don't recommend that you commit the files where they are installed - instead commit the addon itself and install it on every build.
Hope this works for you.
Purpose of addon is to plug it in any standard hybris store.
Consider you are using git in development of all extension and addon. Now once you install addon on any extension. That extension's extensioninfo.xml file is modified. Hence if you installed addon on one machine you can commit this file(extension's extensioninfo.xml). It will be reflected in every machine which share this GIT codebase.
Related
i am using hybris version 2005
I installed addon with this command
ant addoninstall -Daddonnames="notificationaddon" -DaddonStorefront.yacceleratorstorefront="myStorefront"
How can I run adon without using this command on all devices? Where should I add what settings
Afaik there is no need to install an addon on all "devices", the addoninstall call changes two files in the destination extension e.g. the storefront extension:
myStorefront/.classpath
myStorefront/extensioninfo.xml
These files are usually under source control, so if you commit them, every time the project is built there is an ant macro that copies the addon into the extension directory.
Additionally, the addon should be added to the localextensions.xml, usually there is an template for the local dev env and the production, both should be updated.
I understand by devices, you mean the servers? If this is right, then you do not have to run this on servers. Instead, let the CI script take care of this. Based on the deployment strategy, your script would automatically run this command and the addons get installed on the storefront.
Every Addon does different work and requires a different way of inclusion.
The add on has a file project.properties.template that contains the properties that become active once you install the addon.
The addon has build.xml that is used to build that along with the storefront extension, whenever called back.
The source code including the java and XML that gets compiled along with the storefront. An AddOn can override any resource in the storefront extension.
For further information, please visit the Addon Concept illustrated in SAP help portal.
When I deploy package to test server, all parameters that are in project scope are not available. (they are all in project.params) file.
Here is how we deploy and run packages?
Prior SSIS 2012, I would have xxx.dtsx and xxx.dtsConfig in folder, then we would have script that uses DTEXEC tool to execute package. Our scheduling tool runs jobs/script hourly, daily, monthly, etc...
Now, with SSIS 2012, they got away with configuration and introduced parameters. Now in my package deployment folder, I have only xxx.dtsx and project.params files. Project.params file contains all variables that I decided to parametrize. While this work nicely when debugging in VS2012, once deployed, it doesn't work at all.
Any advice on what to do here?
Thanks
For non-project based connections, when you run the package, it'd take a form like
dtexec /file MyPackage.dtsx
However, for project based connections, you need to include the project (.ispac) in the dtexec call. Otherwise, you'll end up with missing connection or project parameter errors
dtexec /package MyPackage.dtsx /project MyProject.ispac
I am using Microsoft's AjaxMin to minify javascript on my website, which is hosted by Azure. I am using a BuildTask to automatically minify javascript at run time. This build task is specified in the .csproj file.
The process is working on my local environment, however, it does not work when I deploy to my Azure site. The azure site throws 404: file not found errors, when i try to reference the minified version of .js files.
Is it possible to use build tasks on an Azure site? Is there anything I am missing? I have made sure not to include the .min.js files in source control as this (http://www.asp.net/ajaxlibrary/AjaxMinQuickStart.ashx) tutorial suggests, but I am wondering if there is anything specific to Azure that I need to set up.
Thanks!
I've got this working properly in my projects. I'll tell you how I did it, though this may not be the simplest or most straightforward way.
Before we get started, it's helpful to be able to check if your minified files are included in the Azure deployment package without actually deploying. It's pretty easy to do. The .cspkg file is actually a zip-formatted file, so you can open it with any zip archiver. (I like to use 7Zip for this because the right-click -> Open Archive command doesn't require you to rename the file, but you could use Windows Explorer, WinRAR, etc.) Inside the .cspkg you'll see another large file with a .cssx extension. That's a zip file too. Inside of the .cssx you'll find a sitesroot folder with a subdirectory for each website you're deploying, which will contain all your actual website files. So you can poke around in there and see what files are being deployed to Azure.
First, try editing the project file for your web project (the one that contains all the Javascript/CSS files). You can use Notepad, or in Visual Studio right-click the project, select "Unload Project", then right-click again and select "Edit ". Inside the project file, insert a section like this:
<ItemGroup>
<!-- Copy over all the minified CSS & JS to the output directory-->
<Content Include="**\*.min.css" />
<Content Include="**\*.min.js" />
</ItemGroup>
Then reload the project, repackage it, and see if your files are included in the .cspkg file. If they are, then you're done.
If not, there are a couple other things to check. Your minification might not be running at the right build stage. My minification target looks like this:
<Target Name="PrepWebApp" Condition="$(Configuration)=='Release'" AfterTargets="AfterBuild">
If that's still not working and your Web Role has multiple Sites and/or Virtual Applications in it, it's possible that the packaging steps are not running for all of the sites. So when you go to package your project for deployment to Azure, it may still not be running the minification step (along with the web.config transformations, and some other things). If that's the case, see this blog post for a way to fix it.
Just in case that blog post goes away, I'll copy the most relevant bit here. You would put this in the .ccproj file for your web role (with appropriate bits changed to match your project structure):
<PropertyGroup>
<!-- Inject the publication of "secondary" sites into the Windows Azure build/project packaging process. -->
<CoreBuildDependsOn>
CleanSecondarySites;
PublishSecondarySites;
$(CoreBuildDependsOn)
</CoreBuildDependsOn>
<!-- This is the directory within the web application project directory to which the project will be "published" for later packaging by the Azure project. -->
<SecondarySitePublishDir>azure.publish\</SecondarySitePublishDir>
</PropertyGroup>
<!-- These SecondarySite items represent the collection of sites (other than the web application associated with the role) that need special packaging. -->
<ItemGroup>
<SecondarySite Include="..\WebApplication1\WebApplication1.csproj" />
<SecondarySite Include="..\WebApplication2\WebApplication2.csproj" />
</ItemGroup>
<Target Name="CleanSecondarySites">
<RemoveDir Directories="%(SecondarySite.RootDir)%(Directory)$(SecondarySitePublishDir)" />
</Target>
<Target Name="PublishSecondarySites" Condition="'$(PackageForComputeEmulator)' == 'true'
Or '$(IsExecutingPublishTarget)' == 'true' ">
<!--
Execute the Build (and more importantly the _WPPCopyWebApplication) target to "publish" each secondary web application project.
Note the setting of the WebProjectOutputDir property; this is where the project will be published to be later picked up by CSPack.
-->
<MSBuild Projects="%(SecondarySite.Identity)" Targets="Build;_WPPCopyWebApplication" Properties="Configuration=$(Configuration);Platform=$(Platform);WebProjectOutputDir=$(SecondarySitePublishDir)" />
The build task will run in Visual Studio when you build the project. You need to make sure that the minified files are also being deployed to Azure.
I'm guessing that perhaps because the item is being generated at build-time that it's not part of the project itself, and is this ignored by the deployment step.
Please check that the deployment system being used will include all the script files and not just the ones that are in the project itself.
I'm setting up an Orchard CMS project with the intention of creating a module to house my MVC 3 application. This application has already been started and has 5 projects already. One web project, some test projects and a workflow project.
Requiring that the web project (and therefore the other 4 projects for simplicity) lives within /Orchard.Web/Modules/ is a minor inconvenience - is it possible to change where Orchard looks (or add a new location) when dynamically loading the modules?
It's not a massive deal, but a nice to have for this project.
In an ideal world i'd be able to have:
/OrchardStuff/Orchard.Web
/OrchardStuff/etc
/MyStuff/MyProj.Web
/MyStuff/MyProj.Tests
I know i can arrange my sln in a nice usable way, would be nice if i could replicate this in the file system.
Cheers.
Wouldn't be easier to add an afterBuild task in your web project to copy the application to the Orchard's modules directory?
Something like that in the csproj file would do the trick (sort of, I am not entirely sure of my syntax. :'( )
<Target Name="AfterBuild">
<ItemGroup>
<AppFiles Include="**\*.*"/>
</ItemGroup>
<Copy SourceFiles="#(AppFiles)"
DestinationFiles="#(AppFiles->'..\OrchardStuff\Orchard.Web\Modules\MyModule\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
The MSDN documentation is here: http://msdn.microsoft.com/en-us/library/3e54c37h.aspx
The solution I used is adding the following line to post-build operation:
if not exist "$(SolutionDir)..\Orchard\src\Orchard.Web\Modules\$(ProjectName)" mklink /D "$(SolutionDir)..\Orchard\src\Orchard.Web\Modules\$(ProjectName)" ""$(ProjectDir)"
This command creates a symlink of your dev folder inside Orchard's Modules folder (only if such symlink doesn't already exist).
It has the following advantages over #Eilistraee's answer:
If you change Javascript/CSS file in your dev machine, you don't need to build the project to get the changes into Orchard.
You don't get duplicate files on your drive
Post-build is a more explicit option and the macro variables make it easy to copy to any new module.
No that's not possible without some major efforts. Not worth it.
CruiseControl.NET service needs to be restarted to pick up changes in the projects configuration files.
I find this very annoying, not sure if it's a bug or it's the way it works.
Is there any way to overcome this issue in people's experience?
If your projects are separated in a different file from ccnet.config, then you need to restart the service unless you touch the actual ccnet.config.
We use ENTITY with SYSTEM file reference in ccnet.config for our projects, so we're in the same boat. I'm happy to pay the price for easier project maintenance, as it's easy to script a restart:
net stop CCService
net start CCService
IISRESET
If you wanted to completely automate this, and had your projects under source control, then you could trigger an update and restart whenever your project files are touched.
There was a bug in CC.Net prior to 1.4.4 if you were using a pre-processor include it did not reload the configuration when an included ccnet.config file was modified.
That was a bug that I reported and it is fixed in CC.Net 1.4.4 and greater.
Also, keep in mind that if a build is running and there is a change to the configuration it will not take place until that build is in an idle state.
How are you updating your config files? By hand? Mine always recognizes and adjusts. Is your config file in source control and designed to pull it down and replace the file? This for me requires a kick. How I ended up fixing it was have my project pull it down to a seperate folder. THen I call ccnet.exe -validate on it to make sure it is well formed, then I copy it over ontop of the current config file. CC.NET recognizes the changes and loads in the new config
Exceptions: If cc.net is currently running a project, it will not recognize the changes till that project has completed.
If your ccnet.config has errors, it will not ever recognize the changes and keep running the old version it has stored in memory. (However when CC.NET does restart it will try to parse the error filled config and choke.
Hope this helps!!
Do you mean you are using linked files, that is the ccnet.config file has links to the independent project files.
If so then they are not picked up, it's mentioned in the documentation that it doesn't watch the sub-files.
Internally we have modified our CruiseControl.net so that our ccnet.config is optionally a directory - and we can drop shortcuts to our project config files into that directory. We put watches on the directory, the files or shortcuts in the directory and all of the targets of the shortcuts. That means we have our project config files in ClearCase and just drop a shortcut into the ccnet.config directory.
I've just spent half a day or so moving from 1.2 to 1.4.2 dropping our changes into the new version for our internal use. We don't own our code, our client does and so it has to stay internal :(
I have never experienced this. Whenever I change the configuration files, the CruiseControl.NET service seems to automatically re-read them.
I'm using Version 1.3 of CC.NET.
Update:
In the service's config file (ccservice.exe.config), there is a setting to enable/disable watching the ccnet.config file for changes:
<add key="WatchConfigFile" value="true"/>
Make sure this is set to true.