빌드서버 구축시 참고내용

·     64비트용으로 만든 프로젝트의 unit test를 실행하기 위해 빌드서버는 64비트 OS여야 함

·     설치해야 하는 프로그램들

o    svn.exe파일이 path에 잡혀있어야 함(visualSVN Server설치하고 visualSVN서비스는 시작하지않음)

o    VS 6.0, VS.NET 2003, VS.NET 2005 순서대로 설치해야 하며 VS.NET 2005 설치시(x64빌드 도구 선택해서 같이 설치해야 64비트용 프로젝트 빌드됨)

o    java jdk, ant 설치하고 JAVA_HOME, ANT_HOME등을 환경변수에 지정하고 path도 잡아야 함, Ant의 빌드결과를 CC.NET에서 확인할려면 dashboard.config xslReportBuildPlugin값 넣어야 함(자세한것은 CC.NET문서 참고)

o    NUnit, NAnt, TortoiseSVN, IIS, SMTP서버, SQL Client, Window Powershell(윈도우용 shell 프로그램)


개발 시 참고내용

·     솔루션이나 프로젝트 파일의 참조 라이브러리 위치는 상대경로여야 한다.(메모장으로 .proj 파일 열어서 hintpath부분 확인)

·     참조하는 로컬폴더의 위치는 모두 동일해야 한다.(ex> d:\commonLib\Base …)


Ccnet.config

<project name="IPMSC2" queue="PROJ">

    <triggers>

      <scheduleTrigger time="03:00" buildCondition="ForceBuild" name="Scheduled" />

    </triggers>

    <webURL>http://70.70.70.26:4989/server/local/project/IPMSC2/ViewProjectReport.aspx</webURL>

    <labeller type="dateLabeller" />

    <sourcecontrol type="svn">

      <trunkUrl>http://x.dev:8080/svn/IPMSCv2.root/IPMSC</trunkUrl>

      <workingDirectory>D:\CruiseControlBuild\IPMSC2</workingDirectory>

      <autoGetSource>true</autoGetSource>

      <cleanCopy>true</cleanCopy>

    </sourcecontrol>

    <tasks>

      <devenv>

        <solutionfile>D:\CruiseControlBuild\IPMSC2\IPMSC.sln</solutionfile>

        <configuration>Release</configuration>

        <buildtype>ReBuild</buildtype>

        <version>VS2005</version>

        <buildTimeoutSeconds>1200</buildTimeoutSeconds>

      </devenv>

      <buildpublisher>

        <sourceDir>D:\CruiseControlBuild\IPMSC2\IPMSC_Console\bin\Release</sourceDir>

        <publishDir>D:\CruiseControlRelease\IPMSC2</publishDir>

        <useLabelSubDirectory>true</useLabelSubDirectory>

        <alwaysPublish>false</alwaysPublish>

</buildpublisher>

      <nant>

        <executable>nant.bat</executable>

        <baseDirectory>D:\CruiseControlRelease</baseDirectory>

        <nologo>true</nologo>

        <buildFile>makeZipFile.build</buildFile>

      </nant>

    </tasks>

</project>

 

NAnt 파일 makeZipFile.build

<?xml version="1.0" encoding="utf-8"?>

<project name="Zip Example" default="makeZip">

  <target name="makeZip">

    <echo message="## CCNetLabel[${CCNetLabel}]" />

    <echo message="## CCNetProject[${CCNetProject}]" />

<zip zipfile="D:\CruiseControlRelease\${CCNetProject}\${CCNetLabel}\${CCNetProject}.${CCNetLabel}.zip">

      <fileset basedir="D:\CruiseControlRelease\${CCNetProject}\${CCNetLabel}" defaultexcludes="true" failonempty="true">

        <include name="**/*" />

      </fileset>

    </zip>

<delete>

      <fileset basedir="D:\CruiseControlRelease\${CCNetProject}\${CCNetLabel}" defaultexcludes="false">

        <include name="**/*" />

        <exclude name="${CCNetProject}.${CCNetLabel}.zip" />

      </fileset>

    </delete>

</target>

</project>

관련 URL
http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET


이용 사례 정리한 것 (20110304)

Posted by 파이팅야
,

만약

             game/source/app

             game/source/app/file.txt

             game/source/app/subfolder

와 같이 있는 파일 및 폴더를

             game/source/trunk

안에 옮기고자 할려면

 

일단 아래와 같은

svn move game/source/app game/source/trunk

move명령어는 같은 폴더라 실행은 안되고

 

app폴더를 임의 temp폴더로 복사하고 app폴더를 삭제 후

trunk, branches, tags폴더를 만들고 trunk폴더안에 temp폴더의 내용을 옮겨야 합니다.

 

그리고 파일을 app폴더에서 temp폴더로 옮길 때 *(wildcards)가 실행되지 않아서

Linux면 아래의 URL처럼 shell script로 되는데…

(http://subversion.tigris.org/faq.html#sorry-no-globbing)

 윈도우면 PowerShell로 구현하면 될것 같음

 .Net Framework 2.0설치하고 PowerShell을 설치 후 아래의 내용으로 moveFolder.ps1파일을 만들어 실행하면 됨

 

# 옮길 SVN URL값을 읽어들임

$moveList = Get-Content d:\temp\moveList.txt

foreach($moveFile in $moveList)

{

             $url = "http://pccafe2.ncsoft.dev:8080/svn/" + $moveFile

             echo "URL[$url]"

 

             # URL의 마지막 폴더명 구하기

             $splittedUrl = $moveFile.split("/")

             $lastFolder = $splittedUrl[$splittedUrl.length - 1]

 

             svn ls "$url" > "FILE_LIST_$lastFolder.xml"

             $fileList = Get-Content "FILE_LIST_$lastFolder.xml"

             foreach($file in $fileList)

             {

                           # URI형식으로 주소값 변경(변경하지 않으면 한글이나 띄어쓰기 있는부분에서 에러남)

                           $sourceUri = [System.URI] "$url/$file"

                           $targetUri = [System.URI] "http://pccafe2.ncsoft.dev:8080/svn/game/backup/$lastFolder/$file"

 

                           # 파일 복사

                           svn copy --parents $sourceUri.AbsoluteUri $targetUri.AbsoluteUri -m "copy backup"

             }

}

옮기는경우가 많지 않으면, TortoiseSVN에서 마우스 오른쪽 버튼으로 드래그한후 move메뉴를 실행하면 된다.

ㅇ. 참고
http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx

Posted by 파이팅야
,

. A서버 svn의 소스를 B서버 svn으로 옮길 때

             - A서버의 Repositories폴더에서 dump파일 생성

                           svnadmin dump 저장소명 > dump파일명

ex) svnadmin dump ClientNetwork > ClientNetwork.dump

             - B서버의 Repositories폴더에서 dump파일 복구(admin저장소 안의 ‘source/ipms’폴더안에 저장시)

                           svnadmin load --parent-dir “저장할 폴더명저장소명 < dump파일명

                     ex)svnadmin load --parent-dir "source/ipms" admin < ipms.dump


. A서버 cvs의 소스를 B서버 svn으로 옮길 때

- A서버에서 python [d:\ Python26]폴더에 설치 (http://www.python.org)

- A서버에서 cvs2svn설치 (http://cvs2svn.tigris.org)에서 다운 받아서 [pthon.exe setup.py install]로 설치

- A서버에서 GNU sort(UnxUtils.zip)

(http://sourceforge.net/projects/unxutils)

압축풀고 [user/local/wbain/sort.exe] [d:\temp]에 복사

- A서버에서 다음의 명령어 실행해서 d:\temp폴더에 dump파일 생성

python D:\Python26\Scripts\cvs2svn --sort=D:\temp\sort.exe --encoding=cp949 --dumpfile=d:\temp\ipms.dump d:/cvs/ipms

- B서버의 Repositories폴더에서 다음의 명령어 실행해서 dump파일 복구

svnadmin load --parent-dir "source/ipms" admin < ipms.dump


. Reference

http://cvs2svn.tigris.org

http://www.python.org

http://sourceforge.net/projects/unxutils

http://iolothebard.tistory.com/401

http://www.xinublog.com/438 (linux에서)

 

Posted by 파이팅야
,