mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-22 04:57:39 +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:
parent
24fe058fd9
commit
e992c44e11
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -1,4 +0,0 @@
|
||||
*.mmdb filter=lfs diff=lfs merge=lfs -text
|
||||
*.mo filter=lfs diff=lfs merge=lfs -text
|
||||
*.ipdb filter=lfs diff=lfs merge=lfs -text
|
||||
leak_passwords.db filter=lfs diff=lfs merge=lfs -text
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -46,3 +46,6 @@ test.py
|
||||
.test/
|
||||
*.mo
|
||||
apps.iml
|
||||
*.db
|
||||
*.mmdb
|
||||
*.ipdb
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM jumpserver/core-base:20250418_040425 AS stage-build
|
||||
FROM jumpserver/core-base:20250427_062456 AS stage-build
|
||||
|
||||
ARG VERSION
|
||||
|
||||
|
@ -48,12 +48,14 @@ ENV LANG=en_US.UTF-8 \
|
||||
|
||||
ENV UV_LINK_MODE=copy
|
||||
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache \
|
||||
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
||||
--mount=type=bind,source=utils/clean_site_packages.sh,target=clean_site_packages.sh \
|
||||
--mount=type=bind,source=requirements/clean_site_packages.sh,target=clean_site_packages.sh \
|
||||
--mount=type=bind,source=requirements/collections.yml,target=collections.yml \
|
||||
--mount=type=bind,source=requirements/static_files.sh,target=utils/static_files.sh \
|
||||
set -ex \
|
||||
&& uv venv \
|
||||
&& uv pip install -i${PIP_MIRROR} -r pyproject.toml \
|
||||
&& ln -sf $(pwd)/.venv /opt/py3
|
||||
&& ln -sf $(pwd)/.venv /opt/py3 \
|
||||
&& bash utils/static_files.sh \
|
||||
&& bash clean_site_packages.sh
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a2805a0264fc07ae597704841ab060edef8bf74654f525bc778cb9195d8cad0e
|
||||
size 2547712
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:860b4d38beff81667c64da41c026a7dd28c3c93a28ae61fefaa7c26875f35638
|
||||
size 73906864
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c5119fd8911a107a7112422ade326766fe3d9538ac15bca06e3c622191c84e18
|
||||
size 61086554
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b82b874152c798dda407ffe7544e1f5ec67efa1f5c334efc0d3893b8053b4be1
|
||||
size 3649897
|
@ -2,6 +2,11 @@
|
||||
|
||||
lib_path="/opt/py3/lib/python3.11/site-packages"
|
||||
|
||||
if [ ! -d "$lib_path" ]; then
|
||||
echo "lib_path $lib_path not exist"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 清理不需要的模块
|
||||
need_clean="jedi"
|
||||
for i in $need_clean; do
|
@ -4,8 +4,7 @@ $ pip install cryptography --global-option=build_ext --global-option="-L/opt/hom
|
||||
|
||||
|
||||
# Pillow zlib failed
|
||||
|
||||
Reinstall xcode reslove
|
||||
# Reinstall xcode reslove
|
||||
|
||||
$ xcode-select --install
|
||||
|
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
|
||||
|
Loading…
Reference in New Issue
Block a user