{"id":15017893,"url":"https://github.com/conan-io/conan-package-tools","last_synced_at":"2025-04-13T04:59:36.143Z","repository":{"id":39618970,"uuid":"50095521","full_name":"conan-io/conan-package-tools","owner":"conan-io","description":"Conan Package Tools. Helps with massive package creation and CI integration (Travis CI, Appveyor...)","archived":false,"fork":false,"pushed_at":"2024-06-19T12:17:28.000Z","size":1067,"stargazers_count":166,"open_issues_count":89,"forks_count":71,"subscribers_count":19,"default_branch":"develop","last_synced_at":"2025-04-13T04:59:25.967Z","etag":null,"topics":["ci-server","conan","conan-docker","docker-image","travis-ci"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/conan-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-21T09:08:21.000Z","updated_at":"2025-03-31T11:42:07.000Z","dependencies_parsed_at":"2024-09-21T11:01:01.937Z","dependency_job_id":"899ff88e-e8ba-4d4b-a306-ae8b5159e512","html_url":"https://github.com/conan-io/conan-package-tools","commit_stats":{"total_commits":680,"total_committers":50,"mean_commits":13.6,"dds":0.5397058823529413,"last_synced_commit":"8cd5f1692f99c102c0f8935233b1f475ee6d6f9f"},"previous_names":[],"tags_count":179,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conan-io%2Fconan-package-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conan-io%2Fconan-package-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conan-io%2Fconan-package-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conan-io%2Fconan-package-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/conan-io","download_url":"https://codeload.github.com/conan-io/conan-package-tools/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665756,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci-server","conan","conan-docker","docker-image","travis-ci"],"created_at":"2024-09-24T19:51:08.807Z","updated_at":"2025-04-13T04:59:36.120Z","avatar_url":"https://github.com/conan-io.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![.github/workflows/conan_package_tools.yml](https://github.com/conan-io/conan-package-tools/actions/workflows/conan_package_tools.yml/badge.svg)](https://github.com/conan-io/conan-package-tools/actions/workflows/conan_package_tools.yml)\n[![codecov](https://codecov.io/gh/conan-io/conan-package-tools/branch/master/graph/badge.svg)](https://codecov.io/gh/conan-io/conan-package-tools)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/conan-package-tools.svg?style=plastic)\n\n## This project is no longer recommended or maintained 🛑\n\nThis project is no longer maintained, it will not get any fixes or support.\nIt will be soon fully archived.\nModern Conan 2.0 extensions can be found in https://github.com/conan-io/conan-extensions\n\n\n## Conan 2.0 support :warning:\n\n**The project Conan Package Tools does not support Conan 2.x and there is no current planned support.**\n\n\nIn case you need such support, please, open an issue explaining your current case with more details.\n\n# Conan Package Tools\n\n- [Conan Package Tools](#conan-package-tools)\n  - [Introduction](#introduction)\n  - [Installation](#installation)\n  - [How it works](#how-it-works)\n    - [Basic, but not very practical, example](#basic-but-not-very-practical-example)\n  - [Generating the build configurations automatically](#generating-the-build-configurations-automatically)\n  - [Filtering or modifying the configurations](#filtering-or-modifying-the-configurations)\n  - [Package Version based on Commit Checksum](#package-version-based-on-commit-checksum)\n  - [Save created packages summary](#save-created-packages-summary)\n  - [Using all values for custom options](#using-all-values-for-custom-options)\n  - [Using Docker](#using-docker)\n    - [Running scripts and executing commands before to build on Docker](#running-scripts-and-executing-commands-before-to-build-on-docker)\n    - [Using with your own Docker images](#using-with-your-own-docker-images)\n    - [Installing extra python packages before to build](#installing-extra-python-packages-before-to-build)\n    - [Passing additional Docker parameters during build](#passing-additional-docker-parameters-during-build)\n    - [Installing custom Conan config](#installing-custom-conan-config)\n  - [Specifying a different base profile](#specifying-a-different-base-profile)\n  - [Specifying build context for cross building](#specifying-build-context-for-cross-building)\n- [The CI integration](#the-ci-integration)\n  - [Travis integration](#travis-integration)\n  - [Appveyor integration](#appveyor-integration)\n  - [Bamboo CI integration](#bamboo-ci-integration)\n  - [Jenkins CI integration](#jenkins-ci-integration)\n  - [GitLab CI integration](#gitlab-ci-integration)\n  - [Upload packages](#upload-packages)\n  - [Upload dependencies (#237)](#upload-dependencies-237)\n  - [Pagination](#pagination)\n    - [Sequencial distribution](#sequencial-distribution)\n    - [Named pages](#named-pages)\n    - [Generating multiple references for the same recipe](#generating-multiple-references-for-the-same-recipe)\n  - [Working with Bintray: Configuring repositories](#working-with-bintray-configuring-repositories)\n  - [Visual Studio auto-configuration](#visual-studio-auto-configuration)\n  - [MinGW builds](#mingw-builds)\n  - [Clang builds](#clang-builds)\n- [FULL REFERENCE](#full-reference)\n  - [ConanMultiPackager parameters reference](#conanmultipackager-parameters-reference)\n  - [Commit messages reference](#commit-messages-reference)\n  - [Complete ConanMultiPackager methods reference:](#complete-conanmultipackager-methods-reference)\n  - [Environment configuration](#environment-configuration)\n- [Full example](#full-example)\n\n\n## Introduction\n\nThis package allows to automate the creation of [conan](https://github.com/conan-io/conan) packages for different configurations.\n\nIt eases the integration with CI servers like [TravisCI](https://travis-ci.org/) and [Appveyor](http://www.appveyor.com/), so you can use the\ncloud to generate different binary packages for your conan recipe.\n\nAlso supports Docker to create packages for different **GCC and Clang** versions.\n\n## Installation\n\n    $ pip install conan_package_tools\n\n\nOr you can [clone this repository](http://github.com/conan-io/conan-package-tools) and store its location in PYTHONPATH.\n\n\n## How it works\n\nUsing only conan C/C++ package manager (without conan package tools), you can use the `conan create` command to generate, for the same recipe, different binary packages for different configurations.\nThe easier way to do it is using profiles:\n\n    $ conan create myuser/channel --profile win32\n    $ conan create myuser/channel --profile raspi\n    $ ...\n\nThe profiles can contain, settings, options, environment variables and build_requires. Take a look to the [conan docs](https://docs.conan.io) to know more.\n\n`Conan package tools` allows to declare (or autogenerate) a set of different configurations (different profiles). It will call `conan create` for each one, uploading the generated packages\nto a remote (if needed), and using optionally docker images to ease the creation of different binaries for different compiler versions (gcc and clang supported).\n\n### Basic, but not very practical, example\n\nCreate a **build.py** file in your recipe repository, and add the following lines:\n\n    from cpt.packager import ConanMultiPackager\n\n\tif __name__ == \"__main__\":\n\t    builder = ConanMultiPackager(username=\"myusername\")\n\t    builder.add(settings={\"arch\": \"x86\", \"build_type\": \"Debug\"},\n\t                options={}, env_vars={}, build_requires={})\n\t    builder.add(settings={\"arch\": \"x86_64\", \"build_type\": \"Debug\"},\n\t                options={}, env_vars={}, build_requires={})\n\t    builder.run()\n\nNow we can run the python script, the `ConanMutiPackager` will run the `conan create` command two times, one to generate `x86 Debug` package and\nanother one for `x86_64 Debug`.\n\n\n    \u003e python build.py\n\n    ############## CONAN PACKAGE TOOLS ######################\n\n    INFO: ******** RUNNING BUILD **********\n    conan create myuser/testing --profile /var/folders/y1/9qybgph50sjg_3sm2_ztlm6dr56zsd/T/tmpz83xXmconan_package_tools_profiles/profile\n\n    [build_requires]\n    [settings]\n    arch=x86\n    build_type=Debug\n    [options]\n    [scopes]\n    [env]\n\n    ...\n\n\n    ############## CONAN PACKAGE TOOLS ######################\n\n    INFO: ******** RUNNING BUILD **********\n    conan create myuser/testing --profile /var/folders/y1/9qybgph50sjg_3sm2_ztlm6dr56zsd/T/tmpMiqSZUconan_package_tools_profiles/profile\n\n    [build_requires]\n    [settings]\n    arch=x86_64\n    build_type=Debug\n    [options]\n    [scopes]\n    [env]\n\n\n    #########################################################\n\n    ...\n\n\nIf we inspect the local cache we can see that there are two binaries generated for our recipe, in this case the zlib recipe:\n\n    $ conan search zlib/1.2.11@myuser/testing\n\n    Existing packages for recipe zlib/1.2.11@myuser/testing:\n\n    Package_ID: a792eaa8ec188d30441564f5ba593ed5b0136807\n        [options]\n            shared: False\n        [settings]\n            arch: x86\n            build_type: Debug\n            compiler: apple-clang\n            compiler.version: 9.0\n            os: Macos\n        outdated from recipe: False\n\n    Package_ID: e68b263f26a4d7513e28c9cae1673aa0466af777\n        [options]\n            shared: False\n        [settings]\n            arch: x86_64\n            build_type: Debug\n            compiler: apple-clang\n            compiler.version: 9.0\n            os: Macos\n        outdated from recipe: False\n\n\nNow, we could add new build configurations, but in this case we only want to add Visual Studio configurations and the runtime, but, of course, only if we are on Windows:\n\n    import platform\n    from cpt.packager import ConanMultiPackager\n\n\tif __name__ == \"__main__\":\n\t    builder = ConanMultiPackager(username=\"myusername\")\n\t    if platform.system() == \"Windows\":\n\t        builder.add(settings={\"arch\": \"x86\", \"build_type\": \"Debug\", \"compiler\": \"Visual Studio\", \"compiler.version\": 14, \"compiler.runtime\": \"MTd\"},\n\t                    options={}, env_vars={}, build_requires={})\n\t        builder.add(settings={\"arch\": \"x86_64\", \"build_type\": \"Release\", \"compiler\": \"Visual Studio\", \"compiler.version\": 14, \"compiler.runtime\": \"MT\"},\n\t                    options={}, env_vars={}, build_requires={})\n\t    else:\n\t        builder.add(settings={\"arch\": \"x86\", \"build_type\": \"Debug\"},\n\t                    options={}, env_vars={}, build_requires={})\n\t        builder.add(settings={\"arch\": \"x86_64\", \"build_type\": \"Debug\"},\n\t                    options={}, env_vars={}, build_requires={})\n\t    builder.run()\n\nIn the previous example, when we are on Windows, we are adding two build configurations:\n\n    - \"Visual Studio 14, Debug, MTd runtime\"\n    - \"Visual Studio 14, Release, MT runtime\"\n\n\nWe can also adjust the options, environment variables and build_requires:\n\n\tfrom cpt.packager import ConanMultiPackager\n\n\tif __name__ == \"__main__\":\n\t    builder = ConanMultiPackager(username=\"myuser\")\n\t    builder.add({\"arch\": \"x86\", \"build_type\": \"Release\"},\n\t                {\"mypackage:option1\": \"ON\"},\n\t                {\"PATH\": \"/path/to/custom\"},\n\t                {\"*\": [\"MyBuildPackage/1.0@lasote/testing\"]})\n        builder.add({\"arch\": \"x86_64\", \"build_type\": \"Release\"}, {\"mypackage:option1\": \"ON\"})\n        builder.add({\"arch\": \"x86\", \"build_type\": \"Debug\"}, {\"mypackage:option2\": \"OFF\", \"mypackage:shared\": True})\n\t    builder.run()\n\n\nWe could continue adding configurations, but probably you realized that it would be such a tedious task if you want to generate many different configurations\nin different operating systems, using different compilers, different compiler versions etc.\n\n## Generating the build configurations automatically\n\nConan package tools can generate automatically a matrix of build configurations combining  architecture, compiler, compiler.version, compiler.runtime, compiler.libcxx, build_type and\nand shared/static options.\n\n\n    from cpt.packager import ConanMultiPackager\n\n    if __name__ == \"__main__\":\n        builder = ConanMultiPackager()\n        builder.add_common_builds()\n        builder.run()\n\nIf you run the ``python build.py`` command, for instance, in Mac OSX, it will add the following configurations automatically:\n\n```\n{'compiler.version': '7.3', 'arch': 'x86', 'build_type': 'Release', 'compiler': 'apple-clang'})\n{'compiler.version': '7.3', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'apple-clang'})\n{'compiler.version': '7.3', 'arch': 'x86_64', 'build_type': 'Release', 'compiler': 'apple-clang'})\n{'compiler.version': '7.3', 'arch': 'x86_64', 'build_type': 'Debug', 'compiler': 'apple-clang'})\n{'compiler.version': '8.0', 'arch': 'x86', 'build_type': 'Release', 'compiler': 'apple-clang'})\n{'compiler.version': '8.0', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'apple-clang'})\n{'compiler.version': '8.0', 'arch': 'x86_64', 'build_type': 'Release', 'compiler': 'apple-clang'})\n{'compiler.version': '8.0', 'arch': 'x86_64', 'build_type': 'Debug', 'compiler': 'apple-clang'})\n{'compiler.version': '8.1', 'arch': 'x86', 'build_type': 'Release', 'compiler': 'apple-clang'})\n{'compiler.version': '8.1', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'apple-clang'})\n{'compiler.version': '8.1', 'arch': 'x86_64', 'build_type': 'Release', 'compiler': 'apple-clang'})\n{'compiler.version': '8.1', 'arch': 'x86_64', 'build_type': 'Debug', 'compiler': 'apple-clang'})\n```\n\nThese are all the combinations of arch=x86/x86_64, build_type=Release/Debug for different compiler versions.\n\nBut having different apple-clang compiler versions installed in the same machine is not common at all.\nWe can adjust the compiler versions using a parameter or an environment variable, specially useful for a CI environment:\n\n    from cpt.packager import ConanMultiPackager\n\n    if __name__ == \"__main__\":\n        builder = ConanMultiPackager(apple_clang_versions=[\"9.0\"]) # or declare env var CONAN_APPLE_CLANG_VERSIONS=9.0\n        builder.add_common_builds()\n        builder.run()\n\nIn this case, it will call `conan create` with only this configurations:\n\n```\n{'compiler.version': '9.0', 'arch': 'x86', 'build_type': 'Release', 'compiler': 'apple-clang'})\n{'compiler.version': '9.0', 'arch': 'x86', 'build_type': 'Debug', 'compiler': 'apple-clang'})\n{'compiler.version': '9.0', 'arch': 'x86_64', 'build_type': 'Release', 'compiler': 'apple-clang'})\n{'compiler.version': '9.0', 'arch': 'x86_64', 'build_type': 'Debug', 'compiler': 'apple-clang'})\n```\n\nYou can adjust other constructor parameters to control the build configurations that will be generated:\n\n\n- **gcc_versions**: Generate only build configurations for the specified gcc versions (Ignored if the current machine is not Linux)\n- **visual_versions**: Generate only build configurations for the specified Visual Studio versions (Ignore if the current machine is not Windows)\n- **visual_runtimes**: Generate only build configurations for the specified runtimes. (only for Visual Studio)\n- **visual_toolsets**: Specify the toolsets per each specified Visual Studio version. (only for Visual Studio)\n- **msvc_versions**: Generate only build configurations for the specified msvc versions (Ignore if the current machine is not Windows)\n- **msvc_runtimes**: Generate only build configurations for the specified runtimes. (only for msvc)\n- **msvc_runtime_types**: Specify the runtime types per each specified msvc version. (only for msvc)\n- **apple_clang_versions**: Generate only build configurations for the specified apple clang versions (Ignored if the current machine is not OSX)\n- **archs**: Generate build configurations for the specified architectures, by default, [\"x86\", \"x86_64\"].\n- **build_types**: Generate build configurations for the specified build_types, by default [\"Debug\", \"Release\"].\n\nOr you can adjust environment variables:\n\n- **CONAN_GCC_VERSIONS**\n- **CONAN_VISUAL_VERSIONS**\n- **CONAN_VISUAL_RUNTIMES**\n- **CONAN_VISUAL_TOOLSETS**\n- **CONAN_MSVC_VERSIONS**\n- **CONAN_MSVC_RUNTIMES**\n- **CONAN_MSVC_RUNTIME_TYPES**\n- **CONAN_APPLE_CLANG_VERSIONS**\n- **CONAN_CLANG_VERSIONS**\n- **CONAN_ARCHS**\n- **CONAN_BUILD_TYPES**\n\nCheck the **REFERENCE** section to see all the parameters and **ENVIRONMENT VARIABLES** available.\n\n\n---\n**IMPORTANT!** Both the constructor parameters and the corresponding environment variables of the previous list ONLY have effect when using `builder.add_common_builds()`.\n\n---\n\n\nSo, if we want to generate packages for ``x86_64`` and ``armv8`` but only for ``Debug`` and ``apple-clang 9.0``:\n\n\n    $ export CONAN_ARCHS=x86_64,armv8\n    $ export CONAN_APPLE_CLANG_VERSIONS=9.0\n    $ export CONAN_BUILD_TYPES=Debug\n\n    $ python build.py\n\n\nThere are also two additional parameters of the ``add_common_builds``:\n\n- **pure_c**: (Default True) If your project is C++, pass the **pure_c=False** to add both\n              combinations using **libstdc** and **libstdc++11** for the setting **compiler.libcxx**.\n              When True, the default profile value of ``libcxx`` will be applied.\n              If you don't want ``libcxx`` value to apply\n              to your binary packages you have to use the ``configure`` method to remove it:\n\n```\n    def configure(self):\n        del self.settings.compiler.libcxx\n```\n\n- **shared_option_name**: If your conanfile.py have an option **shared**, the generated builds will contain automatically the \"True/False\" combination for that option.\n  Pass \"False\" to deactivate it or \"lib_name:shared_option_name\" to specify a custom option name, e.j: boost:my_shared``\n- **dll_with_static_runtime**: Will add also the combination of runtime MT with shared libraries.\n- **header_only**: If your conanfile.py have an option **header_only**, the generated builds will contain automatically the \"True/False\" combination for that option [#454](https://github.com/conan-io/conan-package-tools/issues/454).\n- **build_all_options_values**: It includes all possible values for the listed options [#457](https://github.com/conan-io/conan-package-tools/issues/457).\n\n```\nfrom cpt.packager import ConanMultiPackager\n\nif __name__ == \"__main__\":\n    builder = ConanMultiPackager()\n    builder.add_common_builds(shared_option_name=\"mypackagename:shared\", pure_c=False)\n    builder.run()\n```\n\n## Filtering or modifying the configurations\n\n\nUse the `remove_build_if` helper with a lambda function to filter configurations:\n\n\n    from cpt.packager import ConanMultiPackager\n\n    builder = ConanMultiPackager(username=\"myuser\")\n    builder.add_common_builds()\n    builder.remove_build_if(lambda build: build.settings[\"compiler.version\"] == \"4.6\" and build.settings[\"build_type\"] == \"Debug\")\n\nUse the `update_build_if` helper with a lambda function to alter configurations:\n\n\n    from cpt.packager import ConanMultiPackager\n\n    builder = ConanMultiPackager(username=\"myuser\")\n    builder.add_common_builds()\n    builder.update_build_if(lambda build: build.settings[\"os\"] == \"Windows\",\n                            new_build_requires={\"*\": [\"7zip_installer/0.1.0@conan/stable\"]})\n    # Also avaiable parameters:\n    #    new_settings, new_options, new_env_vars, new_build_requires, new_reference\n\n\nOr you can directly iterate the builds to do any change. EX: Remove the GCC 4.6 packages with build_type=Debug:\n\n    from cpt.packager import ConanMultiPackager\n\n    if __name__ == \"__main__\":\n        builder = ConanMultiPackager(username=\"myuser\")\n        builder.add_common_builds()\n        filtered_builds = []\n        for settings, options, env_vars, build_requires, reference in builder.items:\n            if settings[\"compiler.version\"] != \"4.6\" and settings[\"build_type\"] != \"Debug\":\n                 filtered_builds.append([settings, options, env_vars, build_requires, reference])\n        builder.builds = filtered_builds\n        builder.run()\n\n\n## Package Version based on Commit Checksum\n\nSometimes you want to use Conan as [in-source](https://docs.conan.io/en/latest/creating_packages/package_repo.html) but you do not need to specify a version in the recipe, it could be configured by your build environment. Usually you could use the branch name as the package version, but if you want to create unique packages for each new build, upload it and do not override on your remote, you will need to use a new version for each build. In this case, the branch name will not be enough, so a possible approach is to use your current commit checksum as version:\n\n\n    from cpt.packager import ConanMultiPackager\n    from cpt.ci_manager import CIManager\n    from cpt.printer import Printer\n\n\n    if __name__ == \"__main__\":\n        printer = Printer()\n        ci_manager = CIManager(printer)\n        builder = ConanMultiPackager(reference=\"mypackage/{}\".format(ci_manager.get_commit_id()[:7]))\n        builder.add_common_builds()\n        builder.run()\n\nAs SHA-1 is 40 digits long, you could format the result to short size\n\n## Save created packages summary\nIn case you want to integrate CPT with other tools, for example you want to have build logic after creating packages, you can save a json report about all configurations and packages.\n\n**Examples**:\n\n    from cpt.packager import ConanMultiPackager\n\n    if __name__ == \"__main__\":\n        builder = ConanMultiPackager()\n        builder.add_common_builds()\n        builder.run(summary_file='cpt_summary_file.json')\n\n\n    from cpt.packager import ConanMultiPackager\n\n    if __name__ == \"__main__\":\n        builder = ConanMultiPackager()\n        builder.add_common_builds()\n        builder.run()\n        builder.save_packages_summary('cpt_summary_file.json')\n\n\nAlternatively you can use the `CPT_SUMMARY_FILE` environment variable to set the summary file path\n\n## Using all values for custom options\nSometimes you want to include more options to your matrix, including all possible combinations, so that, you can use **build_all_options_values**:\n\n    from cpt.packager import ConanMultiPackager\n\n\n    if __name__ == \"__main__\":\n        builder = ConanMultiPackager(reference=\"mypackage/0.1.0\")\n        builder.add_common_builds(build_all_options_values=[\"mypackage:foo\", \"mypackage:bar\"])\n        builder.run()\n\nNow let's say mypackage's recipe contains the follow options: *shared*, *fPIC*, *foo* and *bar*. Both *foo* and *bar* can accept **True** or **False**.\nThe method add_common_builds will generate a matrix including both *foo* and *bar* with all possible combinations.\n\n## Using Docker\n\nInstance ConanMultiPackager with the parameter **use_docker=True**, or declare the environment variable **CONAN_USE_DOCKER**:\nIt will launch, when needed, a container for the current build configuration that is being built (only for Linux builds).\n\nThere are docker images available for different gcc versions: 4.6, 4.8, 4.9, 5, 6, 7 and clang versions: 3.8, 3.9, 4.0.\n\nThe containers will share the conan storage directory, so the packages will be generated in your conan directory.\n\n**Example**:\n\n\n    from cpt.packager import ConanMultiPackager\n\n\tif __name__ == \"__main__\":\n\t    builder = ConanMultiPackager()\n\t    builder.add_common_builds()\n\t    builder.run()\n\nAnd run the build.py:\n\n    $ export CONAN_USERNAME=myuser\n    $ export CONAN_GCC_VERSIONS=4.9\n    $ export CONAN_DOCKER_IMAGE=conanio/gcc49\n    $ export CONAN_USE_DOCKER=1\n    $ python build.py\n\n\nIt will generate a set of build configurations (profiles) for gcc 4.9 and will run it inside a container of the ``conanio/gcc49`` image.\n\nIf you want to run the arch=\"x86\" build inside a docker container of 32 bits you can set the parameter ``docker_32_images`` in the\nConanMultiPackager constructor or set the environment variable ``CONAN_DOCKER_32_IMAGES``. In this case, the docker image name to use\nwill be appended with ``-i386``.\n\nThe Docker images used by default both for 64 and 32 bits are pushed to dockerhub and its Dockerfiles are  available in the\n[conan-docker-tools](https://github.com/conan-io/conan-docker-tools) repository.\n\n### Running scripts and executing commands before to build on Docker\n\nWhen Conan Package Tools uses Docker to build your packages, sometimes you need to execute a \"before build\" step. If\nyou need to install packages, change files or create a setup, there is an option for that: **docker_entry_script**\n\n**Example**:\n\nThis example shows how to install *tzdata* package by apt-get, before to build the Conan package.\n\n    from cpt.packager import ConanMultiPackager\n\n\tif __name__ == \"__main__\":\n        command = \"sudo apt-get -qq update \u0026\u0026 sudo apt-get -qq install -y tzdata\"\n\t    builder = ConanMultiPackager(use_docker=True, docker_image='conanio/gcc7', docker_entry_script=command)\n\t    builder.add_common_builds()\n\t    builder.run()\n\nAlso, it's possible to run some internal script, before to build the package:\n\n    from cpt.packager import ConanMultiPackager\n\n    if __name__ == \"__main__\":\n        command = \"python bootstrap.py\"\n        builder = ConanMultiPackager(use_docker=True, docker_image='conanio/gcc7', docker_entry_script=command)\n        builder.add_common_builds()\n        builder.run()\n\n### Using with your own Docker images\nThe default location inside the Docker container is `/home/conan` on Linux and\n`C:\\Users\\ContainerAdministrator` on Windows. This is fine if you use the conan\nDocker images but if you are using your own image, these locations probably won't\nexist.\n\nTo use a different location, you can use the option `docker_conan_home` or the\nenvironment variable `CONAN_DOCKER_HOME`.\n\n### Installing extra python packages before to build\n\nMaybe you need to install some python packages using pip before to build your conan package. To solve this situation\nyou could use **pip_install**:\n\n**Example**:\n\nThis example installs bincrafters-package-tools and conan-promote before to build:\n\n    from cpt.packager import ConanMultiPackager\n\n    if __name__ == \"__main__\":\n        builder = ConanMultiPackager(pip_install=[\"bincrafters-package-tools==0.17.0\", \"conan-promote==0.1.2\"])\n        builder.add_common_builds()\n        builder.run()\n\nBut if you prefer to use environment variables:\n\n    export CONAN_PIP_INSTALL=\"bincrafters-package-tools==0.17.0,conan-promote=0.1.2\"\n\n### Passing additional Docker parameters during build\nWhen running `conan create` step in Docker, you might want to run the container with a different Docker network. For this you can use `docker_run_options` parameter (or `CONAN_DOCKER_RUN_OPTIONS` envvar)\n\n    builder = ConanMultiPackager(\n      docker_run_options='--network bridge --privileged',\n      ...\n\nWhen run, this will translate to something like this:\n\n    sudo -E docker run ... --network bridge --privileged conanio/gcc6 /bin/sh -c \"cd project \u0026\u0026  run_create_in_docker\"\n\n\n### Installing custom Conan config\n\nTo solve custom profiles and remotes, Conan provides the [config](https://docs.conan.io/en/latest/reference/commands/consumer/config.html) feature where is possible to edit the conan.conf or install config files.\n\nIf you need to run `conan config install \u003curl\u003e` before to build there is the argument `config_url` in CPT:\n\n    from cpt.packager import ConanMultiPackager\n\n    if __name__ == \"__main__\":\n        config_url = \"https://github.com/bincrafters/conan-config.git\"\n        builder = ConanMultiPackager(config_url=config_url)\n        builder.add_common_builds()\n        builder.run()\n\nBut if you are not interested to update your build.py script, it's possible to use environment variables instead:\n\n    export CONAN_CONFIG_URL=https://github.com/bincrafters/conan-config.git\n\n## Specifying a different base profile\n\nThe options, settings and environment variables that the ``add_common_builds()`` method generate, are applied into the `default` profile\nof the conan installation. If you want to use a different profile you can pass the name of the profile in the ``run()`` method.\n\n\n **Example**:\n\n\n    from cpt.packager import ConanMultiPackager\n\n\tif __name__ == \"__main__\":\n\t    builder = ConanMultiPackager(clang_versions=[\"3.8\", \"3.9\"])\n\t    builder.add_common_builds()\n\t    builder.run(\"myclang\")\n\nAlternatively you can use the `CONAN_BASE_PROFILE` environment variable to choose a different base profile:\n\n    CONAN_BASE_PROFILE=myclang\n\n## Specifying build context for cross building\n\nSince Conan 1.24, you can pass an additional profile for build context, so that, you can pass both profiles by\nenvironment variables:\n\n\n```python\nfrom cpt.packager import ConanMultiPackager\n\nif __name__ == \"__main__\":\n    builder = ConanMultiPackager(gcc_versions=[\"10\", \"11\"])\n    builder.add_common_builds()\n    builder.run(base_profile_name=\"raspberrypi\", base_profile_build_name=\"default\")\n```\n\nThe `base_profile_name` is equivalent to profile host, where my libraries and executables will run, and the\n`base_profile_build_name` is the profile related where the artifacts are built.\n\nAlso, you can use environment variables instead:\n\n    CONAN_BASE_PROFILE=default\n    CONAN_BASE_PROFILE_BUILD=raspberrypi\n\nRead more build context [here](https://docs.conan.io/en/latest/systems_cross_building/cross_building.html#conan-v1-24-and-newer)\n\n# The CI integration\n\nIf you are going to use a CI server to generate different binary packages for your recipe, the best approach is to control\nthe build configurations with environment variables.\n\nSo, having a generic ``build.py`` should be enough for almost all the cases:\n\n\n    from cpt.packager import ConanMultiPackager\n\n\tif __name__ == \"__main__\":\n\t    builder = ConanMultiPackager()\n\t    builder.add_common_builds(shared_option_name=\"mypackagename:shared\", pure_c=False)\n\t    builder.run()\n\nThen, in your CI configuration, you can declare different environment variables to limit the build configurations to an specific compiler version,\nusing a specific docker image etc.\n\nFor example, if you declare the following environment variables:\n\n    CONAN_GCC_VERSIONS=4.9\n    CONAN_DOCKER_IMAGE=conanio/gcc49\n\nthe ``add_common_builds()`` method will only add different build configurations for GCC=4.9 and will run them in a docker container.\n\nYou can see working integrations with Travis and Appveyor in the zlib repository [here](https://github.com/conan-community/conan-zlib)\n\n\n## Travis integration\n\nTravis CI can generate a build with multiple jobs defining a matrix with environment variables.\nWe can configure the builds to be executed in the jobs by defining some environment variables.\n\nThe following is a real example of a **.travis.yml** file that will generate packages for Linux gcc (4.9, 5, 6), Linux Clang (3.9 and 4.0) and OSx with apple-clang (8.0, 8.1 and 9.0).\n\nRemember, you can use `conan new` command to generate the base files for appveyor, travis etc. Check `conan new --help`.\n\n\n**.travis.yml** example:\n\n\n    env:\n       global:\n         - CONAN_USERNAME: \"conan\" # ADJUST WITH YOUR REFERENCE USERNAME!\n         - CONAN_LOGIN_USERNAME: \"lasote\" # ADJUST WITH YOUR LOGIN USERNAME!\n         - CONAN_CHANNEL: \"testing\" # ADJUST WITH YOUR CHANNEL!\n         - CONAN_UPLOAD: \"https://api.bintray.com/conan/conan-community/conan\" # ADJUST WITH YOUR REMOTE!\n         - CONAN_STABLE_BRANCH_PATTERN: \"release/*\"\n         - CONAN_UPLOAD_ONLY_WHEN_STABLE: 1 # Will only upload when the branch matches \"release/*\"\n\n    linux: \u0026linux\n       os: linux\n       sudo: required\n       language: python\n       python: \"3.6\"\n       services:\n         - docker\n    osx: \u0026osx\n       os: osx\n       language: generic\n    matrix:\n       include:\n\n          - \u003c\u003c: *linux\n            env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49\n          - \u003c\u003c: *linux\n            env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5\n          - \u003c\u003c: *linux\n            env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6\n          - \u003c\u003c: *linux\n            env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=conanio/gcc7\n          - \u003c\u003c: *linux\n            env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39\n          - \u003c\u003c: *linux\n            env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40\n          - \u003c\u003c: *osx\n            osx_image: xcode7.3\n            env: CONAN_APPLE_CLANG_VERSIONS=7.3\n          - \u003c\u003c: *osx\n            osx_image: xcode8.2\n            env: CONAN_APPLE_CLANG_VERSIONS=8.0\n          - \u003c\u003c: *osx\n            osx_image: xcode8.3\n            env: CONAN_APPLE_CLANG_VERSIONS=8.1\n          - \u003c\u003c: *osx\n            osx_image: xcode9\n            env: CONAN_APPLE_CLANG_VERSIONS=9.0\n\n    install:\n      - chmod +x .travis/install.sh\n      - ./.travis/install.sh\n\n    script:\n      - chmod +x .travis/run.sh\n      - ./.travis/run.sh\n\nYou can also use multiples \"pages\" to split the builds in different jobs (Check pagination section first to understand):\n\n**.travis.yml**\n\n    env:\n       global:\n         - CONAN_USERNAME: \"conan\" # ADJUST WITH YOUR REFERENCE USERNAME!\n         - CONAN_LOGIN_USERNAME: \"lasote\" # ADJUST WITH YOUR LOGIN USERNAME!\n         - CONAN_CHANNEL: \"testing\" # ADJUST WITH YOUR CHANNEL!\n         - CONAN_UPLOAD: \"https://api.bintray.com/conan/conan-community/conan\" # ADJUST WITH YOUR REMOTE!\n         - CONAN_STABLE_BRANCH_PATTERN: \"release/*\"\n         - CONAN_UPLOAD_ONLY_WHEN_STABLE: 1 # Will only upload when the branch matches \"release/*\"\n\n    linux: \u0026linux\n       os: linux\n       sudo: required\n       language: python\n       python: \"3.6\"\n       services:\n         - docker\n    osx: \u0026osx\n       os: osx\n       language: generic\n    matrix:\n       include:\n\n          - \u003c\u003c: *linux\n            env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49 CONAN_CURRENT_PAGE=1\n\n          - \u003c\u003c: *linux\n            env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49 CONAN_CURRENT_PAGE=2\n\n          - \u003c\u003c: *linux\n            env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5 CONAN_CURRENT_PAGE=1\n\n           - \u003c\u003c: *linux\n            env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5 CONAN_CURRENT_PAGE=2\n\n          - \u003c\u003c: *linux\n            env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6 CONAN_CURRENT_PAGE=1\n\n          - \u003c\u003c: *linux\n            env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6 CONAN_CURRENT_PAGE=2\n\n          - \u003c\u003c: *linux\n            env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39 CONAN_CURRENT_PAGE=1\n\n           - \u003c\u003c: *linux\n            env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39 CONAN_CURRENT_PAGE=2\n\n          - \u003c\u003c: *linux\n            env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40 CONAN_CURRENT_PAGE=1\n\n          - \u003c\u003c: *linux\n            env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40 CONAN_CURRENT_PAGE=2\n\n          - \u003c\u003c: *osx\n            osx_image: xcode7.3\n            env: CONAN_APPLE_CLANG_VERSIONS=7.3 CONAN_CURRENT_PAGE=1\n\n          - \u003c\u003c: *osx\n            osx_image: xcode7.3\n            env: CONAN_APPLE_CLANG_VERSIONS=7.3 CONAN_CURRENT_PAGE=2\n\n          - \u003c\u003c: *osx\n            osx_image: xcode8.2\n            env: CONAN_APPLE_CLANG_VERSIONS=8.0 CONAN_CURRENT_PAGE=1\n\n          - \u003c\u003c: *osx\n            osx_image: xcode8.2\n            env: CONAN_APPLE_CLANG_VERSIONS=8.0 CONAN_CURRENT_PAGE=2\n\n          - \u003c\u003c: *osx\n            osx_image: xcode8.3\n            env: CONAN_APPLE_CLANG_VERSIONS=8.1 CONAN_CURRENT_PAGE=1\n\n          - \u003c\u003c: *osx\n            osx_image: xcode8.3\n            env: CONAN_APPLE_CLANG_VERSIONS=8.1 CONAN_CURRENT_PAGE=2\n\n    install:\n      - chmod +x .travis/install.sh\n      - ./.travis/install.sh\n\n    script:\n      - chmod +x .travis/run.sh\n      - ./.travis/run.sh\n\n**.travis/install.sh**\n\n    #!/bin/bash\n\n    set -e\n    set -x\n\n    if [[ \"$(uname -s)\" == 'Darwin' ]]; then\n        brew update || brew update\n        brew outdated pyenv || brew upgrade pyenv\n        brew install pyenv-virtualenv\n        brew install cmake || true\n\n        if which pyenv \u003e /dev/null; then\n            eval \"$(pyenv init -)\"\n        fi\n\n        pyenv install 3.7.11\n        pyenv virtualenv 3.7.11 conan\n        pyenv rehash\n        pyenv activate conan\n    fi\n\n    pip install conan --upgrade\n    pip install conan_package_tools\n    conan user\n\n\nIf you want to \"pin\" a **conan_package_tools** version use:\n\n    pip install conan_package_tools==0.37.0\n\nThat version will be used also in the docker images.\n\n\n**.travis/run.sh**\n\n\n    #!/bin/bash\n\n    set -e\n    set -x\n\n    if [[ \"$(uname -s)\" == 'Darwin' ]]; then\n        if which pyenv \u003e /dev/null; then\n            eval \"$(pyenv init -)\"\n        fi\n        pyenv activate conan\n    fi\n\n    python build.py\n\n\nRemember to set the CONAN_PASSWORD variable in the travis build control panel!\n\n\n## Appveyor integration\n\nThis is very similar to Travis CI. With the same **build.py** script we have the following **appveyor.yml** file:\n\n    build: false\n\n    environment:\n        PYTHON: \"C:\\\\Python37\"\n        PYTHON_VERSION: \"3.7.9\"\n        PYTHON_ARCH: \"32\"\n\n        CONAN_USERNAME: \"lasote\"\n        CONAN_LOGIN_USERNAME: \"lasote\"\n        CONAN_CHANNEL: \"stable\"\n        VS150COMNTOOLS: \"C:\\\\Program Files (x86)\\\\Microsoft Visual Studio\\\\2017\\\\Community\\\\Common7\\\\Tools\\\\\"\n        CONAN_UPLOAD: \"https://api.bintray.com/conan/luisconanorg/fakeconancenter\"\n        CONAN_REMOTES: \"https://api.bintray.com/conan/luisconanorg/conan-testing\"\n\n        matrix:\n            - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015\n              CONAN_VISUAL_VERSIONS: 12\n            - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015\n              CONAN_VISUAL_VERSIONS: 14\n            - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017\n              CONAN_VISUAL_VERSIONS: 15\n\n\n    install:\n      - set PATH=%PATH%;%PYTHON%/Scripts/\n      - pip.exe install conan_package_tools --upgrade\n      - conan user # It creates the conan data directory\n\n    test_script:\n      - python build.py\n\n\n- Remember to set the **CONAN_PASSWORD** variable in appveyor build control panel!\n\n## Bamboo CI integration\n\n[Bamboo](https://www.atlassian.com/software/bamboo) is a commercial CI tool developed by Atlassian.\nWhen building from bamboo, several environment variables get set during builds.\n\nIf the env var **bamboo_buildNumber** is set and the branch name (**bamboo_planRepository_branch** env var) matches **stable_branch_pattern**, then the channel name gets set to ```stable```.\n\n## Jenkins CI integration\n\n[Jenkins](https://jenkins.io/) is an open source CI tool that was originally forked from hudson.\nWhen building on jenkins, several environment variables get set during builds.\n\nIf the env var **JENKINS_URL** is set and the branch name (**BRANCH_NAME** env var) matches **stable_branch_pattern**, then the channel name gets set to ```stable```.\n\nCurrently, only the pipeline builds set the **BRANCH_NAME** env var automatically.\n\n## GitLab CI integration\n\n[GitLab CI](https://about.gitlab.com/features/gitlab-ci-cd/) is a commercial CI tool developed by GitLab.\nWhen building on gitlab-ci, several environment variables get set during builds.\n\nIf the env var **GITLAB_CI** is set and the branch name (**CI_BUILD_REF_NAME** env var) matches **stable_branch_pattern**, then the channel name gets set to ```stable```.\n\n\n## Upload packages\n\nYou can upload the generated packages automatically to a conan-server using the following environment variables (parameters also available):\n\n- Remote url:\n\n        CONAN_UPLOAD: \"https://api.bintray.com/conan/conan-community/conan\"\n\n- User to login in the remote:\n\n        CONAN_LOGIN_USERNAME: \"lasote\"\n\n- User (to generate the packages in that user namespace, e.j: zlib/1.2.11@conan/stable):\n\n\n        CONAN_USERNAME: \"conan\"\n\n- Channel (to generate the packages in that channel namespace, e.j: zlib/1.2.11@conan/testing):\n\n        CONAN_CHANNEL: \"testing\"\n\n- If the detected branch in the CI matches the pattern, declare the CONAN_CHANNEL as stable:\n\n        CONAN_STABLE_BRANCH_PATTERN: \"release/*\"\n\n\n## Upload dependencies ([#237](https://github.com/conan-io/conan-package-tools/issues/237))\n\nSometimes your dependencies are not available in remotes and you need to pass ``--build=missing`` to build them.\nThe problem is that you will need to fix one-by-one, updating the CI script, instead of just uploading all built packages.\n\nNow you can upload **ALL** of your dependencies together, in addition to your package, to the same remote. To do this, you need to define:\n\n    CONAN_UPLOAD_DEPENDENCIES=\"all\"\n\nOr, set it in ``ConanMultiPackager`` arguments:\n\n    ConanMultiPackager(upload_dependencies=\"all\")\n\nHowever, maybe you want to upload **ONLY** specified packages by their names:\n\n    CONAN_UPLOAD_DEPENDENCIES=\"foo/0.1@user/channel,bar/1.2@bar/channel\"\n\nOr,\n\n    ConanMultiPackager(upload_dependencies=[\"foo/0.1@user/channel\", \"bar/1.2@bar/channel\"])\n\n## Pagination\n\nSometimes, if your library is big or complex enough in terms of compilation time, the CI server could reach the maximum time of execution,\nbecause it's building, for example, 20 different binary packages for your library in the same machine.\n\nYou can split the different build configurations in different \"pages\". So, you can configure your CI to run more \"worker\" machines, one per \"page\".\n\nThere are two approaches:\n\n### Sequential distribution\n\nBy simply passing two pagination parameters, **curpage** and **total_pages** or the corresponding environment variables:\n\n    $ export CONAN_TOTAL_PAGES=3\n    $ export CONAN_CURRENT_PAGE=1\n\n    $ python build.py\n\n\nIf you added 10 different build configurations to the builder:\n\n- With **CONAN_CURRENT_PAGE=1** it runs only 1,4,7,10\n- With **CONAN_CURRENT_PAGE=2** it runs only 2,5,8\n- With **CONAN_CURRENT_PAGE=3** it runs only 3,6,9\n\nIn your CI server you can configure a matrix with different \"virtual machines\" or \"jobs\" or \"workers\":\nIn each \"machine\" you can specify a different CONAN_CURRENT_PAGE environment variable.\nSo your different configurations will be distributed in the different machines.\n\n\n### Named pages\n\nBy adding builds to the **named_builds** dictionary, and passing **curpage** with the page name:\n\n    from cpt.packager import ConanMultiPackager\n    from collections import defaultdict\n\n    if __name__ == '__main__':\n        builder = ConanMultiPackager(curpage=\"x86\", total_pages=2)\n        named_builds = defaultdict(list)\n        builder.add_common_builds(shared_option_name=\"bzip2:shared\", pure_c=True)\n        for settings, options, env_vars, build_requires, reference in builder.items:\n            named_builds[settings['arch']].append([settings, options, env_vars, build_requires, reference])\n        builder.named_builds = named_builds\n        builder.run()\n\nnamed_builds now have a dictionary entry for x86 and another for x86_64:\n\n- for **CONAN_CURRENT_PAGE=\"x86\"** it would do all x86 builds\n- for **CONAN_CURRENT_PAGE=\"x86_64\"** it would do all x86_64 builds\n\n\n\n### Generating multiple references for the same recipe\n\nYou can add a different reference in the builds tuple, so for example, if your recipe has no \"version\"\nfield, you could generate several versions in the same build script. Conan package tools will export\nthe recipe using the different reference automatically:\n\n    from cpt.packager import ConanMultiPackager\n\n    if __name__ == '__main__':\n        builder = ConanMultiPackager()\n        builder.add_common_builds(reference=\"mylib/1.0@conan/stable\")\n        builder.add_common_builds(reference=\"mylib/2.0@conan/stable\")\n        builder.run()\n\n\n\u003ca name=\"bintray\"\u003e\u003c/a\u003e\n## Working with Bintray: Configuring repositories\n\nUse the argument `upload` or environment variable `CONAN_UPLOAD` to set the URL of the repository where you want to\nupload your packages. Will be also used to read from it.\n\nUse `CONAN_PASSWORD` environment variable to set the API key from Bintray. If your username in Bintray doesn't match with\nthe specified `CONAN_USERNAME` specify the variable `CONAN_LOGIN_USERNAME` or the parameter `login_username` to ConanMultiPackager .\n\nIf you are using travis or appveyor you can use a hidden enviroment variable from the repository setup\npackage.\n\nTo get an API key in Bintray to \"Edit profile\"/\"API key\".\n\nUse the argument `remotes` or environment variable `CONAN_REMOTES` to configure additional repositories containing\nneeded requirements.\n\n**Example:** Add your personal Bintray repository to retrieve and upload your packages and also some other different\nrepositories to read some requirements.\n\nIn your `.travis.yml` or `appveyor.yml` files declare the environment variables:\n\n    CONAN_UPLOAD=\"https://api.bintray.com/mybintrayuser/conan_repository\"\n    CONAN_REMOTES=\"https://api.bintray.com/other_bintray_user/conan-repo, https://api.bintray.com/other_bintray_user2/conan-repo\"\n\nOr in your `build.py`:\n\n    from cpt.packager import ConanMultiPackager\n\n    if __name__ == \"__main__\":\n        builder = ConanMultiPackager(username=\"myuser\",\n                                     upload=\"https://api.bintray.com/mybintrayuser/conan_repository\",\n                                     remotes=\"https://api.bintray.com/other_bintray_user/conan-repo, https://api.bintray.com/other_bintray_user2/conan-repo\")\n        builder.add_common_builds()\n        builder.run()\n\n\n\n## Visual Studio auto-configuration\n\nWhen the builder detects a Visual Studio compiler and its version, it will automatically configure the execution environment\nfor the \"conan test\" command with the **vcvarsall.bat** script (provided by all Microsoft Visual Studio versions).\nSo you can compile your project with the right compiler automatically, even without CMake.\n\n## MinGW builds\n\nMinGW compiler builds are also supported. You can use this feature with Appveyor.\n\nYou can choose different MinGW compiler configurations:\n\n- **Version**: 4.8 and 4.9 are supported\n- **Architecture**: x86 and x86_64 are supported\n- **Exceptions**: seh and sjlj are supported\n- **Threads**: posix and win32 are supported\n\n\nUsing **MINGW_CONFIGURATIONS** env variable in Appveyor:\n\n    MINGW_CONFIGURATIONS: '4.9@x86_64@seh@posix, 4.9@x86_64@seh@win32'\n\nCheck an example [here](https://github.com/conan-community/conan-zlib/blob/release/1.2.8/appveyor.yml)\n\n\n## Clang builds\n\nClang compiler builds are also supported. You can use this feature with TravisCI.\n\nYou can choose different Clang compiler configurations:\n\n- **Version**: 3.8, 3.9 and 4.0 are supported\n- **Architecture**: x86 and x86_64 are supported\n\nUsing **CONAN_CLANG_VERSIONS** env variable in Travis ci or Appveyor:\n\n    CONAN_CLANG_VERSIONS = \"3.8,3.9,4.0\"\n\n# FULL REFERENCE\n\n\n## ConanMultiPackager parameters reference\n\n- **username**: The username (part of the package reference, not the login_username)\n- **login_username**: The login username. Could take two possible values:\n\n    - String with the login\":\n\n       ```\n       login_username = \"my_user\"\n       ```\n\n    - Dict containing the remote name and the login for that remote. Use together with \"remotes\" variable to specify remote names e.j:\n\n       ```\n       login_username = {\"remote1\": \"my_user\", \"my_artifactory\": \"other_user\"}\n       ```\n\n- **password**. Password to authenticate with the remotes. Could take two possible values:\n\n    - String with the password:\n\n       ```\n       password = \"my_pass\"\n       ```\n\n    - Dict containing the remote name and the login for that remote. Use together with \"remotes\" variable to specify remote names e.j:\n\n       ```\n       password = {\"remote1\": \"my_pass\", \"my_artifactory\": \"my_pass2\"}\n       ```\n\n- **remotes**: Could take two values:\n\n    - String of URLs separated by \",\":\n\n       ```\n       remotes = \"https://api.bintray.com/conan/conan-community/conan,https://api.bintray.com/conan/other/conan2\"\n       ```\n\n    - List of tuples containing the \"url\", \"use_ssl\" flag and \"name\" . e.j:\n\n       ```\n       remotes = [(\"https://api.bintray.com/conan/conan-community/conan\", True, \"remote1\"),\n                  (\"https://api.bintray.com/conan/other/conan2\", False, \"remote2\")]\n       ```\n- **options**: Options used on package build:\n\n    - List of options:\n       ```\n       options = [\"foobar:with_qux=True\", \"foobar:with_bar=False\"]\n\n       ```\n\n- **gcc_versions**: List with a subset of gcc_versions. Default [\"4.9\", \"5\", \"6\", \"7\"]\n- **clang_versions**: List with a subset of clang_versions. Default [\"3.8\", \"3.9\", \"4.0\"]\n- **apple_clang_versions**: List with a subset of apple-clang versions. Default [\"6.1\", \"7.3\", \"8.0\"]\n- **visual_versions**: List with a subset of Visual Studio versions. Default [10, 12, 14]\n- **visual_runtimes**: List containing Visual Studio runtimes to use in builds. Default [\"MT\", \"MD\", \"MTd\", \"MDd\"]\n- **mingw_configurations**: Configurations for MinGW\n- **archs**: List containing specific architectures to build for. Default [\"x86\", \"x86_64\"]\n- **use_docker**: Use docker for package creation in Linux systems.\n- **docker_run_options**: Pass additional parameters for docker when running the create step.\n- **docker_conan_home**: Location where package source files will be copied to inside the Docker container\n- **docker_image_skip_update**: If defined, it will skip the initialization update of \"conan package tools\" and \"conan\" in the docker image. By default is False.\n- **docker_image_skip_pull**: If defined, it will skip the \"docker pull\" command, enabling a local image to be used, and without being overwritten.\n- **always_update_conan_in_docker**: If True, \"conan package tools\" and \"conan\" will be installed and upgraded in the docker image in every build execution.\n  and the container won't be commited with the modifications.\n- **docker_entry_script**: Command to be executed before to build when running Docker.\n- **pip_install**: Package list to be installed by pip before to build. e.j [\"foo\", \"bar\"]\n- **docker_32_images**: If defined, and the current build is arch=\"x86\" the docker image name will be appended with \"-i386\". e.j: \"conanio/gcc63-i386\"\n- **docker_shell**: Shell command to be executed by Docker. e.j: \"/bin/bash -c\" (Linux), \"cmd /C\" (Windows)\n- **curpage**: Current page of packages to create\n- **total_pages**: Total number of pages\n- **vs10_x86_64_enabled**: Flag indicating whether or not to build for VS10 64bits. Default [False]\n- **upload_retry**: Num retries in upload in case of failure.\n- **upload_only_when_stable**: Will try to upload only if the channel is the stable channel. Default [False]\n- **upload_only_when_tag**: Will try to upload only if the branch is a tag. Default [False]\n- **upload_only_recipe**: If defined, will try to upload **only** the recipes. The built packages will **not** be uploaded. Default [False]\n- **upload_dependencies**: Will try to upload dependencies to your remote. Default [False]\n- **upload_force**: Will try to force uploaded all packages. Default [True]\n- **build_types**: List containing specific build types. Default [\"Release\", \"Debug\"]\n- **cppstds**: List containing specific cpp standards. Default None\n- **skip_check_credentials**: Conan will skip checking the user credentials before building the packages. And if no user/remote is specified, will try to upload with the\n  already stored credentiales in the local cache. Default [False]\n- **allow_gcc_minors** Declare this variable if you want to allow gcc \u003e=5 versions with the minor (5.1, 6.3 etc).\n- **exclude_vcvars_precommand** For Visual Studio builds, it exclude the vcvars call to set the environment.\n- **build_policy**:  Can be None, single value or a list. Default None.\n    -  None: Only Build current package. Equivalent to `--build current_package_ref`\n    - \"never\": No build from sources, only download packages. Equivalent to `--build never`\n    - \"missing\": Build only missing packages. Equivalent to `--build missing`\n    - \"outdated\": Build only missing or if the available package is not built with the current recipe. Useful to upload new configurations, e.j packages for a new compiler without\n      rebuild all packages. Equivalent to `--build outdated`\n    - \"all\": Build all requirements. Equivalent to `--build`\n    - \"cascade\": Build from code all the nodes with some dependency being built (for any reason). Equivalent to `--build cascade`\n    - \"some_package\" : Equivalent to `--build some_package`\n    - \"pattern\\*\": will build only the packages with the reference starting with pattern\\*. Equivalent to `--build pattern*`\n    - [\"pattern\\*\", \"another_pattern\\*\"]: will build only the packages with the reference matching these patterns. Equivalent to `--build pattern* --build another_pattern*`\n    - [\"pattern\\*\", \"outdated\"]:  `--build pattern* --build outdated`\nCheck [Conan Build policies](https://docs.conan.io/en/latest/mastering/policies.html) for more details.\n- **require_overrides** List containing overrides requirement to the consumer conanfile. e.j [\"foo/0.1@user/channel\", \"bar/1.2@bar/channel\"]\n- **test_folder**: Custom test folder consumed by Conan create, e.j .conan/test_package\n- **lockfile**: Custom conan lockfile to be used, e.j. conan.lock. Default [None]\n- **conanfile**: Custom conanfile consumed by Conan create. e.j. conanfile.py\n- **config_url**: Conan config URL be installed before to build e.j https://github.com/bincrafters/conan-config.git\n- **config_args**: Conan config arguments used when installing conan config\n- **force_selinux**: Force docker to relabel file objects on the shared volumes\n- **skip_recipe_export**: If True, the package recipe will only be exported on the first build. Default [False]\n- **update_dependencies**: Update all dependencies before building e.g conan create -u\n- **global_conf**: A list with values to be added to `global.conf` file\n\nUpload related parameters:\n\n- **upload**: Could take two values:\n\n    - String with an URL.\n       ```\n       upload = \"https://api.bintray.com/conan/conan-community/conan\"\n       ```\n\n    - Tuple containing the \"url\", \"use_ssl\" flag and \"name\".\n\n       ```\n       upload = (\"https://api.bintray.com/conan/conan-community/conan\", True, \"remote1\")\n       ```\n\n- **reference**: Reference of the package to upload. Ex: \"zlib/1.2.8\". If not specified it will be read from the `conanfile.py`.\n- **remote**: Alternative remote name. Default \"default\"\n- **stable_branch_pattern**: Regular expression, if current git branch matches this pattern, the packages will be uploaded to *stable* channel.\n  By default it will check the following patterns: ``[\"master$\", \"release*\", \"stable*\"]``\n- **stable_channel**: Stable channel, default \"stable\".\n- **channel**: Channel where your packages will be uploaded if previous parameter doesn't match\n\n\n## Commit messages reference\n\nThe current commit message can contain special messages:\n\n- **[skip ci]**: Will skip the building of any package (unless `CONAN_IGNORE_SKIP_CI` is set)\n- **[build=XXX]**: Being XXX a build policy (see build_policy parameter reference)\n- **[build=XXX] [build=YYY]**: Being XXX and YYY the two build policies to use (see build_policy parameter reference)\n\n\n## Complete ConanMultiPackager methods reference:\n\n- **add_common_builds(shared_option_name=None, pure_c=True, dll_with_static_runtime=False, reference=None, header_only=True, build_all_options_values=None)**: Generate a set of package configurations and add them to the\n  list of packages that will be created.\n\n    - **shared_option_name**: If given, ConanMultiPackager will add different configurations for -o shared=True and -o shared=False.\n    - **pure_c**: ConanMultiPackager won't generate different builds for the **libstdc++** c++ standard library, because it is a pure C library.\n    - **dll_with_static_runtime**: generate also build for \"MT\" runtime when the library is shared.\n    - **reference**: Custom package reference\n    - **header_only**: Generate new builds following header-only options [#454](https://github.com/conan-io/conan-package-tools/issues/454)\n    - **build_all_options_values**: Include all values for the listed options [#457](https://github.com/conan-io/conan-package-tools/issues/457)\n\n- **login(remote_name)**: Performs a `conan user` command in the specified remote.\n\n- **add(settings=None, options=None, env_vars=None, build_requires=None)**: Add a new build configuration, so a new binary package will be built for the specified configuration.\n\n- **run()**: Run the builds (Will invoke conan create for every specified configuration)\n\n\n\n## Environment configuration\n\nYou can also use environment variables to change the behavior of ConanMultiPackager, so that you don't pass parameters to the ConanMultiPackager constructor.\n\nThis is especially useful for CI integration.\n\n- **CONAN_USERNAME**: Your conan username (for the package reference)\n- **CONAN_REFERENCE**: Reference of the package to upload, e.g. \"zlib/1.2.8\". Otherwise it will be read from the `conanfile.py`\n- **CONAN_LOGIN_USERNAME**: Unique login username for all remotes. Will use \"CONAN_USERNAME\" when not present.\n- **CONAN_LOGIN_USERNAME_XXX**: Specify a login for a remote name:\n\n  - `CONAN_LOGIN_USERNAME_MYREPO=my_username`\n\n- **CONAN_PASSWORD**: Conan Password, or API key if you are using Bintray.\n- **CONAN_PASSWORD_XXX**: Specify a password for a remote name:\n\n  - `CONAN_PASSWORD_MYREPO=mypassword`\n\n- **CONAN_REMOTES**: List of URLs separated by \",\" for the additional remotes (read).\n                     You can specify the SSL verify flag and the remote name using the \"@\" separator. e.j:\n\n  - `CONAN_REMOTES=url1@True@remote_name, url2@False@remote_name2`\n\n  The remote name is useful in case you want to specify custom credentials for different remotes. See `CONAN_LOGIN_USERNAME_XXX` and `CONAN_PASSWORD_XXX`\n\n- **CONAN_UPLOAD**: URL of the repository where we want to use to upload the packages.\n  The value can containing the URL, the SSL validation flag and remote name (last two optionals) separated by \"@\". e.j:\n\n  - `CONAN_UPLOAD=https://yourcompany.jfrog.io/artifactory/api/conan/local`\n  - `CONAN_UPLOAD=https://yourcompany.jfrog.io/artifactory/api/conan/local@True`\n  - `CONAN_UPLOAD=https://yourcompany.jfrog.io/artifactory/api/conan/local@True@other_repo_name`\n\n  If a remote name is not specified, `upload_repo` will be used as a remote name.\n  If the SSL validation configuration is not specified, it will use `True` by default.\n\n- **CONAN_UPLOAD_RETRY**: If defined, in case of fail retries to upload again the specified times\n- **CONAN_UPLOAD_ONLY_WHEN_STABLE**: If defined, will try to upload the packages only when the current channel is the stable one.\n- **CONAN_UPLOAD_ONLY_WHEN_TAG**: If defined, will try to upload the packages only when the current branch is a tag.\n- **CONAN_UPLOAD_ONLY_RECIPE**: If defined, will try to upload **only** the recipes. The built packages will **not** be uploaded.\n- **CONAN_UPLOAD_DEPENDENCIES**: If defined, will try to upload the listed package dependencies to your remote.\n- **CONAN_UPLOAD_FORCE**: If defined, will try to force upload all packages. Default is `True`.\n\n- **CONAN_SKIP_CHECK_CREDENTIALS**: Conan will skip checking the user credentials before building the packages. And if no user/remote is specified, will try to upload with the\n  already stored credentiales in the local cache. Default [False]\n- **CONAN_DOCKER_ENTRY_SCRIPT**: Command to be executed before to build when running Docker.\n- **CONAN_PIP_INSTALL**: Package list to be installed by pip before to build, comma separated, e.g. \"pkg-foo==0.1.0,pkg-bar\"\n- **CONAN_GCC_VERSIONS**: Gcc versions, comma separated, e.g. \"4.6,4.8,5,6\"\n- **CONAN_CLANG_VERSIONS**: Clang versions, comma separated, e.g. \"3.8,3.9,4.0\"\n- **CONAN_APPLE_CLANG_VERSIONS**: Apple clang versions, comma separated, e.g. \"6.1,8.0\"\n- **CONAN_ARCHS**: Architectures to build for, comma separated, e.g. \"x86,x86_64\"\n- **CONAN_OPTIONS**: Conan build options, comma separated, e.g. \"foobar:with_bar=True,foobar:with_qux=False\"\n- **CONAN_SHARED_OPTION_NAME**: Set `shared_option_name` by environment variable, e.g. \"mypackagename:shared\"\n- **CONAN_BUILD_ALL_OPTIONS_VALUES**: Set `build_all_options_values` by environment variable, e.g. \"mypackagename:foo,mypackagename:bar\"\n- **CONAN_BUILD_TYPES**: Build types to build for, comma separated, e.g. \"Release,Debug\"\n- **CONAN_CPPSTDS**: List containing values for `compiler.cppstd`. Default None\n- **CONAN_VISUAL_VERSIONS**: Visual versions, comma separated, e.g. \"12,14\"\n- **CONAN_VISUAL_RUNTIMES**: Visual runtimes, comma separated, e.g. \"MT,MD\"\n- **CONAN_VISUAL_TOOLSETS**: Map Visual versions to toolsets, e.g. `14=v140;v140_xp,12=v120_xp`\n- **CONAN_MSVC_VERSIONS**: msvc versions, comma separated, e.g. \"19.29,193\"\n- **CONAN_MSVC_RUNTIMES**: msvc runtimes, comma separated, e.g. \"static,dynamic\"\n- **CONAN_MSVC_RUNTIME_TYPES**: msvc runtime types, comma separated, e.g. \"Debug,Release\"\n- **CONAN_USE_DOCKER**: If defined will use docker\n- **CONAN_CURRENT_PAGE**:  Current page of packages to create\n- **CONAN_TOTAL_PAGES**: Total number of pages\n- **CONAN_DOCKER_IMAGE**: If defined and docker is being used, it will use this dockerimage instead of the default images, e.g. \"conanio/gcc63\"\n- **CONAN_DOCKER_HOME**: Location where package source files will be copied to inside the Docker container\n- **CONAN_DOCKER_RUN_OPTIONS**: Pass additional parameters for docker when running the create step\n- **CONAN_DOCKER_IMAGE_SKIP_UPDATE**: If defined, it will skip the initialization update of \"conan package tools\" and \"conan\" in the docker image. By default is False.\n- **CONAN_DOCKER_IMAGE_SKIP_PULL**: If defined, it will skip the \"docker pull\" command, enabling a local image to be used, and without being overwritten.\n- **CONAN_ALWAYS_UPDATE_CONAN_DOCKER**: If defined, \"conan package tools\" and \"conan\" will be installed and upgraded in the docker image in every build execution\n  and the container won't be commited with the modifications.\n- **CONAN_DOCKER_32_IMAGES**: If defined, and the current build is arch=\"x86\" the docker image name will be appended with \"-i386\". e.j: \"conanio/gcc63-i386\"\n- **CONAN_DOCKER_SHELL**: Shell command to be executed by Docker. e.j: \"/bin/bash -c\" (Linux), \"cmd /C\" (Windows)\n- **CONAN_STABLE_BRANCH_PATTERN**: Regular expression, if current git branch matches this pattern, the packages will be uploaded to *CONAN_STABLE_CHANNEL* channel. Default \"master\". E.j: \"release/*\"\n- **CONAN_STABLE_CHANNEL**: Stable channel name, default \"stable\"\n- **CONAN_CHANNEL**: Channel where your packages will be uploaded if the previous parameter doesn't match\n- **CONAN_PIP_PACKAGE**: Specify a conan package to install (by default, installs the latest) e.j conan==0.0.1rc7\n- **MINGW_CONFIGURATIONS**: Specify a list of MinGW builds. See MinGW builds section.\n- **CONAN_BASH_PATH**: Path to a bash executable. Used only in windows to help the tools.run_in_windows_bash() function to locate our Cygwin/MSYS2 bash.\n  Set it with the bash executable path if it’s not in the PATH or you want to use a different one.\n- **CONAN_PIP_USE_SUDO** Use \"sudo\" when invoking pip, by default it will use sudo when not using Windows and not running docker image \"conanio/\". \"False\" to deactivate.\n- **CONAN_PIP_COMMAND** Run custom `pip` command when updating Conan. e.g. \"/usr/bin/pip2\"\n- **CONAN_DOCKER_PIP_COMMAND** Run custom `pip` command when updating Conan and CPT in Docker container. e.g. \"/usr/bin/pip2\"\n- **CONAN_DOCKER_USE_SUDO** Use \"sudo\" when invoking docker, by default it will use sudo when not using Windows. \"False\" to deactivate.\n- **CONAN_ALLOW_GCC_MINORS** Declare this variable if you want to allow gcc \u003e=5 versions with the minor (5.1, 6.3 etc).\n- **CONAN_EXCLUDE_VCVARS_PRECOMMAND** For Visual Studio builds, it exclude the vcvars call to set the environment.\n- **CONAN_BUILD_REQUIRES** You can specify additional build requires for the generated profile with an environment variable following the same profile syntax and separated by \",\"\n  i.e ``CONAN_BUILD_REQUIRES: mingw-installer/7.1@conan/stable, pattern: other/1.0@conan/stable``\n- **CONAN_BUILD_POLICY**: Comma separated list of build policies. Default None.\n    -  None: Only Build current package. Equivalent to `--build current_package_ref`\n    - \"never\": No build from sources, only download packages. Equivalent to `--build never`\n    - \"missing\": Build only missing packages. Equivalent to `--build missing`\n    - \"outdated\": Build only missing or if the available package is not built with the current recipe. Useful to upload new configurations, e.j packages for a new compiler without\n      rebuild all packages. Equivalent to `--build outdated`\n    - \"all\": Build all requirements. Equivalent to `--build`\n    - \"cascade\": Build from code all the nodes with some dependency being built (for any reason). Equivalent to `--build cascade`\n    - \"some_package\" : Equivalent to `--build some_package`\n    - \"pattern\\*\": will build only the packages with the reference starting with pattern\\*. Equivalent to `--build pattern*`\n    - \"pattern\\*,another_pattern\\*\": will build only the packages with the reference matching these patterns. Equivalent to `--build pattern* --build another_pattern*`\n    - \"pattern\\*,outdated\": Equivalent to `--build pattern* --build outdated`\nCheck [Conan Build policies](https://docs.conan.io/en/latest/mastering/policies.html) for more details.\n- **CONAN_REQUIRE_OVERRIDES**: Comma separated list of requirement overrides.\n- **CONAN_CONFIG_URL**: Conan config URL be installed before to build e.j https://github.com/bincrafters/conan-config.git\n- **CONAN_CONFIG_ARGS**: Conan config arguments used when installing conan config\n- **CONAN_BASE_PROFILE**: Apply options, settings, etc. to this profile instead of `default`.\n- **CONAN_BASE_PROFILE_BUILD**: Apply the specified profile to the build machine. Default is None\n- **CONAN_IGNORE_SKIP_CI**: Ignore `[skip ci]` in commit message.\n- **CONAN_CONANFILE**: Custom conanfile consumed by Conan create. e.j. conanfile.py\n- **CONAN_LOCKFILE**: Custom conan lockfile to be used, e.j. conan.lock.\n- **CPT_TEST_FOLDER**: Custom test_package path, e.j .conan/test_package\n- **CONAN_FORCE_SELINUX**: Force docker to relabel file objects on the shared volumes\n- **CONAN_SKIP_RECIPE_EXPORT**: If defined, the package recipe will only be exported on the first build.\n- **CPT_UPDATE_DEPENDENCIES**: Update all dependencies before building e.g conan create -u\n- **CONAN_PURE_C**: Set `pure_c` by environment variable, default `True`\n- **CONAN_GLOBAL_CONF**: Add `global.conf` file with listed values e.g '*:tools.cmake.cmaketoolchain:generator=Ninja,tools.system.package_manager:mode=install'\n\n\n# Full example\n\nYou can see the full zlib example [here](https://github.com/conan-community/conan-zlib)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconan-io%2Fconan-package-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconan-io%2Fconan-package-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconan-io%2Fconan-package-tools/lists"}