• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.check_or_exit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中utils.check_or_exit函数的典型用法代码示例。如果您正苦于以下问题:Python check_or_exit函数的具体用法?Python check_or_exit怎么用?Python check_or_exit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了check_or_exit函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: complete

def complete():
    """
    Show complete message
    """
    utils.check_or_exit("Have you pushed the version update to master?")

    warning("Release process is now complete.")
开发者ID:xuzhaokui,项目名称:calico-docker,代码行数:7,代码来源:do_release.py


示例2: update_master

def update_master():
    """
    Master branch is now checked out and needs updating.
    """
    para("Step 4 of 5: Commit versions and push changes to master.")
    utils.check_or_exit("Is your git repository now on master")

    # Update the master files.
    utils.update_files(MASTER_VERSION_REPLACE, release_data["versions"],
                       is_release=False)

    new_version = release_data["versions"]["version"]
    para("The master codebase has now been updated to reference the latest "
         "release.")
    para("Commit changes to master")
    run("git add --all")
    run('git commit -m "Update docs to version %s"' % new_version)

    actions()
    bullet("Self review the latest changes to master")
    bullet("Run: git diff origin/master", level=1)
    bullet("Push changes to master")
    bullet("Run: git push origin master", level=1)
    bullet("Verify builds are working")
    next("Once complete, re-run the script")
开发者ID:xdongp,项目名称:calico-docker,代码行数:25,代码来源:do_release.py


示例3: update_files

def update_files():
    """
    Continue the release process by updating the version information in all
    the files.
    """
    utils.check_or_exit("Is your git repository now on the candidate release "
                        "branch")

    # Update the code tree
    utils.update_files(CANDIDATE_VERSION_REPLACE, release_data["versions"])

    new_version = release_data["versions"]["version"]
    para("The codebase has been updated to reference the release candidate "
         "artifacts.")
    actions()
    bullet("Add, commit and push the updated files to "
           "origin/%s-candidate" % new_version)
    bullet("git add --all", level=1)
    bullet('git commit -m "Update version strings for release '
           'candidate %s"' % new_version, level=1)
    bullet("git push origin %s-candidate" % new_version, level=1)
    bullet("Create a DockerHub release called '%s'" % new_version)
    bullet("Monitor the semaphore, CircleCI and Docker builds for this branch "
           "until all have successfully completed.  Fix any issues with the "
           "build.")
    bullet("Run through a subset of the demonstrations.  When running the "
           "vagrant instructions, make sure you are using the candidate "
           "branch (e.g. git checkout %s-candidate):" % new_version)
    bullet("Ubuntu libnetwork", level=1)
    bullet("CoreOS default networking", level=1)
    para("Follow the URL below to view the correct demonstration instructions "
         "for this release candidate.")
    bullet("https://github.com/projectcalico/calico-docker/tree/%s-candidate" % new_version)
    next("Once you have completed the testing, re-run the script.")
开发者ID:EasonYi,项目名称:calico-docker,代码行数:34,代码来源:do_release.py


示例4: complete

def complete():
    """
    Show complete message
    """
    para("Step 5 of 5: Complete release.")
    utils.check_or_exit("Have you pushed the version updates to master?")

    warning("Release process is now complete.")
开发者ID:xdongp,项目名称:calico-docker,代码行数:8,代码来源:do_release.py


示例5: cut_release

def cut_release():
    """
    The candidate branch has been tested, so cut the actual release.
    """
    para("Step 2 of 5: Push final branch, then cut release with binary.")
    utils.check_or_exit("Have you successfully tested your release candidate")

    # Update the code tree once more to set the final GitHub URLs
    utils.update_files(FINAL_VERSION_REPLACE, release_data["versions"])

    new_version = release_data["versions"]["version"]
    para("The codebase has been updated to reference the GitHub release "
         "artifacts.")
    bullet("Adding, committing and pushing the updated files to "
           "origin/%s-candidate" % new_version)
    run("git add --all")
    run('git commit -m "Update version strings for release '
       '%s"' % new_version)
    run("git push origin %s-candidate" % new_version)

    actions()
    bullet("Monitor the semaphore, CircleCI and Docker builds for this branch "
           "until all have successfully completed.  Fix any issues with the "
           "build.")
    bullet("Create a Pull Request against master and review the changes (or "
           "run `git diff origin/master` from the candidate branch). Delete "
           "the pull request after comparing.")
    bullet("Create a GitHub release called '%s'" % new_version)

    para("Attach the calicoctl binaries to the release.  "
         "For linux, It can be downloaded from the following URL:")
    print "http://www.projectcalico.org/builds/calicoctl?circleci-branch=%s-candidate" % new_version
    para("For Windows and Mac it can be downloaded from")
    print "http://capitalship:8080/job/calicoctl-mac/"
    print "http://capitalship:8080/job/calicoctl-windows/"

    para("Once the release has been created on GitHub, perform a final test "
         "of the release:")
    bullet("Run through a subset of the demonstrations.  When running the "
           "vagrant instructions, make sure you are using the tagged release "
           "(e.g. git checkout tags/%s):" % new_version)
    bullet("CoreOS libnetwork", level=1)
    bullet("Ubuntu default networking", level=1)
    bullet("Make sure to check the reported versions of all artifacts.")
    next("Once you have completed the testing, re-run the script.")
开发者ID:djosborne,项目名称:calico-containers,代码行数:45,代码来源:do_release.py


示例6: start_release

def start_release():
    """
    Start the release process, asking user for version information.
    :return:
    """
    para("Your git repository should be checked out to the correct revision "
         "that you want to cut a release with.  This is usually the HEAD of "
         "the master branch.")
    utils.check_or_exit("Are you currently on the correct revision")

    old_version = utils.get_calicoctl_version()
    para("Current version is: %s" % old_version)

    while True:
        new_version = raw_input("New calicoctl version?: ")
        release_type = utils.check_version_increment(old_version, new_version)
        if release_type:
            break
    para("Release type: %s" % release_type)

    para("To pin the calico libraries used by calico-docker, please specify "
         "the name of the requested versions as they appear in the GitHub "
         "releases.")

    calico_version = \
        utils.get_github_library_version("calico (felix)",
                                         "https://github.com/projectcalico/calico")
    libcalico_version = \
        utils.get_github_library_version("libcalico",
                                         "https://github.com/projectcalico/libcalico")
    libnetwork_version = \
        utils.get_github_library_version("libnetwork-plugin",
                                         "https://github.com/projectcalico/libnetwork-plugin")

    release_data["versions"] = {"version": new_version,
                                "version-no-v": new_version[1:],
                                "calico-version": calico_version,
                                "libcalico-version": libcalico_version,
                                "libnetwork-version": libnetwork_version}

    actions()
    bullet("Create a candidate release branch called "
           "'%s-candidate'." % new_version)
    bullet("git checkout -b %s-candidate" % new_version, level=1)
    next("When you have created the branch, re-run the script.")
开发者ID:EasonYi,项目名称:calico-docker,代码行数:45,代码来源:do_release.py


示例7: change_to_master

def change_to_master():
    """
    Version has been releases and tested.
    """
    utils.check_or_exit("Have you successfully tested the release")

    new_version = release_data["versions"]["version"]
    para("The release is now complete.  We now need to update the master "
         "branch and do some general branch and build tidyup.")
    actions()
    bullet("Delete the DockerHub build for this release")
    bullet("Checkout the master branch, and ensure it is up to date")
    bullet("git checkout master", level=1)
    bullet("git pull origin master", level=1)
    bullet("Delete the origin/%s-candidate branch" % new_version)
    bullet("git branch -D %s-candidate" % new_version, level=1)
    bullet("git push origin :%s-candidate" % new_version, level=1)
    next("Once complete, re-run the script.")
开发者ID:EasonYi,项目名称:calico-docker,代码行数:18,代码来源:do_release.py


示例8: cut_release

def cut_release():
    """
    The candidate branch has been tested, so cut the actual release.
    """
    utils.check_or_exit("Have you successfully tested your release candidate")

    # Update the code tree once more to set the final GitHub URLs
    utils.update_files(FINAL_VERSION_REPLACE, release_data["versions"])

    new_version = release_data["versions"]["version"]
    para("The codebase has been updated to reference the GitHub release "
         "artifacts.")
    actions()
    bullet("Add, commit and push the updated files to "
           "origin/%s-candidate" % new_version)
    bullet("git add --all", level=1)
    bullet('git commit -m "Update version strings for release '
           '%s"' % new_version, level=1)
    bullet("git push origin %s-candidate" % new_version, level=1)
    bullet("[ideally squash the two commits into one]", level=1)
    bullet("Monitor the semaphore, CircleCI and Docker builds for this branch "
           "until all have successfully completed.  Fix any issues with the "
           "build.")
    bullet("Create a Pull Request and review the changes")
    bullet("Create a GitHub release called '%s'" % new_version)

    para("Attach the calicoctl binary to the release.  It can be downloaded "
         "from the following URL:")
    bullet("http://www.projectcalico.org/latest/calicoctl?circleci-branch=%s-candidate" % new_version)

    para("Once the release has been created on GitHub, perform a final test "
         "of the release:")
    bullet("Run through a subset of the demonstrations.  When running the "
           "vagrant instructions, make sure you are using the tagged release "
           "(e.g. git checkout tags/%s):" % new_version)
    bullet("CoreOS libnetwork", level=1)
    bullet("Ubuntu default networking", level=1)
    next("Once you have completed the testing, re-run the script.")
开发者ID:EasonYi,项目名称:calico-docker,代码行数:38,代码来源:do_release.py


示例9: start_release

def start_release():
    """
    Start the release process, asking user for version information.
    :return:
    """
    para("Step 1 of 5: Create and push release branch with new versions.")
    para("Your git repository should be checked out to the correct revision "
         "that you want to cut a release with.  This is usually the HEAD of "
         "the master branch.")
    utils.check_or_exit("Are you currently on the correct revision")

    # Before asking for version info, perform validation on the current code.
    utils.validate_markdown_uris()

    old_version = utils.get_calicoctl_version()
    para("Current version is: %s" % old_version)

    new_version = arguments["CALICO_DOCKER_VERSION"]
    if not new_version:
        while True:
            new_version = raw_input("New calicoctl version?: ")
            release_type = utils.check_version_increment(old_version, new_version)
            if release_type:
                para("Release type: %s" % release_type)
                break

    calico_version = arguments["CALICO_VERSION"]
    libcalico_version = arguments["LIBCALICO_VERSION"]
    libnetwork_version = arguments["LIBNETWORK_VERSION"]
    kubernetes_version = arguments["KUBERNETES_VERSION"]


    if not (calico_version and libcalico_version and libnetwork_version and kubernetes_version):
        para("To pin the calico libraries used by calico-docker, please specify "
             "the name of the requested versions as they appear in the GitHub "
             "releases.")

        calico_version = \
            utils.get_github_library_version("calico (felix)", __felix_version__,
                                             "https://github.com/projectcalico/calico")
        libcalico_version = \
            utils.get_github_library_version("libcalico", __libcalico_version__,
                                             "https://github.com/projectcalico/libcalico")
        libnetwork_version = \
            utils.get_github_library_version("libnetwork-plugin", __libnetwork_plugin_version__,
                                             "https://github.com/projectcalico/libnetwork-plugin")

        kubernetes_version = \
            utils.get_github_library_version("kubernetes-plugin", __kubernetes_plugin_version__,
                                             "https://github.com/projectcalico/calico-kubernetes")

    release_data["versions"] = {"version": new_version,
                                "version-no-v": new_version[1:],
                                "calico-version": calico_version,
                                "libcalico-version": libcalico_version,
                                "libnetwork-version": libnetwork_version,
                                "kubernetes-version": kubernetes_version,
                                }

    bullet("Creating a candidate release branch called "
           "'%s-candidate'." % new_version)
    if arguments['--force']:
        run("git branch -D %s-candidate" % new_version)
    run("git checkout -b %s-candidate" % new_version)

    # Update the code tree
    utils.update_files(CANDIDATE_VERSION_REPLACE, release_data["versions"])

    new_version = release_data["versions"]["version"]
    para("The codebase has been updated to reference the release candidate "
         "artifacts.")

    bullet("Adding, committing and pushing the updated files to "
           "origin/%s-candidate" % new_version)
    run("git add --all")
    run('git commit -m "Update version strings for release '
           'candidate %s"' % new_version)
    if arguments['--force']:
        run("git push -f origin %s-candidate" % new_version)
    else:
        run("git push origin %s-candidate" % new_version)
    actions()
    bullet("Create a DockerHub calico/node release tagged '%s'.  Use the "
           "candidate branch as the name and /calico_node as the Dockerfile "
           "location" % new_version)
    bullet("Monitor the semaphore, CircleCI and Docker builds for this branch "
           "until all have successfully completed.  Fix any issues with the "
           "build.")
    bullet("Run through a subset of the demonstrations.  When running the "
           "vagrant instructions, make sure you are using the candidate "
           "branch (e.g. git checkout %s-candidate):" % new_version)
    bullet("Ubuntu libnetwork", level=1)
    bullet("CoreOS default networking", level=1)
    para("Follow the URL below to view the correct demonstration instructions "
         "for this release candidate.")
    bullet("https://github.com/projectcalico/calico-docker/tree/%s-candidate" % new_version)
    next("Once you have completed the testing, re-run the script.")
开发者ID:xdongp,项目名称:calico-docker,代码行数:97,代码来源:do_release.py


示例10: start_release

def start_release():
    """
    Start the release process, asking user for version information.
    :return:
    """
    new_version = arguments.get("--calico")
    if not new_version:
        new_version = raw_input("New Calico version? (vX.Y): ")

    # Check if any of the new version dirs exist already
    new_dirs = ["./%s" % new_version,
            "./_data/%s" % new_version,
            "./_layouts/%s" % new_version]
    for new_dir in new_dirs:
        if os.path.isdir(new_dir):
            # Quit instead of making assumptions.
            para("A versioned folder for %s already exists. Remove and rerun this script?" % new_dir)

    # Create the versioned directories.
    shutil.copytree("./master", new_version)
    # Temporary workdown, use vX_Y instead of vX.Y
    # https://github.com/jekyll/jekyll/issues/5429
    shutil.copytree("./_data/master", "./_data/%s" % new_version.replace(".","_"))
    shutil.copytree("./_includes/master", "./_includes/%s" % new_version)

    run("git add --all")
    run('git commit -m "Copy Master for release %s"' % new_version)

    actions()
    para("Created commit of the raw, unchanged release files.")
    para("Moving on to Version replacement of files.")

    calico_containers_version = arguments["--calico-containers"]
    if not calico_containers_version:
        calico_containers_version = \
            utils.get_github_library_version("calico-containers", "https://github.com/projectcalico/calico-containers")

    felix_version = arguments["--felix"]
    if not felix_version:
        felix_version = \
            utils.get_github_library_version("felix", "https://github.com/projectcalico/felix")

    libnetwork_version = arguments["--libnetwork"]
    if not libnetwork_version:
        libnetwork_version = \
            utils.get_github_library_version("libnetwork-plugin", "https://github.com/projectcalico/libnetwork-plugin")

    calico_cni_version = arguments["--calico-cni"]
    if not calico_cni_version:
        calico_cni_version = \
            utils.get_github_library_version("calico-cni-version", "https://github.com/projectcalico/calico-cni")

    kube_policy_controller_version = arguments["--k8s-policy-controller"]
    if not kube_policy_controller_version:
        kube_policy_controller_version = \
            utils.get_github_library_version("kube-policy-controller", "https://github.com/projectcalico/k8s-policy")

    versions = {
        "calico-version": new_version,
        "calico-containers-version": calico_containers_version,
        "calico-containers-version-no-v": calico_containers_version[1:],
        "felix-version": felix_version,
        "libnetwork-version": libnetwork_version,
        "kube-policy-controller-version": kube_policy_controller_version,
        "calico-cni-version": calico_cni_version
    }

    actions()
    para("Using:")
    para(str(versions))
    check_or_exit("Continue?")

    # Update the code tree
    utils.update_files(VERSION_REPLACE, versions)

    para("The codebase has been updated to reference the release artifacts.")
    bullet("Adding, and committing the updated files")
    run("git add --all")
    run('git commit -m "Update version strings for release %s"' % new_version)
    actions()
    para("You are done with release preparation. You now have two new commits on your branch which add the "
         "necessary files. Please: ")
    bullet("Run through a subset of the demonstrations.  When running the "
           "vagrant instructions, make sure you are using the release "
           "folder (e.g. ./%s):" % new_version)
    bullet("Ubuntu libnetwork", level=1)
    bullet("CoreOS default networking", level=1)
    bullet("CoreOS libnetwork", level=1)
    bullet("Ubuntu default networking", level=1)
    bullet("Make sure to check the reported versions of all artifacts.")
    bullet("Create a Pull Request against master and review the changes (or "
           "run `git diff origin/master` from the candidate branch). "
           "Merge when ready.")
开发者ID:caseydavenport,项目名称:calico,代码行数:93,代码来源:do_release.py



注:本文中的utils.check_or_exit函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.check_re函数代码示例发布时间:2022-05-26
下一篇:
Python utils.check_on_input函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap