Obsolette cleanup

Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
Václav Valíček 2022-08-09 21:53:11 +02:00
parent 7becb2450f
commit 34d381e7f1
Signed by: valicek
GPG Key ID: FF05BDCA0C73BB31
4 changed files with 0 additions and 107 deletions

View File

@ -1 +0,0 @@
creator/*

View File

@ -1,27 +0,0 @@
default: cloner
GLOBALVOL ?= cloner-global
TAGOWNER = valicek1
TAGMAIN = repo-cloner
TAGBASE= $(TAGOWNER)/$(TAGMAIN)
cloner:
docker build -t $(TAGBASE) .
run: cloner
docker run -v $(GLOBALVOL):/data -it --rm $(TAGBASE)
once: cloner
docker run -v $(GLOBALVOL):/data -it --rm $(TAGBASE) /usr/local/bin/cron-command
bash: cloner
docker run -v $(GLOBALVOL):/data -it --rm $(TAGBASE) /bin/bash
# wizzard
wizzard: cloner
docker run -v $(GLOBALVOL):/data -it --rm $(TAGBASE) /usr/local/bin/wizzard
singleshot: cloner
docker run -v $(GLOBALVOL):/data -e BASE=/data/cloner-t456 --user executor -it --rm $(TAGBASE) run-checker

View File

@ -1,44 +0,0 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# try to include laminar env
if [ -f /etc/profile.d/laminar.sh ]
then
source /etc/profile.d/laminar.sh
fi
# if started as root
if [ $UID -eq 0 ]
then
find /data \! -user executor -exec chown executor:executor {} \;
su executor -c cron-command
exit $?
fi
# check lock
lock=/var/run/cloner.pid
dir_prefix=cloner
max_jobs=${JOBS:-3}
function die(){
echo $@ 1>&2
exit 1
}
# first, check process
if [ -f $lock ]
then
pid=$(cat $lock)
# if it still runs, die not so quietly
[ -n "$pid" ] && [ -d /proc/$pid ] && die "Another process running!"
fi
# else make some mess and setup trap
echo $BASHPID > $lock
find /data -maxdepth 1 -type d -name "${dir_prefix}-*" | \
parallel --lb -j $max_jobs -n 1 run-mirror-update
echo "Cron Finished"

View File

@ -1,35 +0,0 @@
i#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
function log(){
local title=${raw:-$name}
[ -z "$title" ] || title=" [$title]"
echo "[$(date +"%X")]$title $@"
}
function die(){
log "$@" 1>&2
exit 1
}
scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
function finish {
rm -rf "$scratch"
}
trap finish EXIT
# necessary checks
pathto=${1:-}
[ -n "$pathto" ] || die "No project specified"
raw=$(basename $pathto | sed 's/^cloner-//g')
# is it enabled?
[ -f "$pathto/.enabled" ] || die "$raw not enabled!"
env BASE=$pathto run-checker | while read line; do log "$line"; done