Added Build Script
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
old-tag.txt
|
||||||
17
build.sh
Executable file
17
build.sh
Executable file
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user