Skip to content

Commit

Permalink
Lint build archive and update image sources for docker.
Browse files Browse the repository at this point in the history
  • Loading branch information
nzlosh committed Oct 6, 2024
1 parent 9561d7b commit f7e1f2b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
4 changes: 2 additions & 2 deletions contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.8 as stage1
FROM alpine:3.19 as stage1
MAINTAINER "nzlosh@yahoo.com"

ENV ERRBOT_USER=errbot
Expand All @@ -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
Expand Down
8 changes: 2 additions & 6 deletions contrib/docker/docker_build_installer
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
36 changes: 19 additions & 17 deletions contrib/packaging/build_archive
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f7e1f2b

Please sign in to comment.