Upgrade Sentry to 26.6.0
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
node.default["sentry"]["repo"] = "https://github.com/getsentry/self-hosted"
|
||||
node.default["sentry"]["revision"] = "23.3.1"
|
||||
# Make sure to first upgrade to hard stop version if required:
|
||||
# https://develop.sentry.dev/self-hosted/releases/
|
||||
node.default["sentry"]["revision"] = "26.6.0"
|
||||
|
||||
node.default["sentry"]["port"] = 80
|
||||
node.default["sentry"]["retention_days"] = 90
|
||||
node.default["sentry"]["allowed_ips"] = nil
|
||||
# The Sentry setup requires docker-compose >= 1.28, which is newer than the
|
||||
# latest stable version for Ubuntu 20.04
|
||||
node.default["sentry"]["docker-compose"]["version"] = "2.17.0"
|
||||
node.default["sentry"]["docker-compose"]["checksum"] = "65edee934d988471c40ef31305731dbb4381d3cb0aeea13342119b61772f85e2"
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
# Recipe:: default
|
||||
#
|
||||
|
||||
package "docker"
|
||||
apt_repository "docker" do
|
||||
uri "https://download.docker.com/linux/ubuntu"
|
||||
key "https://download.docker.com/linux/ubuntu/gpg"
|
||||
components ["stable"]
|
||||
end
|
||||
|
||||
remote_file "/usr/local/bin/docker-compose" do
|
||||
source "https://github.com/docker/compose/releases/download/v#{node["sentry"]["docker-compose"]["version"]}/docker-compose-linux-x86_64"
|
||||
checksum node["sentry"]["docker-compose"]["checksum"]
|
||||
mode '0755'
|
||||
%w[docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin].each do |pkg|
|
||||
package pkg
|
||||
end
|
||||
|
||||
deploy_path = "/opt/sentry"
|
||||
@@ -16,24 +18,22 @@ deploy_path = "/opt/sentry"
|
||||
git deploy_path do
|
||||
repository node["sentry"]["repo"]
|
||||
revision node["sentry"]["revision"]
|
||||
# TODO test and uncomment
|
||||
# notifies :run, "execute[run_install_script]", :immediately
|
||||
end
|
||||
|
||||
# TODO
|
||||
# Automatically run install script if sentry/sentry.conf.py does not exist yet
|
||||
execute "run_install_script" do
|
||||
cwd deploy_path
|
||||
command "./install.sh --apply-automatic-config-updates --no-report-self-hosted-issues"
|
||||
action :nothing
|
||||
end
|
||||
|
||||
credentials = data_bag_item("credentials", "sentry")
|
||||
|
||||
env_config = {
|
||||
sentry_event_retention_days: node["sentry"]["retention_days"],
|
||||
sentry_bind: node["sentry"]["bind"] || node["sentry"]["port"],
|
||||
# Default values from upstream
|
||||
compose_project_name: "sentry-self-hosted",
|
||||
sentry_image: "getsentry/sentry:nightly",
|
||||
snuba_image: "getsentry/snuba:nightly",
|
||||
relay_image: "getsentry/relay:nightly",
|
||||
symbolicator_image: "getsentry/symbolicator:nightly",
|
||||
wal2json_version: "latest",
|
||||
healthcheck_interval: "30s",
|
||||
healthcheck_timeout: "60s",
|
||||
healthcheck_retries: "10"
|
||||
launchpad_rpc_shared_secret: credentials["launchpad_rpc_shared_secret"]
|
||||
}
|
||||
|
||||
template "#{deploy_path}/.env.custom" do
|
||||
@@ -41,7 +41,8 @@ template "#{deploy_path}/.env.custom" do
|
||||
mode 0600
|
||||
sensitive true
|
||||
variables config: env_config
|
||||
notifies :restart, "service[sentry]", :delayed
|
||||
# TODO
|
||||
# notifies :restart, "service[sentry]", :delayed
|
||||
end
|
||||
|
||||
systemd_unit "sentry.service" do
|
||||
@@ -52,11 +53,13 @@ systemd_unit "sentry.service" do
|
||||
},
|
||||
Service: {
|
||||
Type: "oneshot",
|
||||
RemainAfterExit: "true",
|
||||
RemainAfterExit: "yes",
|
||||
WorkingDirectory: deploy_path,
|
||||
ExecStart: "docker-compose --env-file #{deploy_path}/.env.custom up -d --remove-orphans",
|
||||
ExecStop: "docker-compose stop",
|
||||
StandardOutput: "syslog"
|
||||
ExecStart: "docker compose --env-file .env --env-file .env.custom up -d --wait",
|
||||
ExecStop: "docker compose down --remove-orphans",
|
||||
StandardOutput: "syslog",
|
||||
TimeoutStartSec: 600,
|
||||
TimeoutStopSec: 300
|
||||
},
|
||||
Install: {
|
||||
WantedBy: "multi-user.target"
|
||||
@@ -67,7 +70,7 @@ systemd_unit "sentry.service" do
|
||||
end
|
||||
|
||||
service "sentry" do
|
||||
action [:enable, :start]
|
||||
action [:enable]
|
||||
end
|
||||
|
||||
include_recipe 'firewall'
|
||||
|
||||
Reference in New Issue
Block a user