Exemplo n.º 1
0
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.")
Exemplo n.º 2
0
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.")
Exemplo n.º 3
0
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.")
Exemplo n.º 4
0
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.")
Exemplo n.º 5
0
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.")
Exemplo n.º 6
0
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.")