cancel
Showing results for 
Search instead for 
Did you mean: 

Execute command line with ProgramRunnable in FSR postCommit

nicolasraoul
Star Contributor
Star Contributor
I want to perform a task every WCM deployment. (final goal: upload the website via FTP)

So I installed and configured FSR (Alfresco-DeploymentEnterprise-3.3.2) and configured it to:
  • generate a "baked" version of the website to a given directory (it works)

  • execute a command line (it does not work).
Here is my postCommit (for now it just does "cp /etc/issue /tmp/fsrtest" which should work but no file found afterwards in /tmp):

<property name="postCommit">
                                        <list>
                                                <bean class="org.alfresco.deployment.SampleRunnable"/>
                                                <bean class="org.alfresco.deployment.ProgramRunnable">
                                                        <property name="program">
                                                                <value>/bin/cp</value>
                                                        </property>
                                                        <property name="directory">
                                                                <value>/tmp</value>
                                                        </property>
                                                        <property name="arguments">
                                                                <list>
                                                                        <value>/etc/issue</value>
                                                                        <value>/tmp/fsrtest</value>
                                                                </list>
                                                        </property>
                                                </bean>
                                        </list>
                                </property>

I wrote this property element at the root of DeploymentTargetRegistrationBean in deployment/default-target.xml in the FSR.
No error in nohup.out at startup nor at deployment.

What could be the problem in my postCommit configuration?
Thanks in advance!
Nicolas Raoul
1 REPLY 1

nicolasraoul
Star Contributor
Star Contributor
I solved this by modifying the second argument from "/tmp/fsrtest" to just "/tmp".
And now it copies the file as expected.
It is rather strange because /bin/cp /etc/issue /tmp/fsrtest works, so I don't see why it would not when ran via ProgramRunnable.
If someone has a better explanation that would be great 😄

Cheers!
Nicolas Raoul
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.