From 8b1f3a145df48cfdc16d790379047c4801ee6e34 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Sat, 15 Jan 2022 11:40:25 -0500 Subject: [PATCH] add check-aur.sh to check if the aur package works intended to be used in CI --- .gitignore | 1 + scripts/check-aur.sh | 15 +++++++++++++++ scripts/docker/arch/Dockerfile | 3 +++ scripts/docker/arch/install.sh | 5 +++++ 4 files changed, 24 insertions(+) create mode 100755 scripts/check-aur.sh create mode 100644 scripts/docker/arch/Dockerfile create mode 100755 scripts/docker/arch/install.sh diff --git a/.gitignore b/.gitignore index 585f96a..d20f73d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ SteamAuth/SteamAuth/packages/ test_maFiles/ *.deb +*.tar.gz target/ aur/ diff --git a/scripts/check-aur.sh b/scripts/check-aur.sh new file mode 100755 index 0000000..c0c0d6a --- /dev/null +++ b/scripts/check-aur.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Performs a test install of the package from the AUR. If the package fails to install, there should be a non-zero exit code. +# Intended for use with CI. + +set -e + +cd scripts/docker/arch/ +tar -cvf arch-docker.tar.gz . +docker image build -t steamguard-cli-archlinux-builder - < arch-docker.tar.gz +rm arch-docker.tar.gz + +docker run -it --rm steamguard-cli-archlinux-builder /bin/bash -c "./install.sh steamguard-cli-git && steamguard-cli --version" + +docker image rm steamguard-cli-archlinux-builder:latest diff --git a/scripts/docker/arch/Dockerfile b/scripts/docker/arch/Dockerfile new file mode 100644 index 0000000..2813c1e --- /dev/null +++ b/scripts/docker/arch/Dockerfile @@ -0,0 +1,3 @@ +FROM greyltc/archlinux-aur:yay + +COPY install.sh /install.sh diff --git a/scripts/docker/arch/install.sh b/scripts/docker/arch/install.sh new file mode 100755 index 0000000..f5585dd --- /dev/null +++ b/scripts/docker/arch/install.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +PACKAGE="$1" +echo "Installing $PACKAGE" +sudo -u ab -D~ bash -c "yay -Syu --removemake --needed --noprogressbar --noconfirm $PACKAGE"