contao-community-alliance/build-system-repositories

此包已被废弃,不再维护。作者建议使用 bit3/build-system-repositories 包。

CCABS 的多个仓库管理器。

dev-master / 1.0.x-dev 2014-11-11 16:31 UTC

This package is not auto-updated.

Last update: 2019-02-20 18:17:40 UTC


README

配置参考

config:
    # local path where the repositories should stored in
    storage: /local/path
    # (optional) A scheme for the repository directories, created in the storage path
    directory-scheme: %repository%

providers:
    # full bitbucket example
    bitbucket:
        # the remote name
        remote: origin
        # the provider type
        type: bitbucket
        # the name of the owner
        owner: contao-community-alliance
        # repository specific settings, all matching setting will be merged in order
        repositories:
            # a specific repository
            build-system-repositories:
                # (optional) select branches to work on
                branches:
                    # a specific branch
                    - "master"
                    # a simple wildcard branch pattern
                    - "dev-*"
                    # a regexp branch pattern (a regexp must start and end with the same non-numeric character)
                    - "~release/\d+\.\d+~"
                # (optional) select tags to work on
                tags:
                    # a specific version
                    - 1.2.3
                    # a simple wildcard version pattern
                    - 2.*
                    # a regexp version pattern (a regexp must start and end with the same non-numeric character)
                    - ~2\.\d+~
                # (optional)
                tag:
                    min: 1.1
                    max: 2
                    ignore: [ 1.2.2, 1.2.4 ]
            # a simple wildcard repository pattern
            build-system-*:
                ...
            # a regexp repository pattern (a regexp must start and end with the same non-numeric character)
            ~^build-system.*~:
                ...
        # (optional)
        tag:
            # (optional) sort tags in a specific order
            sorting: desc
            # (optional) how to compare tags with each other, use a (custom) comparing function here
            compareFunction: version_compare
            # (optional) if multiple tags are selected, limit to a specific amount (a value <=0 disable this function)
            limit: -1
        # authentication informations
        auth:
            # basic auth
            type: basic
            username: xxx
            password: xxx

    # full github example
    github:
        # the remote name
        remote: origin
        # the provider type
        type: github
        # the name of the owner
        owner: contao-community-alliance
        # repository specific settings, all matching setting will be merged in order
        repositories:
            # a specific repository
            build-system-repositories:
                # (optional) select branches to work on
                branches:
                    # a specific branch
                    - "master"
                    # a simple wildcard branch pattern
                    - "dev-*"
                    # a regexp branch pattern (a regexp must start and end with the same non-numeric character)
                    - "~release/\d+\.\d+~"
                # (optional) select tags to work on
                tags:
                    # a specific version
                    - 1.2.3
                    # a simple wildcard version pattern
                    - 2.*
                    # a regexp version pattern (a regexp must start and end with the same non-numeric character)
                    - ~2\.\d+~
                # (optional) min/max range
                tag:
                    min: 1.1
                    max: 2
            # a simple wildcard repository pattern
            build-system-*:
                ...
            # a regexp repository pattern (a regexp must start and end with the same non-numeric character)
            ~^build-system.*~:
                ...
        # (optional)
        tag:
            # (optional) sort tags in a specific order
            sorting: desc
            # (optional) how to compare tags with each other, use a (custom) comparing function here
            compareFunction: version_compare
            # (optional) if multiple tags are selected, limit to a specific amount (a value <=0 disable this function)
            limit: -1
        # authentication informations
        auth:
            # basic auth
            type: basic
            username: xxx
            password: xxx

    # full vcs example
    vcs:
        type: git
        remote: "<remote name>"
        owner: "<owner name>"
        name: "<repository name>"
        readUrl: "<repository read url>"
        writeUrl: "<repository write url>"
        webUrl: "<repository web url>"
        ref: "<ref spec>"
        realRef: "<real ref spec>"
        refType: "[ branch | tag ]"

# Actions that are executed before the execution is started, for syntax see the actions section
# Warning: repository specific placeholders are not available here!
pre:
    ...

# Actions that are executed on each repository
actions:
    # execute a process
    - git rev-parse
    - [git, rev-parse]
    - [[git, rev-parse], { workingDirectory: /some/other/pass, env: { ENV: VALUE }, timeout: 300, verbose: true }]
    # alternative syntax
    - { exec: [git, rev-parse], workingDirectory: /some/other/pass, env: { ENV: VALUE }, timeout: 300 }
    # forward to another command
    - { command: [ccabs:vcs:commit, --message, 'Do a new commit on %repository%'] }
    # group multiple actions
    -
        actions:
            - git rev-parse
            - [git, rev-parse]
            # overwrite the timeout setting for one action
            - [[git, rev-parse], { timeout: 900 }]
        # these settings will be inherited to the child-actions
        # the working directory, the default is the local repository path
        workingDirectory: /some/other/pass
        # environment variables
        env: { ENV: VALUE }
        # process timeout, the default is no timeout
        timeout: 300
        # ignore that the action has failed, otherwise an exception is thrown
        ignoreFailure: true
        # a condition to run the action(s) only under certain cases
        if: { not: { fileExists: '/some/path/that/does/NOT/exists' } }

# Actions that are executed after the execution is finished, for syntax see the actions section
# Warning: repository specific placeholders are not available here!
post:
    ...

# A list of custom variables that can be used as placeholders, note that you can not overwrite existing placeholders!
variables:
    my-path: /my/custom/path

条件参考

AND / OR 条件

...
    if:
        # the first level is an implicit AND condition
        - { ... }
        - { ... }
        - { ... }
        # AND / OR conditions can be nested
        -
            or:
                - { ... }
                -
                    and: [{...}, {...}]
                - { ... }

一个数组中的多个条件将导致 AND 条件。

...
    if:
        # produce an implicit AND condition with two conditions...
        not: { ... }
        fileExists: { ... }
        # expect it is nested to an OR condition
        or:
            not: { ... }
            fileExists: { ... }

NOT 条件

...
    # invert the result of another condition
    if: { not: { ... } }

文件存在条件

...
    # test if a file exist, placeholders are supported
    if: { fileExists: "/%dir%/to/test/for/existence" }

占位符参考

scheme从仓库 URL 提取的方案。
host从仓库 URL 提取的主机。
port从仓库 URL 提取的端口号。
user从仓库 URL 提取的用户。
pass从仓库 URL 提取的密码。
path从仓库 URL 提取的路径。
query从仓库 URL 提取的查询。
fragment从仓库 URL 提取的片段。
repository对于 `%owner%/%name%` 的快捷方式。
owner仓库所有者的名称。
name仓库的名称。
dir存储中的本地目录路径。
ref工作 ref 名称,例如 `master`。
real-ref实际 ref 名称,例如 `origin/master`。
ref-typeref 类型,`branch`,`tag` 或 `commit`。
tag最新的标签名称。
commit提交名称 / 哈希。
author-name作者名称。
author-email作者电子邮件。
author-date[:format]作者日期。
committer-name提交者名称。
committer-email提交者电子邮件。
committer-date[:format]提交者日期。