Skip to content

Commit

Permalink
Send binaries only if option active
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Nov 25, 2024
1 parent 635904f commit 98fa3d1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions recipes/sentrylibrary/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ def setup_cmake_toolchain_sentry(self, cmake_toolchain):
'''
cmake_toolchain.variables["ENABLE_SENTRY"] = self.options.enable_sentry
cmake_toolchain.variables["SENTRY_URL"] = self.conf.get("user.sentry:url", "", check_type=str)
cmake_toolchain.variables["SENTRY_ENVIRONMENT"] = "production" if self.options.sentry_is_production else "development"

def send_sentry_debug_files(self, binary_basename):
'''
Method to be called by actual packages at build() time, after the actual build has been done, to send the binary files to sentry
'''
if self.options.enable_sentry:
if self.options.enable_sentry and self.options.sentry_send_binaries:
sentry_project = self.options.sentry_project
sentry_organization = self.conf.get("user.sentry:organization", "", check_type=str)
sentry_token = self.conf.get("user.sentry:token", "", check_type=str)
Expand Down Expand Up @@ -89,17 +90,12 @@ def send_sentry_debug_files(self, binary_basename):
if not self.options.sentry_is_production:
sentry_version += f"+{self.conan_data['commit'][:6]}"


# create a sentry release and link it to the commit this is based upon
self.output.info(f"Creating a new release {sentry_version} in Sentry and linking it to the current commit {self.conan_data['commit']}")
self.run(f"sentry-cli releases new {sentry_version} {sentry_auth} ")
self.run(f"sentry-cli releases set-commits {sentry_version} --commit \"Ultimaker/{binary_basename}@{self.conan_data['commit']}\" {sentry_auth} ")
self.run(f"sentry-cli releases finalize {sentry_version} {sentry_auth} ")

# Create a deploy to differentiate development/production releases
environment = "production" if self.options.sentry_is_production else "development"
self.run(f"sentry-cli deploys new --release {sentry_version} -e {environment} {sentry_auth}")


class PyReq(ConanFile):
name = "sentrylibrary"
Expand Down

0 comments on commit 98fa3d1

Please sign in to comment.