ant : http://ant.apache.org
ant manual : http://ant.apache.org/manual/index.html
scp manual : http://ant.apache.org/manual/Tasks/scp.html
sshexec manual : http://ant.apache.org/manual/Tasks/sshexec.html
* scp library : http://www.jcraft.com/jsch/
- 2/3 가량 스크롤을 내리다 보면 Download 있음
* 이클립스에서 ant를 동작시킬 경우
- Windows > Preferences > Ant > Runtime > Classpath > Global Entries 에 scp 사이트에서 다운받은 jar를 추가
* 사용예
<?xml version="1.0" encoding="UTF-8"?> <project name="ad_engine" default="all" basedir="."> <property name="server.host" value="아이피"/> <property name="server.port" value="포트"/> <property name="server.username" value="사용자아이디"/> <property name="server.password" value="사용자비밀번호"> <target name="all" depends="copy,reboot"/> <target name="copy"> <echo>copy</echo> <scp file="target/ad_engine.jar" todir="${server.username}:${server.password}@${server.host}:/home/obigo/opt/AdEngine/libs" port="${server.port}" trust="true"></scp> </target> <target name="reboot"> <echo>reboot</echo> <sshexec host="${server.host}" port="${server.port}" trust="true" username="${server.username}" password="${server.password}" command="cd opt/AdEngine; bin/stop.sh; bin/boot.sh start" timeout="10000" failonerror="false" /> </target> </project> |
* Jenkins Ant library에 scp 추가
- jenkins설치폴더/tools/hudson.tasks.Ant_AntInstallation/ant_버전/lib