示例#1
0
def test(directory):
    config = get_config(directory)
    #TODO: Get internal apps and import it
    app_list = " ".join(INTERNAL_APPS)
    local('coverage run manage.py test %s' % app_list)
    local('coverage report --fail-under=%s' % config.get("MCConfig", "minimum_test_coverage"))
    if config.get("MCConfig", "check_quality_fater_tests"):
        quality_check()
示例#2
0
def test(directory):
    config = get_config(directory)
    #TODO: Get internal apps and import it
    app_list = " ".join(INTERNAL_APPS)
    local('coverage run manage.py test %s' % app_list)
    local('coverage report --fail-under=%s' %
          config.get("MCConfig", "minimum_test_coverage"))
    if config.get("MCConfig", "check_quality_fater_tests"):
        quality_check()
def quality_check(directory, release_type):
    config = get_config(directory)
    if config.get("MCConfig", "check_pep8"):
        local('pep8 .')
    if config.get("MCConfig", "check_jshint"):
        local('jshint assets')
    if config.get("MCConfig", "check_cyclomatic"):
        local('xenon . -a %s -m %s -b %s -i core' % (
            config.get('MCConfig', "cyclomatic_average"),
            config.get('MCConfig', "cyclomatic_module"),
            config.get('MCConfig', "cyclomatic_block"),
        ))
    if config.get("MCConfig", "check_prospector"):
        local('prospector')
示例#4
0
def cut(directory, release_type):
    config = get_config(directory)
    # Create Version File
    version_file = os.path.join(config.get("MCConfig", "version_directory"), config.get("MCConfig", "version_file"))
    if config.get("MCConfig", "run_tests_before_cut"):
        test
    if not os.path.isfile(version_file):
        bootstrap(directory)
    if release_type is "patch":
        bump_patch(config)
    elif release_type is "minor":
        bump_minor(config)
    elif release_type is "major":
        bump_major(config)
    else:
        bump_patch(config)
示例#5
0
def bootstrap(directory):
    config = get_config(directory)
    # Create Version File
    version_file = os.path.join(config.get("MCConfig", "version_directory"), config.get("MCConfig", "version_file"))
    if not os.path.isfile(version_file):
        with open(version_file, 'w') as vf:
            vf.write(_version_number)
    if config.get("MCConfig", "separate_internal_apps"):
        internal_apps_file = os.path.join(config.get("MCConfig", "settings_folder"), "installed_apps.py")
        if not os.path.isfile(internal_apps_file):
            with open(internal_apps_file, 'w') as iaf:
                iaf.write(_installed_apps)
    change_file = os.path.join(config.get("MCConfig", 'changelog_directory'), config.get("MCConfig", 'changelog_name'))
    if not os.path.isfile(change_file):
        with open(change_file, 'w') as clf:
            clf.write(_change_log)
    if not os.path.isfile(os.path.join(directory, 'docs', 'mc_commands.md')):
        generate_docs(directory)
示例#6
0
def bootstrap(directory):
    config = get_config(directory)
    # Create Version File
    version_file = os.path.join(config.get("MCConfig", "version_directory"), config.get("MCConfig", "version_file"))
    if not os.path.isfile(version_file):
        with open(version_file, "w") as vf:
            vf.write(_version_number)
    if config.get("MCConfig", "separate_internal_apps"):
        internal_apps_file = os.path.join(config.get("MCConfig", "settings_folder"), "installed_apps.py")
        if not os.path.isfile(internal_apps_file):
            with open(internal_apps_file, "w") as iaf:
                iaf.write(_installed_apps)
    change_file = os.path.join(config.get("MCConfig", "changelog_directory"), config.get("MCConfig", "changelog_name"))
    if not os.path.isfile(change_file):
        with open(change_file, "w") as clf:
            clf.write(_change_log)
    if not os.path.isfile(os.path.join(directory, "docs", "mc_commands.md")):
        generate_docs(directory)