Skip to content

Commit

Permalink
Add script wrapper for pypi_shadowmire.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Shengqi Chen <[email protected]>
  • Loading branch information
Harry-Chen committed Aug 8, 2024
1 parent ec2e661 commit eda8641
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions pypi_shadowmire.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

set -e

SHADOWMIRE=${SHADOWMIRE:-"/home/scripts/shadowmire"}
PYPI_MASTER="https://pypi.org"

TUNASYNC_UPSTREAM=${TUNASYNC_UPSTREAM_URL:-$PYPI_MASTER}
TUNASYNC_UPSTREAM=${TUNASYNC_UPSTREAM%/}

CONF="/tmp/shadowmire.conf"
INIT=${INIT:-"0"}
SHADOWMIRE_UPSTREAM=${SHADOWMIRE_UPSTREAM:-"0"}

if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
mkdir -p $TUNASYNC_WORKING_DIR
INIT="1"
fi

export REPO="${TUNASYNC_WORKING_DIR}"

echo "Syncing to $TUNASYNC_WORKING_DIR"

DOWNLOAD_MIRROR=""
if [[ $TUNASYNC_UPSTREAM != $PYPI_MASTER ]]; then
# see https://github.com/pypa/bandersnatch/pull/928 for more info
DOWNLOAD_MIRROR="shadowmire_upstream = ${TUNASYNC_UPSTREAM}"
fi

(
cat << EOF
[options]
sync_packages = true
${DOWNLOAD_MIRROR}
exclude = [
".+-nightly(-|$)",
EOF

for i in $PYPI_EXCLUDE; do
echo " \"$i\","
done

cat << EOF
]
EOF

cat << EOF
]
prerelease_exclude = [
"duckdb",
"graphscope-client",
"lalsuite",
"gs-(apps|engine|include)",
"bigdl-dllib(-spark2|-spark3)?",
"ovito"
]
EOF
) > $CONF

echo "Generated config file:"
cat $CONF

exec $SHADOWMIRE --config $CONF sync

0 comments on commit eda8641

Please sign in to comment.