aboutsummaryrefslogtreecommitdiff
path: root/test_with_podman.sh
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-06-07 01:41:33 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-06-07 01:41:33 +0300
commit19cb280a2cc8da730b2e6797aede1b36253e6714 (patch)
tree9ae72bba54856d99a00cead27455556906c6e641 /test_with_podman.sh
parentab9b088ad0c097f803bd489a68a7f45db9af8570 (diff)
downloadarching-kaos-tools-19cb280a2cc8da730b2e6797aede1b36253e6714.tar.gz
arching-kaos-tools-19cb280a2cc8da730b2e6797aede1b36253e6714.tar.bz2
arching-kaos-tools-19cb280a2cc8da730b2e6797aede1b36253e6714.zip
Fixes and updates in tests
Diffstat (limited to 'test_with_podman.sh')
-rwxr-xr-xtest_with_podman.sh41
1 files changed, 30 insertions, 11 deletions
diff --git a/test_with_podman.sh b/test_with_podman.sh
index aaa8c57..574c8ed 100755
--- a/test_with_podman.sh
+++ b/test_with_podman.sh
@@ -1,16 +1,35 @@
#!/bin/bash
podman_dir="podman"
now="$(date -u +%s)"
-for file in $podman_dir/*
-do
- distro="$(printf "%s" "$file"|cut -d '.' -f 2)"
- build_log="$now-podman-$distro-build_log"
- printf "Building %s container..." "$distro"
- podman build -f $file -t arching-kaos-tools-$distro . >> $build_log 2>&1
- if [ $? -ne 0 ]
+
+_build_container(){
+ if [ ! -z $1 ] && [ -n "$1" ]
then
- printf "\tFailed!\n"
- else
- printf "\tSuccess!\n"
+ file="$podman_dir/ContainerFile.$1"
+ distro="$(printf "%s" "$file"|cut -d '.' -f 2)"
+ build_log="$now-podman-$distro-build_log"
+ printf "Building %s container..." "$distro"
+ podman build -f $file -t arching-kaos-tools-$distro . >> $build_log 2>&1
+ if [ $? -ne 0 ]
+ then
+ printf "\tFailed!\n"
+ else
+ printf "\tSuccess!\n"
+ fi
+ tail -n 2 $build_log
fi
-done
+}
+
+_build_all_containers(){
+ for file in $podman_dir/*
+ do
+ _build_container "$(basename $file | cut -d '.' -f 2)"
+ done
+}
+
+if [ ! -z $1 ] && [ -n "$1" ]
+then
+ _build_container $1
+else
+ _build_all_containers
+fi