diff --git a/bincrafters/__init__.py b/bincrafters/__init__.py index 0343a1a..f4ab1d3 100644 --- a/bincrafters/__init__.py +++ b/bincrafters/__init__.py @@ -1 +1 @@ -__version__ = '0.17.8' +__version__ = '0.17.9' diff --git a/bincrafters/build_paths.py b/bincrafters/build_paths.py new file mode 100644 index 0000000..00b1f5f --- /dev/null +++ b/bincrafters/build_paths.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +BINCRAFTERS_REPO_URL = "https://api.bintray.com/conan/bincrafters/public-conan" \ No newline at end of file diff --git a/bincrafters/build_shared.py b/bincrafters/build_shared.py index edc9fd4..161e9f2 100644 --- a/bincrafters/build_shared.py +++ b/bincrafters/build_shared.py @@ -7,6 +7,7 @@ from cpt.packager import ConanMultiPackager from cpt.tools import split_colon_env from cpt.remotes import RemotesManager +from bincrafters.build_paths import BINCRAFTERS_REPO_URL def get_bool_from_env(var_name, default="1"): @@ -126,6 +127,11 @@ def get_conan_remotes(username): bincrafters_user = "bincrafters" if username != bincrafters_user: remotes.append(get_conan_upload(bincrafters_user)) + + # Force Bincrafters repo on remotes + if BINCRAFTERS_REPO_URL not in remotes: + remotes.append(BINCRAFTERS_REPO_URL) + return remotes @@ -143,6 +149,7 @@ def get_archs(): return ["x86_64"] return split_colon_env("CONAN_ARCHS") if archs else None + def get_builder(build_policy=None): name = get_name_from_recipe() username, channel, version, login_username = get_conan_vars() diff --git a/tests/test_package_tools.py b/tests/test_package_tools.py index 64f4d3f..ffb3f60 100644 --- a/tests/test_package_tools.py +++ b/tests/test_package_tools.py @@ -232,3 +232,13 @@ def test_format_mixed_remotes(set_mixed_remote_address): assert "remote1" == remote.name assert "https://api.bintray.com/conan/qux/baz" == remote.url assert True == remote.use_ssl + +def test_default_remote_address(set_upload_address): + builder = build_template_default.get_builder() + assert 2 == len(builder.remotes_manager._remotes) + remote = builder.remotes_manager._remotes[0] + assert "remotefoo" == remote.name + assert "https://api.bintray.com/conan/foo/bar" == remote.url + remote = builder.remotes_manager._remotes[1] + assert "remote1" == remote.name + assert "https://api.bintray.com/conan/bincrafters/public-conan" == remote.url