Skip to main content

continuous integration with buildbot 간략 설정

git, svn등, 소스관리 툴을 사용하다 보니, 다수의 사용자에 의해서 소스가 관리된다.
그러나, 어느 누군가가 소스서버에 commit or push할때, 뭔가 빠뜨리는 경우가 발생한다.
분명, 그 어느 누군가의 환경에서는 컴파일이 되나, 다른 사용자가 소스서버에서 fetch한 소스는 컴파일이 되지 않을 것 이다.

이런 경우를 사전에 회피하기 위해, continuous integration tool이 사용된다.

 그 중, 본인은 buildbot를 사용해 보았다.

기본적인 buildbot의 정보는 아래의 사이트에서 구한다.





완성된 master.cfg


c = BuildmasterConfig = {}
####### BUILDSLAVES
# The 'slaves' list defines the set of recognized buildslaves. Each element is
# a BuildSlave object, specifying a username and password.  The same username and
# password must be configured on the slave.
from buildbot.buildslave import BuildSlave
['slaves'] = [BuildSlave("아무개", "아무개암호")]


c['slavePortnum'] = 9989

from buildbot.changes.gitpoller import GitPoller
from buildbot.changes.pb import PBChangeSource

c['change_source'] = PBChangeSource()

#master.cfg.sample에서는 GitPoller를 사용하고 있으나, 잘 안 되더라...
#GIT repository가 갱신이 되어도, 잘 안 되고.
#force build는 잘 되던데... 여하튼
#본인 PBChangeSource 클래스를 사용했음.

####### SCHEDULERS
# Configure the Schedulers, which decide how to react to incoming changes.  In this
# case, just kick off a 'runtests' build

from buildbot.scheduler import Scheduler, Periodic
c['schedulers'] = []

# 매 2시간마다 컴파일 하도록 했다.
c['schedulers'].append(Periodic(name="20 minutes build scheduler",
             builderNames=["mediamanager1"],
            periodicBuildTimer=2*60))

from buildbot.process.factory import BuildFactory
from buildbot.steps.source import Git
from buildbot.steps.shell import ShellCommand


factory1 = BuildFactory()
factory1.addStep(Git(repourl='file:///git/mediaserver/appl.git', mode='update'))
factory1.addStep(ShellCommand(command=["make"], workdir="build"))


from buildbot.config import BuilderConfig

c['builders'] = []
c['builders'].append(
    BuilderConfig(name="mediamanager1",
       slavenames=["아무개"],
       factory=factory1))



c['status'] = []

from buildbot.status import html
from buildbot.status.web import auth, authz
authz_cfg=authz.Authz(

    gracefulShutdown = False,
     forceBuild = True, # use this to test your slave once it is set up
     forceAllBuilds = False,
     pingBuilder = False,
    stopBuild = False,
    stopAllBuilds = False,
     cancelPendingBuild = False,
)

c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))



c['projectName'] = "원하는 대로"
c['projectURL'] = "Trac이나 wiki주소등.."

c['buildbotURL'] = "http://localhost:8010/"

c['db_url'] = "sqlite:///state.sqlite"

Comments

Popular posts from this blog

Sqlite database is locked

sqlite는 embedded system에서 널리 사용되는 무료 dbms?(dbms라고 말하긴 좀 그렇지만, dbms라 불러주자 ㅎ) 이다. 특히 memory db 기능이 아주 유용하다. 그 밖의 dbms에서도 이 기능이 있으나, 이 기능이 지원되는 버전은 대부분 고가이다. 따라서, 무료인 sqlite를 많이들 애용하는 것 같다. 멀티쓰레드를 sqlite DB를 구현하고 롱런테스트를 하다보면, pthread_mutex_lock으로 쓰레드 간의 교착상태를 막아줘도, sqlite lock 에러가 간헐적으로 발생할 것이다. 이에 대해 본인은 다음과 같은 에러 처리 구문을 준비하여 사용하고 있다. sqlite Error가 발생하면, sqlite3_exception함수를 호출한다. 이 함수에서 sqlite error code를 구분하여, 만약, busy 또는 locked이면 최대 2초간 sleep 상태로 만드는 sqlite3_busy_timeout, busy handler를 호출한다. 그 다음, goto 구문으로 재차 sqlite3_exec를 실행한다. 단, sqlite3_exec는 transaction의 begin과 commit 또는 rollback 구문 사이에서 실행한다. 대부분 lock 에러가 발생하더라도 1~2번 실패 후에, 처리된다는 것이 본인의 테스트 결과이다. 단, journal를 WAL로 변경하였음. 기존 journal은 멀티쓰레드 지향적이지 않다는 점을 잊지마시길.... Error Code SQLITE_LOCKED (6): Database Is Locked This error code occurs when you try to do two incompatible things with a database at the same time from the same database connection. For example, if you are in the middle of a SELECT statement and y...

맥OS 사전에 사전 파일 추가하기

1. http://code.google.com/p/mac-dictionary-kit/에서 sdconv를 다운로드 받는다. 2. e4u 등과 같은 사전 파일(stardict 형식)을 다운받는다. 3. 사전 파일의 압축을 풀면, e4u.ifo, e4u.dict.dz, e4u.idx와 같은 파일이 보인다. 4. sdconv 디렉터리 내의 convert 실행 파일로 convert e4u.ifo를 실행한다. 5. 위 과정이 완료되면 아래와 같이 사전에 e4u가 추가된 점을 확인할 수 있다. 6. 순서를 조절하여 사용하면 된다.

vim에 git diff 표시하기

  먼저 gitgutter 팩을 설치 $> mkdir -p ~/.vim/pack/airblade/start $> cd ~/.vim/pack/airblade/start $> git clone https://github.com/airblade/vim-gitgutter.git $> vim -u NONE -c "helptags vim-gitgutter/doc" -c q   .vimrc 설정하기    function! GitStatus()   let [a,m,r] = GitGutterGetHunkSummary()   return printf('+%d ~%d -%d', a, m, r)   endfunction   set statusline=%<%f\ %m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%=P%l,%c%V%8P,\ %{GitStatus()} highlight GitGutterAdd    guifg=#009900 ctermfg=2 highlight GitGutterChange guifg=#bbbb00 ctermfg=3 highlight GitGutterDelete guifg=#ff2222 ctermfg=1 set signcolumn=yes highlight link GitGutterChangeLine DiffText highlight link GitGutterChangeLineNr Underlined highlight link GitGutterAddIntraLine DiffAdd