Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: 离线镜像校验 #378

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ $ ./jmsctl.sh tail
[root@localhost config]# tree .
.
├── config.txt # 主配置文件
├── core
│ └── config.yml # core yml 格式配置文件,可以留空,使用 config.txt 设置
├── koko
│ └── config.yml # koko yml 格式配置文件,可以留空,使用 config.txt 设置
├── mysql
│ └── my.cnf # mysql 配置文件
|── mariadb
Expand Down
1 change: 0 additions & 1 deletion compose/docker-compose-celery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ services:
env_file:
- ${CONFIG_FILE}
volumes:
- ${CONFIG_DIR}/core/config.yml:/opt/jumpserver/config.yml
- ${CONFIG_DIR}/certs:/opt/jumpserver/data/certs
- ${VOLUME_DIR}/core/data:/opt/jumpserver/data
healthcheck:
Expand Down
1 change: 0 additions & 1 deletion compose/docker-compose-init-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ services:
env_file:
- ${CONFIG_FILE}
volumes:
- ${CONFIG_DIR}/core/config.yml:/opt/jumpserver/config.yml
- ${CONFIG_DIR}/certs:/opt/jumpserver/data/certs
- ${VOLUME_DIR}/core/data:/opt/jumpserver/data
networks:
Expand Down
31 changes: 30 additions & 1 deletion scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -651,13 +651,42 @@ function pull_image() {
echo ""
}

function check_images() {
images_to=$(get_images)
failed=0

for image in ${images_to}; do
if ! docker image inspect -f '{{ .Id }}' "$image" &> /dev/null; then
pull_image "$image"
fi
done
for image in ${images_to}; do
if ! docker image inspect -f '{{ .Id }}' "$image" &> /dev/null; then
echo_red "$(gettext 'Failed to pull image') ${image}"
failed=1
fi
done

if [ $failed -eq 1 ]; then
exit 1
fi
}

function pull_images() {
images_to=$(get_images)
pids=()

trap 'kill ${pids[*]}' SIGINT SIGTERM

for image in ${images_to}; do
pull_image "$image" &
pids+=($!)
done
wait
wait ${pids[*]}

trap - SIGINT SIGTERM

check_images
}

function installation_log() {
Expand Down