Skip to content

Commit

Permalink
Implement new download requirements script (hitachienergy#805)
Browse files Browse the repository at this point in the history
* rsync added to the Dockerfile
  • Loading branch information
sbbroot committed Nov 29, 2021
1 parent 33ff19a commit 462c9de
Show file tree
Hide file tree
Showing 35 changed files with 1,442 additions and 739 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY . /epicli
RUN : INSTALL APT REQUIREMENTS \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
autossh curl gcc jq libcap2-bin libffi-dev make musl-dev openssh-client procps psmisc ruby-full sudo tar unzip vim \
autossh curl gcc jq libcap2-bin libffi-dev make musl-dev openssh-client procps psmisc ruby-full sudo tar unzip vim rsync \
\
&& : INSTALL HELM BINARY \
&& curl -fsSLO https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz \
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/python3
import datetime
import logging
import sys
from os import getuid
from typing import Dict, List

from src.config import Config, OSType
from src.error import CriticalError
from src.mode.base_mode import BaseMode
from src.mode.debian_family_mode import DebianFamilyMode
from src.mode.red_hat_family_mode import RedHatFamilyMode


MODES: Dict[OSType, BaseMode] = {
OSType.Ubuntu: DebianFamilyMode,
OSType.RedHat: RedHatFamilyMode,
OSType.CentOS: RedHatFamilyMode
}


def main(argv: List[str]) -> int:
try:
time_begin = datetime.datetime.now()
if getuid() != 0:
print('Error: Needs to be run as root!')
return 1

config = Config(argv)

MODES[config.os_type](config).run()

time_end = time_begin - datetime.datetime.now()
logging.info(f'Total execution time: {str(time_end).split(".")[0]}')
except CriticalError:
return 1

return 0

if __name__ == '__main__':
sys.exit(main(sys.argv))
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from typing import Dict, List

from repositories.ubuntu import REPOSITORIES_X86_64 as Ubuntu_X86_64
from src.config import OSArch, OSType


REPOSITORIES: Dict[OSArch, Dict[OSType, Dict[str, List]]] = {
OSArch.X86_64: {
OSType.CentOS: {},
OSType.RedHat: {},
OSType.Ubuntu: Ubuntu_X86_64
},
OSArch.ARM64: {
OSType.CentOS: {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from pathlib import Path
from typing import Dict


class Repo:
def __init__(self, key: str, content: str, path: Path):
self.key: str = key
self.content: str = content
self.path: Path = path


REPOSITORIES_X86_64: Dict[str, Repo] = {
'elastic_6': Repo('https://artifacts.elastic.co/GPG-KEY-elasticsearch',
'deb https://artifacts.elastic.co/packages/oss-6.x/apt stable main',
Path('/etc/apt/sources.list.d/elastic-6.x.list')),

'kubernetes': Repo('https://packages.cloud.google.com/apt/doc/apt-key.gpg',
'deb http://apt.kubernetes.io/ kubernetes-xenial main',
Path('/etc/apt/sources.list.d/kubernetes.list')),

'erlang_solutions': Repo('https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc',
'deb https://packages.erlang-solutions.com/ubuntu bionic contrib',
Path('/etc/apt/sources.list.d/erlang-23.x.list')),

'rabbitmq_server': Repo('https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey',
'deb https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu bionic main',
Path('/etc/apt/sources.list.d/rabbitmq.list')),

'docker_ce': Repo('https://download.docker.com/linux/ubuntu/gpg',
'deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable',
Path('/etc/apt/sources.list.d/docker-ce.list')),

'elastic_7': Repo('https://artifacts.elastic.co/GPG-KEY-elasticsearch',
'deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main',
Path('/etc/apt/sources.list.d/elastic-7.x.list')),

'opendistroforelasticsearch': Repo('https://d3g5vo6xdbdb9a.cloudfront.net/GPG-KEY-opendistroforelasticsearch',
'deb https://d3g5vo6xdbdb9a.cloudfront.net/apt stable main',
Path('/etc/apt/sources.list.d/opendistroforelasticsearch.list')),

'postgresql': Repo('https://www.postgresql.org/media/keys/ACCC4CF8.asc',
'deb http://apt.postgresql.org/pub/repos/apt bionic-pgdg main',
Path('/etc/apt/sources.list.d/pgdg.list')),

# Historical packages from apt.postgresql.org
'postgresql-archive': Repo('https://www.postgresql.org/media/keys/ACCC4CF8.asc',
'deb http://apt-archive.postgresql.org/pub/repos/apt bionic-pgdg-archive main',
Path('/etc/apt/sources.list.d/pgdg-archive.list')),

# Provides repmgr
'2ndquadrant': Repo('https://dl.2ndquadrant.com/gpg-key.asc',
'deb https://dl.2ndquadrant.com/default/release/apt bionic-2ndquadrant main',
Path('/etc/apt/sources.list.d/2ndquadrant-dl-default-release.list'))
}
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from typing import Dict, List
from src.config import OSArch, OSType
from requirements.ubuntu import REQUIREMENTS_X86_64 as Ubuntu_X86_64


REQUIREMENTS: Dict[OSArch, Dict[OSType, Dict[str, List]]] = {
OSArch.X86_64: {
OSType.CentOS: {},
OSType.RedHat: {},
OSType.Ubuntu: Ubuntu_X86_64
},
OSArch.ARM64: {
OSType.CentOS: {}
}
}
Loading

0 comments on commit 462c9de

Please sign in to comment.