puppet: Factor out sentry-cli installation.

This commit is contained in:
Alex Vandiver 2024-04-19 13:36:15 -04:00 committed by Tim Abbott
parent 62cf6ab35c
commit 528d475053
2 changed files with 25 additions and 18 deletions

View File

@ -1,24 +1,8 @@
# @summary Install sentry-cli binary and pre/post deploy hooks # @summary Install Sentry pre/post deploy hooks
# #
class zulip::hooks::sentry { class zulip::hooks::sentry {
include zulip::hooks::base include zulip::hooks::base
$version = $zulip::common::versions['sentry-cli']['version'] include zulip::sentry_cli
$bin = "/srv/zulip-sentry-cli-${version}"
$arch = $facts['os']['architecture'] ? {
'amd64' => 'x86_64',
'aarch64' => 'aarch64',
}
zulip::external_dep { 'sentry-cli':
version => $version,
url => "https://downloads.sentry-cdn.com/sentry-cli/${version}/sentry-cli-Linux-${arch}",
}
file { '/usr/local/bin/sentry-cli':
ensure => link,
target => $bin,
}
zulip::hooks::file { [ zulip::hooks::file { [
'common/sentry.sh', 'common/sentry.sh',

View File

@ -0,0 +1,23 @@
# @summary Install sentry-cli binary
#
class zulip::sentry_cli {
$version = $zulip::common::versions['sentry-cli']['version']
$bin = "/srv/zulip-sentry-cli-${version}"
$arch = $facts['os']['architecture'] ? {
'amd64' => 'x86_64',
'aarch64' => 'aarch64',
}
zulip::external_dep { 'sentry-cli':
version => $version,
url => "https://downloads.sentry-cdn.com/sentry-cli/${version}/sentry-cli-Linux-${arch}",
}
file { '/usr/local/bin/sentry-cli':
ensure => link,
target => $bin,
require => File[$bin],
before => Exec['Cleanup sentry-cli'],
}
}