From f7e1f2be7f846f50ce04144a043c0851bd9746e1 Mon Sep 17 00:00:00 2001 From: Carlos Date: Sun, 6 Oct 2024 11:30:48 +0200 Subject: [PATCH] Lint build archive and update image sources for docker. --- contrib/docker/Dockerfile | 4 +-- contrib/docker/docker_build_installer | 8 ++---- contrib/packaging/build_archive | 36 ++++++++++++++------------- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile index 816c264..acb8011 100644 --- a/contrib/docker/Dockerfile +++ b/contrib/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.8 as stage1 +FROM alpine:3.19 as stage1 MAINTAINER "nzlosh@yahoo.com" ENV ERRBOT_USER=errbot @@ -7,7 +7,7 @@ COPY docker_build_installer /root RUN sh /root/docker_build_installer stage1 -FROM alpine:3.8 +FROM alpine:3.19 COPY docker_build_installer /root RUN sh /root/docker_build_installer stage2 COPY --from=stage1 /opt/errbot /opt/errbot diff --git a/contrib/docker/docker_build_installer b/contrib/docker/docker_build_installer index 1e5d3c4..ac46336 100644 --- a/contrib/docker/docker_build_installer +++ b/contrib/docker/docker_build_installer @@ -83,8 +83,7 @@ function install_errbot { echo -e "\e[93mErrbot plugins installation\e[0m" pip3 install --upgrade pip setuptools - # Use slackclient 1.3.1 until support for slack 2.0 has been added to slack backend. - pip3 install errbot slackclient==1.3.1 sleekxmpp IRC + pip3 install errbot==6.2.0 slixmpp IRC errbot-backend-slackv3 err-backend-mattermost err-backend-discord initialise_errbot for dirname in plugins backends log do @@ -96,10 +95,7 @@ function install_errbot done for backend in 'https://github.com/nzlosh/err-backend-rocketchat.git@maint_nzlosh' \ - 'https://github.com/nzlosh/err-backend-gitter.git@maint_nzlosh' \ - 'https://github.com/errbotio/err-backend-discord' \ - 'https://github.com/errbotio/err-backend-mattermost' \ - 'https://github.com/errbotio/err-backend-slackv3' + 'https://github.com/nzlosh/err-backend-gitter.git@maint_nzlosh' do install_backend $backend done diff --git a/contrib/packaging/build_archive b/contrib/packaging/build_archive index e4921f6..ea86aeb 100755 --- a/contrib/packaging/build_archive +++ b/contrib/packaging/build_archive @@ -32,51 +32,52 @@ function title } function rocky8_install { - dnf install -y ${PKGS[@]} + dnf install -y "${PKGS[@]}" } function rocky9_install { - dnf install -y ${PKGS[@]} + dnf install -y "${PKGS[@]}" } function ubuntu18_install { - apt install ${PKGS[@]} + apt install "${PKGS[@]}" } function ubuntu20_install { - apt install ${PKGS[@]} + apt install "${PKGS[@]}" } function ubuntu22_install { - apt install ${PKGS[@]} + apt install "${PKGS[@]}" } function debian10_install { - apt install ${PKGS[@]} + apt install "${PKGS[@]}" } function debian11_install { - apt install ${PKGS[@]} + apt install "${PKGS[@]}" } function install_system_requirements { title "INSTALL SYSTEM REQUIREMENTS" - ${DISTRO_COMBO}_install + "${DISTRO_COMBO}_install" } function create_virtual_environment { title "CREATE VIRTUAL ENVIRONMENT" - $PYBIN -m venv "$ROOT/venv" - cd "$ROOT" - mkdir "$ROOT"/{plugins,backends,data} + "${PYBIN}" -m venv "${ROOT}" + cd "${ROOT}" + mkdir ./{plugins,backends,data} } function fetch_archives { title "DOWNLOAD ARCHIVES" export BACKENDS=("err-backend-discord" "err-backend-slackv3" "err-backend-gitter" "err-backend-mattermost" "err-backend-botframework") + mkdir "${BUILD_DIR}/backends" cd "${BUILD_DIR}" wget "https://github.com/errbotio/err-backend-discord/archive/refs/tags/v4.0.0.tar.gz" -O "backends/err-backend-discord-v4.0.0.tar.gz" @@ -110,22 +111,22 @@ function install_extensions done done - for location in $ROOT/backends + for location in "${ROOT}/backends" do - cd $location - for backend in ${BACKENDS[@]} + cd "${location}" + for backend in "${BACKENDS[@]}" do # Move archive directory names to correct errbot names. - mv -f *"${backend}"* "$backend" + mv -f ./*"${backend}"* "$backend" done done for location in "$ROOT/plugins" do cd "$location" - for plugin in ${PLUGINS[@]} + for plugin in "${PLUGINS[@]}" do - mv -f *"${plugin}"* "$plugin" + mv -f ./*"${plugin}"* "$plugin" done done } @@ -160,6 +161,7 @@ function install_errbot { title "INSTALL ERRBOT ($($ROOT/venv/bin/pip --version))" source "${ROOT}/venv/bin/activate" + pip install --upgrade pip # Use tmp dir to download and build errbot/plugins. export BUILD_DIR=$(mktemp -d "$ROOT"/build.XXXXXX)