From 5a06345fb6cbb2516dbaf3b1398907ef7e64545e Mon Sep 17 00:00:00 2001 From: ckonstanski Date: Thu, 13 Aug 2026 14:41:50 -0600 Subject: CI stuff --- ci/Dockerfile | 10 +++++----- ci/data/install-root.sh | 14 +++++++------- ci/docker-build.sh | 2 +- ci/docker-compose.yaml.example | 24 ++++++++++++++---------- ci/env.sh | 8 ++++---- 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index 18a0dab..b6cce8d 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -1,12 +1,12 @@ FROM ubuntu:noble MAINTAINER Carlos Konstanski ADD tmp/docker-start.tar.xz / -ARG OLO_USERNAME=root -ARG OLO_GROUPNAME=root -ARG OLO_UID=0 -ARG OLO_GID=0 +ARG USER_USERNAME=root +ARG USER_GROUPNAME=root +ARG USER_UID=0 +ARG USER_GID=0 RUN data/install-root.sh -USER ${OLO_UID}:${OLO_GID} +USER ${USER_UID}:${USER_GID} RUN data/install-user-sbcl.sh ENTRYPOINT [ "data/start_app.sh" ] #ENTRYPOINT [ "/bin/bash", "-l", "-c" ] diff --git a/ci/data/install-root.sh b/ci/data/install-root.sh index be226f0..5385707 100755 --- a/ci/data/install-root.sh +++ b/ci/data/install-root.sh @@ -12,18 +12,18 @@ aptitude -y install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--f rsync -av /data/ / -if (( OLO_UID != 0 )); then +if (( USER_UID != 0 )); then userdel ubuntu || true groupdel ubuntu || true rm -rf /home/ubuntu || true - export HOMEDIR="/home/${OLO_USERNAME}" - groupadd -g "${OLO_GID}" "${OLO_GROUPNAME}" || OLO_GROUPNAME=$(grep -F "x:${OLO_GID}:" /etc/group | awk -F: '{print $1}') - useradd -s /bin/bash -m -u "${OLO_UID}" -g "${OLO_GROUPNAME}" "${OLO_USERNAME}" || OLO_USERNAME=$(grep -F "x:${OLO_UID}:" /etc/passwd | awk -F: '{print $1}') - SUDOERS_FILENAME="${OLO_USERNAME//\./_}" - echo "${OLO_USERNAME} ALL=(ALL) NOPASSWD: ALL" > "/etc/sudoers.d/${SUDOERS_FILENAME}" + export HOMEDIR="/home/${USER_USERNAME}" + groupadd -g "${USER_GID}" "${USER_GROUPNAME}" || USER_GROUPNAME=$(grep -F "x:${USER_GID}:" /etc/group | awk -F: '{print $1}') + useradd -s /bin/bash -m -u "${USER_UID}" -g "${USER_GROUPNAME}" "${USER_USERNAME}" || USER_USERNAME=$(grep -F "x:${USER_UID}:" /etc/passwd | awk -F: '{print $1}') + SUDOERS_FILENAME="${USER_USERNAME//\./_}" + echo "${USER_USERNAME} ALL=(ALL) NOPASSWD: ALL" > "/etc/sudoers.d/${SUDOERS_FILENAME}" chmod 0440 "/etc/sudoers.d/${SUDOERS_FILENAME}" mkdir -p "${HOMEDIR}/.gnupg" - chown "${OLO_USERNAME}":"${OLO_GROUPNAME}" "${HOMEDIR}/.gnupg" + chown "${USER_USERNAME}":"${USER_GROUPNAME}" "${HOMEDIR}/.gnupg" chmod 0700 "${HOMEDIR}/.gnupg" fi diff --git a/ci/docker-build.sh b/ci/docker-build.sh index b927920..ee94c1a 100755 --- a/ci/docker-build.sh +++ b/ci/docker-build.sh @@ -12,8 +12,8 @@ pushd ${builddir} 2>/dev/null tar Jcvf docker-start.tar.xz data/ docker stop ${container} || true -docker container prune -f docker rmi --force ${container} || true +docker system prune -f DOCKER_BUILDKIT=0 docker compose \ --progress "plain" \ diff --git a/ci/docker-compose.yaml.example b/ci/docker-compose.yaml.example index ecb6836..be47b0f 100644 --- a/ci/docker-compose.yaml.example +++ b/ci/docker-compose.yaml.example @@ -1,41 +1,45 @@ services: bogenherr: image: bogenherr + container_name: bogenherr tty: true build: context: . args: - OLO_USERNAME: ${OLO_USERNAME} - OLO_GROUPNAME: ${OLO_GROUPNAME} - OLO_UID: ${OLO_UID} - OLO_GID: ${OLO_GID} + USER_USERNAME: ${USER_USERNAME} + USER_GROUPNAME: ${USER_GROUPNAME} + USER_UID: ${USER_UID} + USER_GID: ${USER_GID} network_mode: "host" container_name: bogenherr volumes: - type: bind source: ~/.m2 - target: /home/${OLO_USERNAME}/.m2 + target: /home/${USER_USERNAME}/.m2 - type: bind source: ~/.bashrc - target: /home/${OLO_USERNAME}/.bashrc + target: /home/${USER_USERNAME}/.bashrc - type: bind source: ~/.bash_history - target: /home/${OLO_USERNAME}/.bash_history + target: /home/${USER_USERNAME}/.bash_history - type: bind source: ~/.vimrc - target: /home/${OLO_USERNAME}/.vimrc + target: /home/${USER_USERNAME}/.vimrc - type: bind source: ~/.gitconfig - target: /home/${OLO_USERNAME}/.gitconfig + target: /home/${USER_USERNAME}/.gitconfig - type: bind source: ~/.ssh - target: /home/${OLO_USERNAME}/.ssh + target: /home/${USER_USERNAME}/.ssh - type: bind source: /etc/hosts target: /etc/hosts - type: bind source: /etc/ssh target: /etc/ssh + - type: bind + source: /etc/bogenherr + target: /etc/bogenherr - type: bind source: /var/log/lisp target: /var/log/lisp diff --git a/ci/env.sh b/ci/env.sh index a49fb54..7fe3763 100644 --- a/ci/env.sh +++ b/ci/env.sh @@ -1,4 +1,4 @@ -export OLO_USERNAME=$(id -un) -export OLO_GROUPNAME=$(id -gn) -export OLO_UID=$(id -u) -export OLO_GID=$(id -g) +export USER_USERNAME=$(id -un) +export USER_GROUPNAME=$(id -gn) +export USER_UID=$(id -u) +export USER_GID=$(id -g) -- cgit v1.3