49 lines
1.3 KiB
Bash
49 lines
1.3 KiB
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
apt-get update && apt-get install -y --no-install-recommends git
|
|
|
|
clone_or_checkout() {
|
|
REPO_URL="$1"
|
|
REVISION="$2"
|
|
TARGET_DIR="$3"
|
|
|
|
if [ ! -d "$TARGET_DIR/.git" ]; then
|
|
echo "Cloning $REPO_URL into $TARGET_DIR"
|
|
git clone --depth=1 "$REPO_URL" "$TARGET_DIR"
|
|
else
|
|
echo "Repository already exists at $TARGET_DIR"
|
|
fi
|
|
|
|
cd "$TARGET_DIR"
|
|
|
|
# Fetch the target revision if it is not already available
|
|
if ! git cat-file -e "${REVISION}^{commit}" 2>/dev/null; then
|
|
echo "Fetching revision $REVISION"
|
|
git fetch --depth=1 origin "$REVISION"
|
|
fi
|
|
|
|
echo "Checking out $REVISION"
|
|
git checkout --force "$REVISION"
|
|
|
|
cd - >/dev/null
|
|
}
|
|
|
|
clone_or_checkout \
|
|
"https://github.com/byrongamatos/slopsmith-plugin-notedetect.git" \
|
|
"c6d69e04c49410b186466bc895d7b4b2bd3add0a" \
|
|
"/app/plugins/slopsmith-plugin-notedetect"
|
|
|
|
clone_or_checkout \
|
|
"https://github.com/byrongamatos/slopsmith-plugin-nam-tone.git" \
|
|
"9bc981220635686ca2bcee8e65b990472cdb1037" \
|
|
"/app/plugins/slopsmith-plugin-nam-tone"
|
|
|
|
clone_or_checkout \
|
|
"https://github.com/masc0t/slopsmith-plugin-find-more.git" \
|
|
"e726c5b0e36d85f43994b216265331c8e370d9e1" \
|
|
"/app/plugins/slopsmith-plugin-find-more"
|
|
|
|
python main.py
|
|
|