From 2385dcf07aba1a4e189b4af8d468a4ba247b6c3d Mon Sep 17 00:00:00 2001 From: tke Date: Fri, 20 May 2022 14:13:58 +0200 Subject: [PATCH] Added Build Script --- .gitignore | 1 + build.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .gitignore create mode 100755 build.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4dfa8ed --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +old-tag.txt diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..89520a6 --- /dev/null +++ b/build.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +cd $( dirname -- "${BASH_SOURCE[0]}" ) +newtag=$(curl https://github.com/ahmedkhlief/APT-Hunter/tags.atom | grep -Pio 'link.*' | grep -Pio '(?<=href=")[^"]+' | grep tag | head -n1 | grep -Pio '(?<=tag/).*$' | tr -dc '[[:alnum:]]' | tr '[[:upper:]]' '[[:lower:]]') +if [[ -f ./old-tag.txt ]] ; then +oldtag=$(cat ./old-tag.txt) +if [[ "${oldtag}" -eq "${newtag}" ]] ; then +echo "Versions match - Exiting" +exit +fi +fi +echo "Building ${newtag}" +docker build -t "tabledevil/apthunter:${newtag}" --no-cache . +docker push "tabledevil/apthunter:${newtag}" +echo "${newtag}" > ./old-tag.txt + + +