[users at bb.net] multiple repos build fails at fetching from wrong branch

Song Tang song.tang at yobibyte.com.au
Tue Apr 11 03:57:37 UTC 2017


Hi Pierre,
Thanks for pointing me to the right direction.
Can you give me an example regarding how to assign a git step to a codebase?
I didn't see anything in "setps.Git".

I can see git is trying to pull from the correct branch now, but I am
getting the error:

No sourcestamp found in build for codebase ''

My configuration is like this now:
####### CHANGESOURCES

all_repositories = {
  r'git at git.example.net:repo1':'repo1',
  r'git at git.example.net:repo2':'repo2',
  r'git at git.example.net:repo3':'repo3',
  r'git at git.example.net:repo4':'repo4'
}

def codebaseGenerator(chdict):
    return all_repositories[chdict['repository']]

c['codebaseGenerator'] = codebaseGenerator

c['change_source'] = []
c['change_source'].append(changes.GitPoller(
        'git at git.example.net:repo1',
         branch='dev', pollinterval=20,project='repo1',workdir='repo1'))
c['change_source'].append(changes.GitPoller(
        'git at git.example.net:repo2',
        branch='dev', pollinterval=20,project='repo2',workdir='repo2'))
c['change_source'].append(changes.GitPoller(
        'git at git.example.net:repo3',
        branch='dev', pollinterval=20,project='repo3',workdir='repo3'))
c['change_source'].append(changes.GitPoller(
        'git at git.example.net:repo4',
        branch='master', pollinterval=20,project='repo4',workdir='repo4'))

####### SCHEDULERS
repo1_codebases = {
    'repo1': {
        'repository': 'git at git.example.net:repo1',
        'branch': 'dev',
        'revision': None
    }
}

repo2_codebases = {
    'repo2': {
        'repository': 'git at git.example.net:repo2',
        'branch': 'dev',
        'revision': None
    }
}

repo3_codebases = {
    'repo3': {
        'repository': 'git at git.example.net:repo3',
        'branch': 'dev',
        'revision': None
    }
}

repo4_codebases = {
    'repo4': {
        'repository': 'git at git.example.net:repo4',
        'branch': 'master',
        'revision': None
    }
}
test_codebases = repo1_codebases.copy()
test_codebases.update(repo2_codebases)
test_codebases.update(repo3_codebases)
test_codebases.update(repo4_codebases)

test_filter = util.ChangeFilter(project=['repo1','repo2','repo3','repo4'])
c['schedulers'] = []
c['schedulers'].append(schedulers.SingleBranchScheduler(
                            name="all",
                            change_filter=test_filter,
                            treeStableTimer=30,
                            builderNames=["saltharness"],
                            codebases=test_codebases))
c['schedulers'].append(schedulers.ForceScheduler(
                            name="force",
                            builderNames=["saltharness"]))

####### BUILDERS
factory = util.BuildFactory()
factory.workdir = "O:\\Prj\\repo4"
# check out the source
factory.addStep(steps.Git(repourl='git at git.example.net:repo4',
mode='full', branch='master'))


Song Tang

On 10 April 2017 at 18:07, Pierre Tardy <tardyp at gmail.com> wrote:

> Hi Song,
>
> What you need to setup is multiple codebase.
> Each of your git step can then be assigned to one codebase so that it only
> pull the changes belonging to its codebase.
>
> Regards
>
> On Mon, Apr 10, 2017 at 7:41 AM Song Tang <song.tang at yobibyte.com.au>
> wrote:
>
>> Hi,
>> I am trying to setup a build with multiple repositories:
>> 1. There are three change sources, let's say repo1, repo2 and repo3, I
>> want buildbot to monitor dev branch on these sources
>> 2. When any of these repositories changes, I wan to buildbot to start
>> build in a forth repository(repo4) on master branch
>>
>> I can set up buildbot to start the build, but it always pulls from dev
>> branch on repo4, and because there is no dev branch in repo4, the build
>> fails.
>>
>> My change_source settings are like this:
>>
>> c['change_source'] = []
>>
>> repo1 = changes.GitPoller(
>>         'git at git.example.net:repo1',
>>         workdir='eisalt', branch='dev',
>>         pollinterval=60, pollAtLaunch=True, project='builtbot_example')
>>
>> c['change_source'].append(repo1)
>>
>> repo2 = changes.GitPoller(
>>         'git at git.example.net:repo2',
>>         workdir='eisalt', branch='dev',
>>         pollinterval=60, pollAtLaunch=True, project='builtbot_example')
>>
>> c['change_source'].append(repo2)
>>
>> repo3 = changes.GitPoller(
>>         'git at git.example.net:repo3',
>>         workdir='eisalt', branch='dev',
>>         pollinterval=60, pollAtLaunch=True, project='builtbot_example')
>>
>> c['change_source'].append(repo3)
>>
>> My Schedulers settings:
>>
>> test_filter = util.ChangeFilter(project='builtbot_example')
>> c['schedulers'] = []
>> c['schedulers'].append(schedulers.AnyBranchScheduler(
>>                             name="all",
>>                             change_filter=test_filter,
>>                             treeStableTimer=60,
>>                             builderNames=["test_worker"]))
>>
>> My BUILDERS settings:
>>
>> factory = util.BuildFactory()
>> factory.workdir = "O:\\Prj\\repo4"
>> # check out the source
>> factory.addStep(steps.Git(repourl='git at git.example.net:repo4',
>> mode='incremental', branch='master'))
>>
>> When I push a commit to repo1, repo2 or repo3, the build starts but fails
>> immediately, the error from the log is:
>>
>>
>> fatal: Couldn't find remote ref dev
>>
>> It looks like buildbot keeps pulling from the dev branch,
>>
>> am I doing it right?
>>
>> Thanks in advance
>>
>> Song Tang
>> _______________________________________________
>> users mailing list
>> users at buildbot.net
>> https://lists.buildbot.net/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20170411/643c5b60/attachment.html>


More information about the users mailing list