provision: Initialize setup-yum-repo.

This commit is contained in:
rht
2018-12-14 02:15:13 +00:00
committed by Tim Abbott
parent 85b2627191
commit 448303b3f0
2 changed files with 24 additions and 8 deletions

18
scripts/lib/setup-yum-repo Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
set -x
set -e
yum install -y epel-release
yum update
# "Development Tools" is the equivalent of build-essential
yum groupinstall -y "Development Tools"
RHVER="$(rpm -qf --queryformat="%{VERSION}" /etc/redhat-release)"
RHARCH="$(rpm -qf --queryformat="%{ARCH}" /etc/redhat-release)"
# PostgreSQL 10
yum localinstall -y "https://yum.postgresql.org/10/redhat/rhel-$RHVER-$RHARCH/pgdg-centos10-10-2.noarch.rpm"
# PGroonga
# https://pgroonga.github.io/install/centos.html
yum localinstall -y https://packages.groonga.org/centos/groonga-release-latest.noarch.rpm

View File

@@ -182,11 +182,10 @@ SYSTEM_DEPENDENCIES = {
"postgresql-10-tsearch-extras", "postgresql-10-tsearch-extras",
], ],
"centos7": COMMON_YUM_DEPENDENCIES + [ "centos7": COMMON_YUM_DEPENDENCIES + [
"postgresql10-server", # TODO add the source "postgresql10-server",
"postgresql10", "postgresql10",
"postgresql10-devel", "postgresql10-devel",
"postgresql10-pgroonga", # TODO add the source "postgresql10-pgroonga",
# TODO tsearch-extras must be compiled from scratch
] ]
} }
@@ -226,17 +225,16 @@ def setup_shell_profile(shell_profile):
def install_apt_deps(): def install_apt_deps():
# type: () -> None # type: () -> None
# setup-apt-repo does an `apt-get update`
run(["sudo", "./scripts/lib/setup-apt-repo"])
# By doing list -> set -> list conversion we remove duplicates. # By doing list -> set -> list conversion we remove duplicates.
deps_to_install = list(set(SYSTEM_DEPENDENCIES[codename])) deps_to_install = list(set(SYSTEM_DEPENDENCIES[codename]))
if vendor == 'CentOS': if vendor == 'CentOS':
print(WARNING + "CentOS support is still experimental.") print(WARNING + "CentOS support is still experimental.")
run(["sudo", "yum", "install", "-y", "epel-release"]) run(["sudo", "./scripts/lib/setup-yum-repo"])
# "Development Tools" is the equivalent of build-essential
run(["sudo", "yum", "groupinstall", "-y", "Development Tools"])
run(["sudo", "yum", "install", "-y"] + deps_to_install) run(["sudo", "yum", "install", "-y"] + deps_to_install)
# TODO tsearch-extras must be compiled from scratch
else: else:
# setup-apt-repo does an `apt-get update`
run(["sudo", "./scripts/lib/setup-apt-repo"])
run(["sudo", "apt-get", "-y", "install", "--no-install-recommends"] + deps_to_install) run(["sudo", "apt-get", "-y", "install", "--no-install-recommends"] + deps_to_install)
def main(options): def main(options):