CruiseControl
잡동사니
목차 |
작업공간 추가
빌드 루프
크루즈컨트롤 웹사이트의 Getting Started with the Source Distribution#Running the Build Loop 문서를 참조하라.
작업공간 경로를 $WORK_DIR라 할 때
작업공간 폴더 생성
- 소스를 내려받고 빌드를 진행할 프로젝트 폴더 생성
mkdir $WORK_DIR/projects
- 로그를 저장할 폴더 생성
mkdir $WORK_DIR/logs
- 진행 중인 빌드 상태를 저장할 폴더 생성
mkdir $WORK_DIR/status
- 생성물(artifact)를 저장할 폴더 생성
mkdir $WORK_DIR/artifacts
크루즈컨트롤 설정 추가
크루즈컨트롤 설정 파일은 $WORK_DIR/config.xml다. 크루즈컨트롤 웹사이트의 Configuration Reference 문서를 참고하여 작성한다. 다음은 아무 프로젝트도 포함하지 않은 최소한의 설정 파일의 내용이다.
<cruisecontrol> </cruisecontrol>
프로젝트 추가는 #프로젝트 추가 부분을 참고하라.
빌드 루프 시작
빌드 루프는 백그라운드에서 실행되며, 기동은 config.xml<tt> 파일이 있는 <tt>$WORK_DIR에서 한다.
$INSTALL_DIR/main/bin/cruisecontrol.sh
단, 참고 문서에서 나온대로 기동을 하면 백그라운드 프로세스에 의해 쉘이 정상적으로 종료되지 않을 수도 있으므로 nohup을 이용하여 다음과 같이 기동한다.
nohup $INSTALL_DIR/main/bin/cruisecontrol.sh
-configfile 옵션을 사용하면 다른 경로의 설정 파일을 지정할 수 있다. #Configure the Build Loop 부분을 참고하라.
웹 애플리케이션
크루즈컨트롤 경로를 CRUISECONTROL_HOME라 할 때
JSP 빌드
ant -f $INSTALL_DIR/reporting/jsp/build.xml
...
-set.log.dir:
[input] WARNING! Property user.log.dir not set! Please enter the absolute path to the CruiseControl logs directory:
$WORK_DIR/logs
-set.status.file:
[input] WARNING! Property user.build.status.file not set! Please enter the name of the current build status file:
-set.artifacts.dir:
[input] WARNING! Property cruise.build.artifacts.dir not set! Please enter the absolute path to the directory where additional build artifacts are stored:
$WORK_DIR/artifacts
...
빌드 중 위에서 생성한 폴더의 경로를 물어보는데 이 값은 다음과 같이 인자로 처리할 수 있다.
ant -f $INSTALL_DIR/reporting/jsp/build.xml -Duser.log.dir=$WORK_DIR/logs -Duser.build.status.file=$WORK_DIR/status -Dcruise.build.artifacts.dir=$WORK_DIR/artifacts
또한 테스트를 진행지 않으려면 -Dtest.skip=true 옵션을 주면 된다.
생성물은 $INSTALL_DIR/reporting/jsp/dist/cruisecontrol.jar에 저장된다.
웹 애플리케이션 컨텍스트 추가
Tomcat#컨텍스트 추가 참고.
다음과 같은 오류가 나는 경우가 있다. 이는 배포된 웹 애플리케이션에 포함된 EL 라이브러리 버전이 맞지 않아서 일어나는 것으로 보이며 웹 애플리케이션이 설치된 경로에서 ~/WEB-INF/lib/el-api.jar 파일을 삭제한 후 컨텍스트를 재기동하면 해결된다.
HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/index_jsp, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature org.apache.jasper.servlet.JspServlet.service(JspServlet.java:275) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) root cause java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/index_jsp, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature org.apache.jsp.index_jsp._jspInit(index_jsp.java:48) org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52) org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs. Apache Tomcat/6.0.18

