I've installed FileConveyor and django cumulus (which is the replacement for mosso). I created a test directory at /home/drupal/conveyortest which I use as the scanPath.
When I start the FileConveyor daemon, I'm told that the js and css files are being sync'd (and deleted). When I look on my CloudFiles container, I see the static/views_slideshow_galleria folder has been created, but there are no files inside it. There should be one css file and one js file, but there are none.
What am I doing wrong?
- WARNING - Created 'cumulus' transporter for the 'cloudfiles' server.
- WARNING - Deleted '/home/drupal/conveyortest/views_slideshow_galleria/views_slideshow_galleria.css' as per the 'CSS, JS, images and Flash' rule.
- WARNING - Synced: '/home/drupal/conveyortest/views_slideshow_galleria/views_slideshow_galleria.css' (CREATED).
- WARNING - Deleted '/home/drupal/conveyortest/views_slideshow_galleria/views_slideshow_galleria.js' as per the 'CSS, JS, images and Flash' rule.
- WARNING - Synced: '/home/drupal/conveyortest/views_slideshow_galleria/views_slideshow_galleria.js' (CREATED).
- WARNING - Synced: '/home/drupal/conveyortest/views_slideshow_galleria/views_slideshow_galleria.css' (DELETED).
- WARNING - Synced: '/home/drupal/conveyortest/views_slideshow_galleria/views_slideshow_galleria.js' (DELETED).
Here is my config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<!-- Sources -->
<sources ignoredDirs="CVS:.svn">
<source name="drupal" scanPath="/home/drupal/conveyortest" documentRoot="/home/drupal/conveyortest" basePath="/" />
</sources>
<!-- Servers -->
<servers>
<server name="cloudfiles" transporter="cumulus">
<username>myusername</username>
<api_key>myapikey</api_key>
<container>FileConveyorTest</container>
</server>
</servers>
<!-- Rules -->
<rules>
<rule for="drupal" label="CSS, JS, images and Flash">
<filter>
<extensions>ico:js:css:gif:png:jpg:jpeg:svg:swf</extensions>
</filter>
<processorChain>
<processor name="filename.SpacesToDashes" />
</processorChain>
<destinations>
<destination server="cloudfiles" path="static" />
</destinations>
</rule>
</rules>
</config>
Related
I have created npm package which has js and css files just similar to bootstrap as folder structure. I want to ship same package for .Net mvc web applications so I created .nuspec file specifying files from build output and created Nuget package. Both the Nuget and NPM package working great.
Now I want to publish same package for dot net core project. When I install same Nuget package in dot net core web application it installed successfully but does not copied static files to project folders.
How to create/fix nugget package of static files for dot net core application. I don't want to create .net core project to ship static files. It would be great if I could add some configuration file like .nuspec for dot net core application as well.
I have searched but not able to get any help in regards, So any suggestion or reference would be appriciated.
myproject.nuspec
<?xml version="1.0"?>
<package >
<metadata>
<id>MyPackage</id>
<version>1.0.1</version>
<title>MyProject</title>
<authors>Me</authors>
<owners>Me</owners>
<projectUrl>some url...</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is similar to bootstrap</description>
<copyright>Copyright 2020</copyright>
<tags></tags>
<dependencies>
<dependency id="jQuery" version="[3.0.0, 4.0.0)" />
</dependencies>
</metadata>
<files>
<file src="dist\css\**\*.*" target="content\Content\css" />
<file src="dist\fonts\**\*.*" target="content\Content\fonts" />
<file src="dist\js\mypackage.js" target="content\Scripts" />
<file src="dist\images\**\*.*" target="content\Content\Images" />
</files>
</package>
Update : I tried solution given below by #thatguy it does copied the files in appropriate folders. I can see those in Visual Studio. But that newly created files and folder has arrow symbol on it while other files does not. I tried including css in page code but it does not found the newly created files.
What this arrow means and why its not finding the files ?
Create Nuget package for dot net core project from static files
You should use <package_id>.props file.
1) create a folder in your MyPackage called build and then add a file called MyPackage.props file in it.
2) Then add these in it:
<Project>
<Target Name="CopyFilesToProject" BeforeTargets="Build">
<Message Text="Copy css files to project" />
<ItemGroup>
<SourceScripts Include="$(MSBuildThisFileDirectory)..\..\content\**\*.* "/> //file from the nuget package
</ItemGroup>
<Copy
SourceFiles="#(SourceScripts)"
DestinationFiles="#(SourceScripts -> '$(MSBuildProjectDirectory)\%(RecursiveDir)%(Filename)%(Extension)')"
/>
</Target>
</Project>
3) change to use this nusepc file:
<?xml version="1.0"?>
<package >
<metadata>
<id>MyPackage</id>
<version>1.0.1</version>
<title>MyProject</title>
<authors>Me</authors>
<owners>Me</owners>
<projectUrl>some url...</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is similar to bootstrap</description>
<copyright>Copyright 2020</copyright>
<tags></tags>
<dependencies>
<dependency id="jQuery" version="[3.0.0, 4.0.0)" />
</dependencies>
</metadata>
<files>
<file src="dist\css\**\*.*" target="content\Content\css" />
<file src="dist\fonts\**\*.*" target="content\Content\fonts" />
<file src="dist\js\mypackage.js" target="content\Scripts" />
<file src="dist\images\**\*.*" target="content\Content\Images" />
<file src="build\MyPackage.props" target="build" />
</files>
</package>
4) repack your project MyPackage and then first uninstall the old nuget package MyPackage first in your main project.
Then, clean nuget caches first or delete all caches under C:\Users\xxx(current user)\.nuget\packages.
After that, install the new version MyPackage and then build your project first and you can see the files be copied under the main project.
In addition, there is a similar issue about your request and also this one.
==================================
Update 1
If you want these files only be copied on Net Core projects, you should abandon using content node in nupkg. It will automatically copy files into the NET Framework main project when you install the package.
Instead, you could put these files under a different folder called resource of the nupkg.
You could follow my steps:
1) change MyPackage.props file to:
<Project>
<Target Name="CopyFilesToProject" BeforeTargets="Build">
<Message Text="Copy css files to project" />
<ItemGroup>
<SourceScripts Include="$(MSBuildThisFileDirectory)..\..\resource\**\*.* "/> //file from the nuget package
</ItemGroup>
<Copy
SourceFiles="#(SourceScripts)"
DestinationFiles="#(SourceScripts -> '$(MSBuildProjectDirectory)\%(RecursiveDir)%(Filename)%(Extension)')"
/>
</Target>
</Project>
2) change xxx.nuspec file to:
<?xml version="1.0"?>
<package >
<metadata>
<id>MyPackage</id>
<version>1.0.1</version>
<title>MyProject</title>
<authors>Me</authors>
<owners>Me</owners>
<projectUrl>some url...</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>This is similar to bootstrap</description>
<copyright>Copyright 2020</copyright>
<tags></tags>
<dependencies>
<dependency id="jQuery" version="[3.0.0, 4.0.0)" />
</dependencies>
</metadata>
<files>
<file src="dist\css\**\*.*" target="resource\Content\css" />
<file src="dist\fonts\**\*.*" target="resource\Content\fonts" />
<file src="dist\js\mypackage.js" target="resource\Scripts" />
<file src="dist\images\**\*.*" target="resource\Content\Images" />
<file src="build\MyPackage.props" target="build" />
</files>
</package>
3) then repack your project and install the new one, before it, you should clean nuget caches first.
I'm trying to get a docker image to run our on-premise Service Fabric cluster.
We've setup a service fabric cluster on our on-premise network, which seems to run fine (it already runs 2 docker images). I'm looking for one of my containers to run under a domain user (Service Account), so I can reach SMB shares in my network (which have been granted permission to the service account).
I'm getting the following error:
Error event: SourceId='System.Hosting', Property='Activation:1.0'.
There was an error during activation.Failed to setup ApplicationPrincipals. Error:ApplicationPrincipalAbortableError
Also shown as image:
The container I'm trying to run: https://hub.docker.com/r/stefanscherer/registry-windows/
ApplicationManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest ApplicationTypeName="[REMOVED].ServiceFabric.WindowsContainerRegistryType"
ApplicationTypeVersion="1.0.0"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Parameters>
<Parameter Name="WindowsContainerRegistry_InstanceCount" DefaultValue="-1" />
</Parameters>
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
should match the Name and Version attributes of the ServiceManifest element defined in the
ServiceManifest.xml file. -->
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="WindowsContainerRegistryPkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<Policies>
<ContainerHostPolicies CodePackageRef="Code">
<!-- See https://aka.ms/I7z0p9 for how to encrypt your repository password -->
<RepositoryCredentials AccountName="" Password="" PasswordEncrypted="false" />
<PortBinding ContainerPort="5000" EndpointRef="WindowsContainerRegistryTypeEndpoint" />
<Volume Source="\\[REMOVED]\ServiceFabricShare" Destination="C:\registry" IsReadOnly="false"></Volume>
</ContainerHostPolicies>
</Policies>
</ServiceManifestImport>
<DefaultServices>
<!-- The section below creates instances of service types, when an instance of this
application type is created. You can also create one or more instances of service type using the
ServiceFabric PowerShell module.
The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. -->
<Service Name="WindowsContainerRegistry" ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="WindowsContainerRegistryType" InstanceCount="[WindowsContainerRegistry_InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
<Principals>
<Users>
<User Name="ServiceFabricAppl" AccountType="DomainUser" AccountName="[REMOVED]\appl_ServiceFabric" Password="[REMOVED]" PasswordEncrypted="false" />
</Users>
</Principals>
<Policies>
<DefaultRunAsPolicy UserRef="ServiceFabricAppl" />
</Policies>
</ApplicationManifest>
P. S. I'm working with an unencrypted password just for testing purposes to make sure this isn't the problem right now.
ServiceManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="WindowsContainerRegistryPkg"
Version="1.0.0"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ServiceTypes>
<!-- This is the name of your ServiceType.
The UseImplicitHost attribute indicates this is a guest service. -->
<StatelessServiceType ServiceTypeName="WindowsContainerRegistryType" UseImplicitHost="true">
<Extensions>
<Extension Name="Traefik">
<Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
<Label Key="traefik.frontend.rule">Host:registry.windows.containers.[REMOVED].com</Label>
<Label Key="traefik.enable">true</Label>
<Label Key="traefik.frontend.passHostHeader">true</Label>
<!--<Label Key="traefik.port">5000</Label>
<Label Key="traefik.protocol">http</Label>
<Label Key="traefik.frontend.entryPoints">http,https</Label>
<Label Key="traefik.frontend.headers.referrerPolicy">no-referrer</Label>-->
</Labels>
</Extension>
</Extensions>
</StatelessServiceType>
</ServiceTypes>
<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.0.0">
<EntryPoint>
<!-- Follow this link for more information about deploying Windows containers to Service Fabric: https://aka.ms/sfguestcontainers -->
<ContainerHost>
<ImageName>stefanscherer/registry-windows:2.6.2-2016</ImageName>
</ContainerHost>
</EntryPoint>
<!-- Pass environment variables to your container: -->
<!--
<EnvironmentVariables>
<EnvironmentVariable Name="VariableName" Value="VariableValue"/>
</EnvironmentVariables>
-->
</CodePackage>
<!-- Config package is the contents of the Config directoy under PackageRoot that contains an
independently-updateable and versioned set of custom configuration settings for your service. -->
<ConfigPackage Name="Config" Version="1.0.0" />
<Resources>
<Endpoints>
<!-- This endpoint is used by the communication listener to obtain the port on which to
listen. Please note that if your service is partitioned, this port is shared with
replicas of different partitions that are placed in your code. -->
<Endpoint Name="WindowsContainerRegistryTypeEndpoint" Port="5000" />
</Endpoints>
</Resources>
</ServiceManifest>
Sources:
https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-run-service-as-ad-user-or-group
Service fabric local cluster error (this one didn't offer any solution for me unfortunately)
I'm trying to use NLog in an F# console application, I've managed to get it working using a configuration section in App.config however I can't get it working using a stand-alone NLog.config file. My NLog.config file is in the app route, just under App.config and the contents are:
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" throwExceptions="true">
<targets>
<target name="stdFile" xsi:type="File" fileName="c:/temp/compliant.log"/>
<target name="display" xsi:type="OutputDebugString"/>
</targets>
<rules>
<logger name="compliant.mail.*" minlevel="Debug" writeTo="stdFile,display" />
</rules>
</nlog>
What am I doing wrong?
Also, intellisense isn't working for the xml even though I have included the xsd. :(
In your project, in the Properties for NLog.config, do you have NLog.config marked as "Copy Always"?
After switching the logging library behind Common.Logging 2.1.1 from log4net to NLog 2.0 my ASP.NET MVC 2 application kept logging correctly, but it started calling the HttpApplication.Session_Start method for each request.
I'm trying to use NLog's File target with the following configuration files:
web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="common">
<section
name="logging"
type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
.
.
.
<configSections>
.
.
.
<common>
<logging>
<factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog20">
<arg key="configType" value="FILE" />
<arg key="configFile" value="~/NLog.config" />
</factoryAdapter>
</logging>
</common>
</configuration>
NLog.config
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--
See http://nlog-project.org/wiki/Configuration_file
for information on customizing logging rules and outputs.
-->
<targets async="true">
<target
name="f"
xsi:type="File"
fileName="${basedir}/bin/statistics/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${callsite} ${message}"/>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="f" />
</rules>
</nlog>
I have already tried the following:
Debugging the application. The ASP.NET_SessionId cookie is being sent to the server and the Session.SessionID property is not changing between requests.
Switching back to Common.Logging - log4net to verify that the problem is related to Common.Logging - NLog. It works.
Omitting the async="true" attribute in the targets node of the configuration file of NLog to disable the AsyncWrapper of NLog. It doesn't work.
Using other NLog targets, tried Debugger and Database. It works.
I need to hold to the File target and I'd like to use NLog.
I am trying to deploy a simple EJB project onto Jboss 7.1.1. I have a separate installation of H2 database.
So I changed the standalone.xml as follows:
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:tcp://localhost/~/test</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
Now I have also edited the persistence.xml to match the names in the standalone.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="scube" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.sample.model.Property</class>
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
Eclipse, points an error at line: java:jboss/datasources/ExampleDS
Error is as follows:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'jta-data-source'. One of '{"http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/
xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":shared-cache-mode, "http://java.sun.com/xml/ns/persistence":validation-mode,
"http://java.sun.com/xml/ns/persistence":properties}' is expected.
I searched for similar errors and all the resolutions said that either the order of xml elements were important, which I checked or the jndi name should match with standalone.xml, which does match.
Can someone help me with this?
The right order of XML elements (according to schema document) is:
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<class>com.sample.model.Property</class>