コード例 #1
0
ファイル: collect.py プロジェクト: crazyscot/muddle
def copy_from_deployment(builder,
                         name,
                         dep_name,
                         rel,
                         dest,
                         recursive=True,
                         failOnAbsentSource=False,
                         copyExactly=True,
                         domain=None,
                         usingRSync=False):
    """
    usingRSync - set to True to copy with rsync - substantially faster than
                 cp
    """
    rule = deployment.deployment_rule_from_name(builder, name)
    dep_label = Label(utils.LabelType.Deployment,
                      dep_name,
                      None,
                      utils.LabelTag.Deployed,
                      domain=domain)
    asm = AssemblyDescriptor(dep_label,
                             rel,
                             dest,
                             recursive=recursive,
                             failOnAbsentSource=failOnAbsentSource,
                             copyExactly=copyExactly,
                             usingRSync=usingRSync)
    rule.add(dep_label)
    rule.action.add_assembly(asm)
コード例 #2
0
ファイル: collect.py プロジェクト: crazyscot/muddle
def copy_from_package_obj(builder,
                          name,
                          pkg_name,
                          pkg_role,
                          rel,
                          dest,
                          recursive=True,
                          failOnAbsentSource=False,
                          copyExactly=True,
                          domain=None,
                          usingRSync=False):
    """
      - If 'usingRSync' is true, copy with rsync - substantially faster than
           cp, if you have rsync. Not very functional if you don't :-)
    """

    rule = deployment.deployment_rule_from_name(builder, name)

    dep_label = Label(utils.LabelType.Package,
                      pkg_name,
                      pkg_role,
                      utils.LabelTag.Built,
                      domain=domain)
    asm = AssemblyDescriptor(dep_label,
                             rel,
                             dest,
                             recursive=recursive,
                             failOnAbsentSource=failOnAbsentSource,
                             copyExactly=copyExactly,
                             usingRSync=usingRSync)
    rule.add(dep_label)
    rule.action.add_assembly(asm)
コード例 #3
0
ファイル: collect.py プロジェクト: crazyscot/muddle
def copy_from_checkout(builder,
                       name,
                       checkout,
                       rel,
                       dest,
                       recursive=True,
                       failOnAbsentSource=False,
                       copyExactly=True,
                       domain=None,
                       usingRSync=False):
    rule = deployment.deployment_rule_from_name(builder, name)

    dep_label = Label(utils.LabelType.Checkout,
                      checkout,
                      None,
                      utils.LabelTag.CheckedOut,
                      domain=domain)

    asm = AssemblyDescriptor(dep_label,
                             rel,
                             dest,
                             recursive=recursive,
                             failOnAbsentSource=failOnAbsentSource,
                             copyExactly=copyExactly,
                             usingRSync=usingRSync)
    rule.add(dep_label)
    rule.action.add_assembly(asm)
コード例 #4
0
ファイル: collect.py プロジェクト: tibs/muddle.mirror
def copy_from_checkout(builder, name, checkout, rel, dest,
                       recursive = True,
                       failOnAbsentSource = False,
                       copyExactly = True,
                       domain = None,
                       usingRSync = False):
    rule = deployment.deployment_rule_from_name(builder, name)

    dep_label = Label(utils.LabelType.Checkout,
                      checkout, None, utils.LabelTag.CheckedOut, domain=domain)

    asm = AssemblyDescriptor(dep_label, rel, dest,
                             recursive = recursive,
                             failOnAbsentSource = failOnAbsentSource,
                             copyExactly = copyExactly,
                             usingRSync = usingRSync)
    rule.add(dep_label)
    rule.action.add_assembly(asm)
コード例 #5
0
ファイル: collect.py プロジェクト: tibs/muddle.mirror
def copy_from_deployment(builder, name, dep_name, rel, dest,
                         recursive = True,
                         failOnAbsentSource = False,
                         copyExactly = True,
                         domain = None,
                         usingRSync = False):
    """
    usingRSync - set to True to copy with rsync - substantially faster than
                 cp
    """
    rule = deployment.deployment_rule_from_name(builder,name)
    dep_label = Label(utils.LabelType.Deployment,
                      dep_name, None, utils.LabelTag.Deployed, domain=domain)
    asm = AssemblyDescriptor(dep_label, rel, dest,
                             recursive = recursive,
                             failOnAbsentSource = failOnAbsentSource,
                             copyExactly = copyExactly,
                             usingRSync = usingRSync)
    rule.add(dep_label)
    rule.action.add_assembly(asm)
コード例 #6
0
ファイル: collect.py プロジェクト: tibs/muddle.mirror
def copy_from_package_obj(builder, name, pkg_name, pkg_role, rel,dest,
                          recursive = True,
                          failOnAbsentSource = False,
                          copyExactly = True,
                          domain = None,
                          usingRSync = False):
    """
      - If 'usingRSync' is true, copy with rsync - substantially faster than
           cp, if you have rsync. Not very functional if you don't :-)
    """

    rule = deployment.deployment_rule_from_name(builder, name)

    dep_label = Label(utils.LabelType.Package,
                      pkg_name, pkg_role, utils.LabelTag.Built, domain=domain)
    asm = AssemblyDescriptor(dep_label, rel, dest,
                             recursive = recursive,
                             failOnAbsentSource = failOnAbsentSource,
                             copyExactly = copyExactly,
                             usingRSync = usingRSync)
    rule.add(dep_label)
    rule.action.add_assembly(asm)
コード例 #7
0
ファイル: collect.py プロジェクト: tibs/muddle.mirror
def copy_from_role_install(builder, name, role, rel, dest,
                           recursive = True,
                           failOnAbsentSource = False,
                           copyExactly = True,
                           domain = None,
                           usingRSync = False,
                           obeyInstructions = True):
    """
    Add a requirement to copy from the given role's install to the named deployment.

    'name' is the name of the collecting deployment, as created by::

        deploy(builder, name)

    which is remembered as a rule whose target is ``deployment:<name>/deployed``,
    where <name> is the 'name' given.

    'role' is the role to copy from. Copying will be based from 'rel' within
    the role's ``install``, to 'dest' within the deployment.

    The label ``package:(<domain>)*{<role>}/postinstalled`` will be added as a
    dependency of the collecting deployment rule.

    An AssemblyDescriptor will be created to copy from 'rel' in the install
    directory of the label ``package:*{<role>}/postinstalled``, to 'dest'
    within the deployment directory of 'name', and added to the rule's actions.

    So, for instance::

        copy_from_role_install(builder,'fred','data','public','data/public',
                               True, False, True)

    might copy (recursively) from::

        install/data/public

    to::

        deploy/fred/data/public

    'rel' may be the empty string ('') to copy all files in the install
    directory.

    - If 'recursive' is true, then copying is recursive, otherwise it is not.
    - If 'failOnAbsentSource' is true, then copying will fail if the source
      does not exist.
    - If 'copyExactly' is true, then symbolic links will be copied as such,
      otherwise the linked file will be copied.
    - If 'usingRSync' is true, copy with rsync - substantially faster than
         cp, if you have rsync. Not very functional if you don't :-)
    - If 'obeyInstructions' is False, don't obey any applicable instructions.
    """
    rule = deployment.deployment_rule_from_name(builder, name)
    dep_label = Label(utils.LabelType.Package,
                      "*", role, utils.LabelTag.PostInstalled, domain=domain)
    asm = AssemblyDescriptor(dep_label, rel, dest,
                             recursive = recursive,
                             failOnAbsentSource = failOnAbsentSource,
                             copyExactly = copyExactly,
                             usingRSync = usingRSync,
                             obeyInstructions = obeyInstructions)
    rule.add(dep_label)
    rule.action.add_assembly(asm)
コード例 #8
0
ファイル: collect.py プロジェクト: crazyscot/muddle
def copy_from_role_install(builder,
                           name,
                           role,
                           rel,
                           dest,
                           recursive=True,
                           failOnAbsentSource=False,
                           copyExactly=True,
                           domain=None,
                           usingRSync=False,
                           obeyInstructions=True):
    """
    Add a requirement to copy from the given role's install to the named deployment.

    'name' is the name of the collecting deployment, as created by::

        deploy(builder, name)

    which is remembered as a rule whose target is ``deployment:<name>/deployed``,
    where <name> is the 'name' given.

    'role' is the role to copy from. Copying will be based from 'rel' within
    the role's ``install``, to 'dest' within the deployment.

    The label ``package:(<domain>)*{<role>}/postinstalled`` will be added as a
    dependency of the collecting deployment rule.

    An AssemblyDescriptor will be created to copy from 'rel' in the install
    directory of the label ``package:*{<role>}/postinstalled``, to 'dest'
    within the deployment directory of 'name', and added to the rule's actions.

    So, for instance::

        copy_from_role_install(builder,'fred','data','public','data/public',
                               True, False, True)

    might copy (recursively) from::

        install/data/public

    to::

        deploy/fred/data/public

    'rel' may be the empty string ('') to copy all files in the install
    directory.

    - If 'recursive' is true, then copying is recursive, otherwise it is not.
    - If 'failOnAbsentSource' is true, then copying will fail if the source
      does not exist.
    - If 'copyExactly' is true, then symbolic links will be copied as such,
      otherwise the linked file will be copied.
    - If 'usingRSync' is true, copy with rsync - substantially faster than
         cp, if you have rsync. Not very functional if you don't :-)
    - If 'obeyInstructions' is False, don't obey any applicable instructions.
    """
    rule = deployment.deployment_rule_from_name(builder, name)
    dep_label = Label(utils.LabelType.Package,
                      "*",
                      role,
                      utils.LabelTag.PostInstalled,
                      domain=domain)
    asm = AssemblyDescriptor(dep_label,
                             rel,
                             dest,
                             recursive=recursive,
                             failOnAbsentSource=failOnAbsentSource,
                             copyExactly=copyExactly,
                             usingRSync=usingRSync,
                             obeyInstructions=obeyInstructions)
    rule.add(dep_label)
    rule.action.add_assembly(asm)