From 9818a760b5f8584b2c139a9f67e67db1a5766884 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 25 Aug 2016 17:25:53 -0700 Subject: [PATCH] Install pgroonga in development and (optionally) in prod. This is preliminary work towards being able to merge support for using the pgroonga full-text search solution for all languages in Zulip. --- puppet/zulip/manifests/postgres_appdb_base.pp | 10 ++++++++++ scripts/lib/setup-apt-repo | 2 +- tools/provision.py | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/puppet/zulip/manifests/postgres_appdb_base.pp b/puppet/zulip/manifests/postgres_appdb_base.pp index 15fb111905..a697228a64 100644 --- a/puppet/zulip/manifests/postgres_appdb_base.pp +++ b/puppet/zulip/manifests/postgres_appdb_base.pp @@ -66,4 +66,14 @@ class zulip::postgres_appdb_base { source => "puppet:///modules/zulip/nagios_plugins/zulip_postgres_appdb", } + $pgroonga = zulipconf("machine", "pgroonga", "") + if $pgroonga != "" { + apt::ppa {'ppa:groonga/ppa': + before => Package["postgresql-${zulip::base::postgres_version}-pgroonga"], + } + # Needed for optional our full text search system + package{"postgresql-${zulip::base::postgres_version}-pgroonga": + ensure => "installed", + } + } } diff --git a/scripts/lib/setup-apt-repo b/scripts/lib/setup-apt-repo index 735d850fc7..55249a9bbd 100755 --- a/scripts/lib/setup-apt-repo +++ b/scripts/lib/setup-apt-repo @@ -2,7 +2,7 @@ set -x set -x -apt-get install -y lsb-release +apt-get install -y lsb-release software-properties-common # First, install any updates from the apt repo that may be needed wget -qO - https://zulip.com/dist/keys/zulip-ppa.asc | apt-key add - diff --git a/tools/provision.py b/tools/provision.py index f4b1e93d65..bef362b7c1 100755 --- a/tools/provision.py +++ b/tools/provision.py @@ -95,10 +95,12 @@ APT_DEPENDENCIES = { "trusty": UBUNTU_COMMON_APT_DEPENDENCIES + [ "postgresql-9.3", "postgresql-9.3-tsearch-extras", + "postgresql-9.3-pgroonga", ], "xenial": UBUNTU_COMMON_APT_DEPENDENCIES + [ "postgresql-9.5", "postgresql-9.5-tsearch-extras", + "postgresql-9.5-pgroonga", ], } @@ -160,6 +162,8 @@ def main(): os.chdir(ZULIP_PATH) run(["sudo", "./scripts/lib/setup-apt-repo"]) + # Add groonga repository to get the pgroonga packages + run(["sudo", "add-apt-repository", "-y", "ppa:groonga/ppa"]) run(["sudo", "apt-get", "update"]) run(["sudo", "apt-get", "-y", "install", "--no-install-recommends"] + APT_DEPENDENCIES[codename])