From 234306134c70ae16dd3b144406d539420a4d2b95 Mon Sep 17 00:00:00 2001 From: casjay Date: Wed, 4 Sep 2024 12:28:04 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dockerfile .gitea/workflows/docker.yaml rootfs/root/docker/setup/03-files.sh --- .gitea/workflows/docker.yaml | 3 ++- Dockerfile | 6 ++++-- rootfs/root/docker/setup/03-files.sh | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/docker.yaml b/.gitea/workflows/docker.yaml index e161f43..9e3ff1e 100644 --- a/.gitea/workflows/docker.yaml +++ b/.gitea/workflows/docker.yaml @@ -18,10 +18,11 @@ jobs: - name: Get Meta id: meta + env: ORG ${{ vars.DOCKER_ORG }} run: | echo DATE_TAG=$(date +'%y%m') >> $GITHUB_OUTPUT echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT - echo DOCKER_ORG=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $1}') >> $GITHUB_OUTPUT + echo DOCKER_ORG=$([ -n "$ORG" ] && echo "$ORG" || echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $1}') >> $GITHUB_OUTPUT echo DOCKER_TAG=$([ -n "$DOCKER_TAG" ] && echo ${DOCKER_TAG} || echo "latest") >> $GITHUB_OUTPUT echo DOCKER_HUB=$([ -n "$DOCKER_HUB" ] && echo ${DOCKER_HUB} || echo "docker.io") >> $GITHUB_OUTPUT echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}' | sed 's|^docker-||g') >> $GITHUB_OUTPUT diff --git a/Dockerfile b/Dockerfile index 797f7bf..0d8c33d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ ARG DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults" ARG USER="root" ARG SHELL_OPTS="set -e -o pipefail" ARG AUR_USER="aur" -ARG AUR_HOME="/home/aur" +ARG AUR_HOME="/var/lib/aur" ARG SERVICE_PORT="" ARG EXPOSE_PORTS="" @@ -67,6 +67,8 @@ ENV TIMEZONE="${TZ}" ENV LANG="${LANGUAGE}" ENV TERM="xterm-256color" ENV HOSTNAME="casjaysdev-archlinux" +ENV AUR_HOME="${AUR_HOME}" +ENV AUR_USER="${AUR_USER}" USER ${USER} WORKDIR /root @@ -158,7 +160,7 @@ RUN echo "Setting up users and scripts "; \ echo 'standard-resolver' >"${AUR_HOME}/.gnupg/dirmngr.conf" && \ chown -Rf "${AUR_USER}":"${AUR_USER}" "${AUR_HOME}"; \ if [ -z "$(command -v yay 2>/dev/null)" ];then cd "${AUR_HOME}/build" && \ - sudo -u "${AUR_USER}" git clone --depth 1 "https://aur.archlinux.org/yay.git" && cd yay && \ + git clone --depth 1 "https://aur.archlinux.org/yay.git" && cd yay && \ sudo -u "${AUR_USER}" makepkg --noconfirm -si; \ fi; \ sudo -u "${AUR_USER}" yay --afterclean --removemake --save && pacman -Qtdq | xargs -r pacman --noconfirm -Rcns; \ diff --git a/rootfs/root/docker/setup/03-files.sh b/rootfs/root/docker/setup/03-files.sh index 94adf9c..52929cf 100755 --- a/rootfs/root/docker/setup/03-files.sh +++ b/rootfs/root/docker/setup/03-files.sh @@ -24,10 +24,12 @@ set -o pipefail # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Set env variables exitCode=0 - +AUR_USER="${AUR_USER:-aur}" +AUR_HOME="${AUR_HOME:-/var/lib/aur}" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Main script - +mkdir -p "${AUR_HOME}/build" +mkdir -p "${AUR_HOME}/.gnupg" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Set the exit code exitCode=$?