コード例 #1
0
def getFactory():
    factory = base.getFactory();

    list = [
        steps.Git(
            repourl='https://github.com/QuasarApp/quasarAppCoin.git',
            branch=util.Interpolate('%(prop:Branch)s'),
            mode='incremental',
            submodules=True
        ),
        steps.ShellCommand(
            command= ['qmake'],
        ),
        steps.ShellCommand(
            command= ['make', 'deploy'],
        ),
        steps.CopyDirectory(
            src="build/Distro",
            dest="~/shared/quasarAppCoin/"
        )

    ]

    factory.addSteps(list);

    return factory
コード例 #2
0
def build_volk_PR():

    create_src = steps.MakeDirectory(name="create src directory", dir="volk")

    clone_step = steps.GitHub(name="fetch PR source",
                              repourl=util.Property("repository"),
                              mode="full",
                              method="fresh",
                              submodules=True,
                              retryFetch=True,
                              clobberOnFailure=True,
                              workdir="volk")

    rm_src_dir = steps.RemoveDirectory(
        dir=util.Interpolate(
            os.path.join(_PULL_SRC_BASE, "%(prop:github.number)s",
                         "%(prop:github.base.ref)s")),
        hideStepIf=lambda results, s: results == SKIPPED or results == SUCCESS,
    )

    copy_src = steps.CopyDirectory(
        name="copy src to srcdir",
        src="volk",
        dest=util.Interpolate(
            os.path.join(_PULL_SRC_BASE, "%(prop:github.number)s",
                         "%(prop:github.base.ref)s"), ),
        hideStepIf=lambda results, s: results == SKIPPED or results == SUCCESS,
    )

    # load builders.json with definitions on how to build things
    parent_path = os.path.dirname(__file__)
    with open(os.path.join(parent_path, "volk_builders.json"),
              "r") as builders_file:
        build_config = json.loads(builders_file.read())

    trigger_builds = custom_steps.BuildTrigger(
        name="trigger the right builders",
        build_config=build_config,
        schedulerNames=["trigger"],
        runner="pull",
        set_properties={
            "pr_base":
            util.Property("github.base.ref"),
            "src_dir":
            util.Interpolate(
                os.path.join(_PULL_SRC_BASE, "%(prop:github.number)s"))
        },
        test_merge=False,
        updateSourceStamp=False,
        waitForFinish=True)

    factory = util.BuildFactory()
    factory.addStep(create_src)
    factory.addStep(clone_step)
    factory.addStep(rm_src_dir)
    factory.addStep(copy_src)
    factory.addStep(trigger_builds)
    return factory
コード例 #3
0
def getFactory():
    factory = base.getFactory()

    factory.addStep(
        steps.Git(
            repourl=util.Interpolate('%(prop:repository)s'),
            branch=util.Interpolate('%(prop:branch)s'),
            mode='full',
            method='fresh',
            submodules=True,
            name='git operations',
            description='operations of git like pull clone fetch',
        ))

    factory.addSteps(LinuxSteps())
    factory.addSteps(WinSteps())
    factory.addSteps(AndroidSteps())

    factory.addStep(
        steps.CopyDirectory(
            src=util.Interpolate('build/%(prop:copyFolder)s'),
            dest=destDir,
            doStepIf=lambda step: isDeploy(step),
            name='copy buildet files',
            description='copy buildet files to shared folder',
        ))

    factory.addStep(
        steps.ShellCommand(
            command=permission,
            name='set permission',
            haltOnFailure=True,
            description='set permission for shared folder',
        ))

    return factory
コード例 #4
0
def build_weekly():

    create_src = steps.MakeDirectory(name="create src directory", dir="src")
    clone_step = steps.GitHub(name="fetch PR source",
                              repourl=util.Property("repository"),
                              mode="full",
                              method="fresh",
                              submodules=True,
                              clobberOnFailure=True,
                              getDescription=True,
                              workdir="src")

    rm_src_dir = steps.RemoveDirectory(dir=util.Interpolate(
        os.path.join(_WEEKLY_SRC_BASE, "%(prop:branch)s",
                     "%(prop:commit-description)s")))

    copy_src = steps.CopyDirectory(name="copy src to srcdir",
                                   src="src",
                                   dest=util.Interpolate(
                                       os.path.join(
                                           _WEEKLY_SRC_BASE, "%(prop:branch)s",
                                           "%(prop:commit-description)s"), ))

    set_merge_property = steps.SetProperty(
        property=util.Interpolate("merge_%(prop:branch)s"),
        value=True,
        hideStepIf=True,
    )

    # load builders.json with definitions on how to build things
    parent_path = os.path.dirname(__file__)
    with open(os.path.join(parent_path, "builders.json"),
              "r") as builders_file:
        build_config = json.loads(builders_file.read())

    # now we have all necessary merge properties together,
    # we can actually kickoff builds for them

    trigger_builds = custom_steps.BuildTrigger(
        name="trigger all builders",
        build_config=build_config,
        schedulerNames=["trigger"],
        runner="time",
        set_properties={
            "src_dir":
            util.Interpolate(
                os.path.join(_WEEKLY_SRC_BASE, "%(prop:branch)s",
                             "%(prop:commit-description)s")),
            "got_revision":
            util.Property("got_revision"),
        },
        updateSourceStamp=True,
        waitForFinish=True)

    factory = util.BuildFactory()
    factory.addStep(create_src)
    factory.addStep(clone_step)
    factory.addStep(rm_src_dir)
    factory.addStep(copy_src)
    factory.addStep(set_merge_property)
    factory.addStep(trigger_builds)
    return factory
コード例 #5
0
def build_PR():
    # @util.renderer
    # def check_mergeable(props):
    #     mergeable = props.getProperty("github.mergeable", False)
    #     return mergeable

    # check_mergeables = steps.Assert(
    #     check_mergeable,
    #     name="check if PR was mergeable",
    #     haltOnFailure=True
    # )

    create_src = steps.MakeDirectory(name="create src directory", dir="src")

    clone_step = steps.GitHub(name="fetch PR source",
                              repourl=util.Property("repository"),
                              mode="full",
                              method="fresh",
                              submodules=True,
                              retryFetch=True,
                              clobberOnFailure=True,
                              workdir="src")

    set_merge_property = steps.SetProperty(
        name="set merge property",
        property=util.Interpolate("merge_%(prop:github.base.ref)s"),
        value=True,
        hideStepIf=lambda results, s: results == SKIPPED or results == SUCCESS,
    )

    create_merge_branch = steps.ShellCommand(
        name="create test_merge branch for further steps",
        command=[
            "git", "branch", "-f",
            util.Interpolate("test_merge_%(prop:github.base.ref)s")
        ],
        workdir="src")

    rm_src_dir = steps.RemoveDirectory(
        dir=util.Interpolate(
            os.path.join(_BASEPATH, "pull", "%(prop:github.number)s",
                         "%(prop:github.base.ref)s")),
        hideStepIf=lambda results, s: results == SKIPPED or results == SUCCESS,
    )

    copy_src = steps.CopyDirectory(
        name="copy src to srcdir",
        src="src",
        dest=util.Interpolate(
            os.path.join(_BASEPATH, "pull", "%(prop:github.number)s",
                         "%(prop:github.base.ref)s"), ),
        hideStepIf=lambda results, s: results == SKIPPED or results == SUCCESS,
    )

    master_steps = sequences.mergeability_sequence("master", "maint",
                                                   _PULL_SRC_BASE)
    next_steps = sequences.mergeability_sequence("next", "master",
                                                 _PULL_SRC_BASE)
    python3_steps = sequences.mergeability_sequence("python3", "next",
                                                    _PULL_SRC_BASE)

    # load builders.json with definitions on how to build things
    parent_path = os.path.dirname(__file__)
    with open(os.path.join(parent_path, "builders.json"),
              "r") as builders_file:
        build_config = json.loads(builders_file.read())

    trigger_builds = custom_steps.BuildTrigger(
        name="trigger the right builders",
        build_config=build_config,
        schedulerNames=["trigger"],
        runner="pull",
        set_properties={
            "pr_base":
            util.Property("github.base.ref"),
            "src_dir":
            util.Interpolate(
                os.path.join(_PULL_SRC_BASE, "%(prop:github.number)s"))
        },
        updateSourceStamp=False,
        waitForFinish=True)

    factory = util.BuildFactory()
    factory.addStep(create_src)
    factory.addStep(clone_step)
    factory.addStep(set_merge_property)
    factory.addStep(create_merge_branch)
    factory.addStep(rm_src_dir)
    factory.addStep(copy_src)
    factory.addSteps(master_steps)
    factory.addSteps(next_steps)
    factory.addSteps(python3_steps)
    factory.addStep(trigger_builds)
    return factory