1. 스크립트 실행
작업을 정의한 스크립트를 실행한다. 아마 이게 제일 속편한 방법일지도 모른다.
Ant에서는 telnet, exec, sshexec 등의 타스크를 이용하여 실행하면 된다.
<target name="remote-tomcat-start">
<sshexec host="${ssh.hostname}"
port="${ssh.port}"
username="${ssh.username}"
passphrase=""
trust="true"
keyfile="${ssh.key.file}"
command="${tomcat.home}/bin/startup" />
<sleep seconds="${sleep.time}" />
</target>
2. WAS에서 제공하는 Ant 타스크 또는 Maven 플러그인 이용
대부분의 WAS가 어드민화면을 통하지 않고 여러가지 작업을 수행할 수 있는 수단을 제공한다.
<target name="install" description="Install application in Tomcat"
depends="package-web">
<deploy url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"
path="/${webapp.name}"
war="file:${webapp.dist}/${webapp.war}"/>
</target>
3. Cargo 이용
Cargo는 WAS 마다 다른 형태의 API를 래핑하여 표준적인 방법으로 WAS를 핸들링할 수 있게 해준다. 그러나 아직 지원하는 WAS가 많지 않다.
<cargo containerId="tomcat5x" home="${tomcat.home}" output="${tomcatlog.dir}/output.log"
log="${tomcatlog.dir}/cargo.log" action="start">
<configuration home="${tomcatconfig.dir}">
<property name="cargo.servlet.port" value="8080"/>
<property name="cargo.logging" value="high"/>
<deployable type="war" file="${mywarfile}"/>
</configuration>
</cargo>
'Build&Deploy' 카테고리의 다른 글
[셀레늄] 최신 브라우저 별칭 (0) | 2009.04.20 |
---|---|
브랜치를 이용하여 운영환경에 선별적으로 배포하기 (2) | 2008.10.24 |
웹어플리케이션 배포 패키징 유형 3가지 (0) | 2008.10.02 |
배포를 위한 어플리케이션 전송 방법 (0) | 2008.10.02 |
배포(deploy) 아키텍처 - 배포 코스 (1) | 2008.10.02 |