mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-13 22:09:17 +00:00
perf: change lfs files download (#15293)
* perf: change lfs files download * perf: clean unused ansible module * perf: update lfs download * perf: Update Dockerfile with new base image tag * perf: change download path * perf: Update Dockerfile with new base image tag --------- Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
36
requirements/static_files.sh
Normal file
36
requirements/static_files.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
CURRENT_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
BASE_DIR=$(dirname "$CURRENT_DIR")
|
||||
VERSION=v0.0.1
|
||||
|
||||
to_files="
|
||||
apps/common/utils/ip/geoip/GeoLite2-City.mmdb
|
||||
apps/common/utils/ip/ipip/ipipfree.ipdb
|
||||
apps/accounts/automations/check_account/leak_passwords.db
|
||||
"
|
||||
|
||||
if [[ $1 == "root" ]];then
|
||||
BASE_DIR="${BASE_DIR}/jumpserver"
|
||||
fi
|
||||
|
||||
|
||||
for file in $to_files; do
|
||||
# Check if the file already exists
|
||||
file_path="${BASE_DIR}/$file"
|
||||
rm -f $file_path
|
||||
if [ -f "$file_path" ]; then
|
||||
echo "File $file already exists, skipping download."
|
||||
continue
|
||||
fi
|
||||
|
||||
filename=$(basename "$file")
|
||||
to_dir=$(dirname "$file_path")
|
||||
if [ ! -d "$to_dir" ]; then
|
||||
mkdir -p "$to_dir"
|
||||
fi
|
||||
url=""https://github.com/jumpserver/static/releases/download/${VERSION}/$filename""
|
||||
echo "Download $filename to $file_path"
|
||||
wget "$url" -O "${file_path}"
|
||||
done
|
||||
|
Reference in New Issue
Block a user