]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/conan/build.py
2 # -*- coding: utf-8 -*-
6 from cpt
.packager
import ConanMultiPackager
7 from cpt
.ci_manager
import CIManager
8 from cpt
.printer
import Printer
11 class BuilderSettings(object):
17 printer
= Printer(None)
18 ci_manager
= CIManager(printer
)
19 return ci_manager
.get_branch()
23 """ Set civetweb as package's owner
25 return os
.getenv("CONAN_USERNAME", "civetweb")
29 """ Set civetweb repository to be used on upload.
30 The upload server address could be customized by env var
31 CONAN_UPLOAD. If not defined, the method will check the branch name.
32 Only master or CONAN_STABLE_BRANCH_PATTERN will be accepted.
33 The master branch will be pushed to testing channel, because it does
34 not match the stable pattern. Otherwise it will upload to stable
37 if os
.getenv("CONAN_UPLOAD", None) is not None:
38 return os
.getenv("CONAN_UPLOAD")
40 prog
= re
.compile(self
.stable_branch_pattern
)
41 if self
.branch
and prog
.match(self
.branch
):
42 return "https://api.bintray.com/conan/civetweb/conan"
47 def upload_only_when_stable(self
):
48 """ Force to upload when match stable pattern branch
50 return os
.getenv("CONAN_UPLOAD_ONLY_WHEN_STABLE", True)
53 def stable_branch_pattern(self
):
54 """ Only upload the package the branch name is like a tag
56 return os
.getenv("CONAN_STABLE_BRANCH_PATTERN", r
"v(\d+\.\d+)")
60 regex
= re
.compile(self
.stable_branch_pattern
)
61 match
= regex
.match(self
.branch
)
68 """ Read project version from branch name to create Conan referece
70 return os
.getenv("CONAN_REFERENCE", "civetweb/{}".format(self
.version
))
72 if __name__
== "__main__":
73 settings
= BuilderSettings()
74 builder
= ConanMultiPackager(
75 reference
=settings
.reference
,
76 username
=settings
.username
,
77 upload
=settings
.upload
,
78 upload_only_when_stable
=settings
.upload_only_when_stable
,
79 stable_branch_pattern
=settings
.stable_branch_pattern
,
80 test_folder
=os
.path
.join("conan", "test_package"))
81 builder
.add_common_builds(pure_c
=False)