コード例 #1
0
def _make_parser():
    ''' Parser input arguments '''
    parser = inputs.make_parser(
        [git_utils.Argument.REPO_DIR, inputs.Argument.CONDA_BUILD_CONFIG],
        description='Create a version branch for a feedstock.')

    parser.add_argument('--repository',
                        type=str,
                        required=False,
                        help="""URL to the git repository.""")

    parser.add_argument(
        '--commit',
        type=str,
        required=False,
        help=
        """Commit to branch from. If none is provided, the head of the repo will be used."""
    )

    parser.add_argument(
        '--branch_if_changed',
        action='store_true',
        required=False,
        help=
        """If there was a change in version form the previous commit to the current one, create a version branch."""
    )

    return parser
コード例 #2
0
def _make_parser():
    ''' Parser input arguments '''
    parser = inputs.make_parser(
        [
            git_utils.Argument.PUBLIC_ACCESS_TOKEN,
            git_utils.Argument.REPO_DIR, git_utils.Argument.BRANCH,
            git_utils.Argument.SKIPPED_REPOS, git_utils.Argument.NOT_DRY_RUN,
            inputs.Argument.CONDA_BUILD_CONFIG
        ],
        description='A script that can be used to cut an open-ce release.')

    parser.add_argument('--github-org',
                        type=str,
                        default="open-ce",
                        help="""Org to cut an Open-CE release in.""")

    parser.add_argument('--primary-repo',
                        type=str,
                        default="open-ce",
                        help="""Primary open-ce repo.""")

    parser.add_argument('--code-name',
                        type=str,
                        default=None,
                        help="""Code name for release.""")

    return parser
コード例 #3
0
def _make_parser():
    ''' Parser input arguments '''
    parser = inputs.make_parser([
        git_utils.Argument.PUBLIC_ACCESS_TOKEN, git_utils.Argument.REPO_DIR,
        git_utils.Argument.BRANCH, git_utils.Argument.ORG,
        git_utils.Argument.SKIPPED_REPOS
    ],
                                description="""
                                    Tag all repos in an organization using the following logic:
                                    1- If the branch argument is passed in and that branch exists in the repo, the tag will be made at the tip of that branch.
                                    2- Otherwise, if a previous-tag is passed, the tag will be made at the tip of the latest branch which contains that tag.
                                    3- Finally, if none of these cases hold, the tag is made at the tip of the default branch.
                                    """)

    parser.add_argument('--tag',
                        type=str,
                        required=True,
                        help="""Tag to create.""")

    parser.add_argument('--tag-msg',
                        type=str,
                        required=True,
                        help="""Tag message to use.""")

    parser.add_argument('--previous-tag',
                        '--prev-tag',
                        type=str,
                        default=None,
                        help="""Previous tag to find the branch to tag.""")

    return parser
コード例 #4
0
def test_create_env_config_paths(mocker):
    '''
    Test the _create_env_config_paths function.
    '''
    mocker.patch('os.path.exists', return_value=0)
    envs_repo = "open-ce"

    parser = make_parser(
        [Argument.ENV_FILE, Argument.GIT_LOCATION, Argument.GIT_TAG_FOR_ENV])

    args = parser.parse_args(["test-env.yaml"])
    _create_env_config_paths(args)
    assert args.env_config_file[
        0] == "https://raw.githubusercontent.com/open-ce/" + envs_repo + "/main/envs/test-env.yaml"

    args = parser.parse_args(["test-env"])
    _create_env_config_paths(args)
    assert args.env_config_file[
        0] == "https://raw.githubusercontent.com/open-ce/" + envs_repo + "/main/envs/test-env.yaml"

    args = parser.parse_args(["test-env", "--git_tag_for_env", "my_tag"])
    _create_env_config_paths(args)
    assert args.env_config_file[
        0] == "https://raw.githubusercontent.com/open-ce/" + envs_repo + "/my_tag/envs/test-env.yaml"

    args = parser.parse_args(
        ["test-env", "--git_location", "https://github.com/my_org"])
    _create_env_config_paths(args)
    assert args.env_config_file[
        0] == "https://raw.githubusercontent.com/my_org/" + envs_repo + "/main/envs/test-env.yaml"
コード例 #5
0
def _make_parser():
    ''' Parser input arguments '''
    parser = inputs.make_parser(
        [
            git_utils.Argument.PUBLIC_ACCESS_TOKEN,
            git_utils.Argument.REPO_DIR, git_utils.Argument.BRANCH
        ],
        description='A script that can be used to cut an open-ce release.')

    parser.add_argument('--github-org',
                        type=str,
                        default="open-ce",
                        help="""Org to cut an Open-CE release in.""")

    parser.add_argument('--primary-repo',
                        type=str,
                        default="open-ce",
                        help="""Primary open-ce repo.""")

    parser.add_argument('--version',
                        type=str,
                        required=True,
                        help="""Release version to cut.""")

    parser.add_argument('--code-name',
                        type=str,
                        default=None,
                        help="""Code name for release.""")

    return parser
コード例 #6
0
ファイル: apply_patches.py プロジェクト: nkalband/open-ce
def make_parser():
    ''' Parser input arguments '''
    parser = inputs.make_parser(
        [
            git_utils.Argument.PUBLIC_ACCESS_TOKEN,
            git_utils.Argument.REPO_DIR, git_utils.Argument.BRANCH,
            git_utils.Argument.ORG, git_utils.Argument.SKIPPED_REPOS,
            git_utils.Argument.REVIEWERS, git_utils.Argument.TEAM_REVIEWERS,
            git_utils.Argument.PARAMS
        ],
        description='Apply patches to all repos in an organization.')

    parser.add_argument('--commit-msg',
                        type=str,
                        default="Apply Patches.",
                        help="""Commit message to use.""")

    parser.add_argument('--pr-msg',
                        type=str,
                        default="Apply Patches.",
                        help="""PR message to use.""")

    parser.add_argument('--patches',
                        type=str,
                        default="",
                        help="""Patches to aply to repos.""")

    return parser
コード例 #7
0
ファイル: tag_all_repos.py プロジェクト: nkalband/open-ce
def _make_parser():
    ''' Parser input arguments '''
    parser = inputs.make_parser(
        [
            git_utils.Argument.PUBLIC_ACCESS_TOKEN,
            git_utils.Argument.REPO_DIR, git_utils.Argument.BRANCH,
            git_utils.Argument.ORG, git_utils.Argument.SKIPPED_REPOS
        ],
        description='Tag all repos in an organization.')

    parser.add_argument('--tag',
                        type=str,
                        required=True,
                        help="""Tag to create.""")

    parser.add_argument('--tag-msg',
                        type=str,
                        required=True,
                        help="""Tag message to use.""")

    return parser