http://주소.tistory.com/login?requestURI=http://주소.tistory.com/&goDaum=false&loginid=이메일&password=비밀번호&save=on
1. Installing CruiseControl on CentOS with Plesk
http://www.lejnieks.com/2008/07/05/installing-cruisecontrol-on-centos-with-plesk/
CentOs 에서의 CruiseControl 설치법이 있는 사이트


2. Configuration Reference
http://cruisecontrol.sourceforge.net/main/configxml.html
config.xml 레퍼런스가 나와있는 사이트

3. Apache Ant User Manual
http://ant.apache.org/manual/toc.html
Ant 레퍼런스가 나와있는 사이트

Ant 에 대해서 모르고 인터넷에 있는 예제를 따라서 CruiseControl을 만드니, 나와 설정이 너무 달랐다.
Ant 를 먼저 공부하고 맘에 드는 놈을 자신의 환경에 쓰도록 하자.

4. Refactor your configuration file

http://www.build-doctor.com/2008/02/29/refactor-your-configuration-file/
설정파일(config.xml) 리팩토링 !!!
내 config.xml 에는 프로젝트가 몇십개가 된다.
혹시 로그폴더 위치가 바뀌게 된다면??? 몇십개의 줄을 하나마다 바꾸어 줘야한다.
이럴때 ${log.dir} 이라는 property name을 쓴다면 한줄만 바꾸어 주면 된다.
이러한 변수를 잘 활용하고, 또한 프로젝트
<include.project> 를 활용해서 쪼개어 주자.
#define MAX_MESSAGE_NUMBER  100
#define MAX_MESSAGE_SIZE    128
#define MAX_PROCESS_NAME    32

#include <boost/interprocess/ipc/message_queue.hpp>
#include <boost/interprocess/creation_tags.hpp>
#include <iostream>
using namespace boost::interprocess;

class CMessageQ
{

public:
  CMessageQ(const char* pName)
  {
    m_pMsgQ = NULL;
    strcpy(m_Name, pName);
  }
  ~CMessageQ(void)
  {
	  Remove();
  }

public:
  bool Create()
  {
	  try{
			Remove();
			// 메모리에서 제거되면 안되므로 static으로 선언
			static message_queue mq(create_only, m_Name, MAX_MESSAGE_NUMBER, MAX_MESSAGE_SIZE);
			m_pMsgQ = &mq;
	  }catch(interprocess_exception &ex){
		  std::cout << "MessageQ Create() error : " << ex.what() << std::endl;
		  return false;
	  }
	  return true;
  }

  bool Open()
  {
	  try{
		  static message_queue mq(open_only, m_Name);
      m_pMsgQ = &mq;
	  }catch(interprocess_exception &ex){
		  std::cout << "MessageQ Open() error : " << ex.what() << std::endl;
		  return false;
	  }
	  return true;
  }

  size_t Get()
  { 
    size_t temp;
    try{
    temp = m_pMsgQ->get_num_msg();
    return temp;
    }catch(interprocess_exception &ex){
      std::cout << "MessageQ Get() error : " << ex.what() << std::endl;
    }
    return 0;
  }

  template <typename T>
  bool Send(T* Data,size_t Size, unsigned int priority = 0)
  {
	  try{
		  m_pMsgQ->send(Data, Size, priority);
	  }catch(interprocess_exception &ex){
		  std::cout << "MessageQ Send() error : " << ex.what() << std::endl;
		  return false;
	  }
	  return true;
  }

  template <typename T>
  bool Recv(T* Data, size_t Size, unsigned int& priority)
  {
    size_t recvd_size=0;
	  try{
			//m_pMsgQ->receive(Data, Size, recvd_size, priority);
			m_pMsgQ->receive(Data, MAX_MESSAGE_SIZE, recvd_size, priority);
			if( Size != recvd_size )
			{
				std::cout << "MessageQ Recv() Size Wrong : " << std::endl;
				return false;
			}
	  }catch(interprocess_exception &ex){
		  std::cout << "MessageQ Recv() error : " << ex.what() << std::endl;
		  return false;
	  }
	  return true;
  }

  void Remove()
  {
	  message_queue::remove(m_Name);
  }

private:
	char m_Name[MAX_PROCESS_NAME]; // 프로세스 이름
	message_queue* m_pMsgQ; // 메시지큐 포인터
};


이렇게 사용하면 될려나 ㅡㅡ; ㅎㅎ

+ Recent posts