You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martin Gilday <ma...@imap.cc> on 2007/02/08 10:57:22 UTC

SCP after deploy

Hi,
I would like to be able to perform an SCP or FTP copy of a file to a
remote server after a deploy, but not a repository just to the normal
file system.  So it would be deployed to our internal repository and
then distributed externally.  We are looking to have seperate profiles
for the location to export (i.e a place for QA, UAT, releases).

Is this possible with either the deploy plugin or wagon?

Thanks,
Martin.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] SCP after deploy

Posted by kalebral <ka...@gmail.com>.
I use the antrun plugin, here is an example which is bound to the install
target. Create a property for the name of the machine you want to deploy to
and then you can always override it from the command line. Probably better
ways to do this, but works well for us

 <plugin>
                                <artifactId>maven-antrun-plugin</artifactId>
                                <executions>
                                        <execution>
                                                <phase>install</phase>
                                                <goals>
                                                        <goal>run</goal>
                                                </goals>
                                                <configuration>
                                                        <tasks>
                                                                <!-- First
copy the file to the /tmp directory of the development machine -->
                                                                <exec
dir="${basedir}" executable="/usr/bin/scp"  failonerror="true">
                                                                        <arg
line="${basedir}/target/${project.build.finalName}-distribution.zip
${project.devMachine}:/tmp"/>
                                                                </exec>
                                                                <!-- Now
unzip the file -->
                                                               
<echo>${project.devMachine} rm -rf /programs/${project.build.finalName};
unzip /tmp/${project.build.finalName}-distribution.zip /programs"</echo>
                                                                <exec
dir="${basedir}" executable="/usr/bin/ssh"  failonerror="true">
                                                                        <arg
line="${project.devMachine} rm -rf /programs/${project.build.finalName};
unzip -q -d /programs /tmp/${project.build.finalName}-distribution.zip"/>
                                                                </exec>
                                                        </tasks>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>




Martin Gilday wrote:
> 
> Hi,
> I would like to be able to perform an SCP or FTP copy of a file to a
> remote server after a deploy, but not a repository just to the normal
> file system.  So it would be deployed to our internal repository and
> then distributed externally.  We are looking to have seperate profiles
> for the location to export (i.e a place for QA, UAT, releases).
> 
> Is this possible with either the deploy plugin or wagon?
> 
> Thanks,
> Martin.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/SCP-after-deploy-tf3192350s177.html#a8917649
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org