Skip to content

Commit

Permalink
Merge pull request #1134 from tscuite/main
Browse files Browse the repository at this point in the history
feat: add images updaterecord
  • Loading branch information
tscuite committed Nov 21, 2022
2 parents 15ca625 + e67cda1 commit 23606d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions deploy/docker-compose/dtctl
Original file line number Diff line number Diff line change
Expand Up @@ -1166,9 +1166,6 @@ if [ ! 0 == $# ]; then # If options provided then
}

function execute_update() {
# extract sql name and reverse list

SQL_NAMES=$(cat updaterecord.txt | awk "/${TO_VERSION//./\\.}/,/${FROM_VERSION//./\\.}/ {print \$2}" | grep -vF "$FROM_VERSION" | awk "{array[NR]=\$0} END { for(i=NR;i>0;i--) {print array[i];} }")
mysql_container_id=$(get_mysql_container_id)
server_container_id=$(get_server_container_id)
# check whether mysql is ready
Expand All @@ -1181,6 +1178,11 @@ if [ ! 0 == $# ]; then # If options provided then
fi
sleep 2
done
# extract sql name and reverse list
SQL_NAMES=$(cat updaterecord.txt | awk "/${TO_VERSION//./\\.}/,/${FROM_VERSION//./\\.}/ {print \$2}" | grep -vF "$FROM_VERSION" | awk "{array[NR]=\$0} END { for(i=NR;i>0;i--) {print array[i];} }")
if [[ $(first_gt_second $TO_VERSION 1.9.0) == true ]]; then
SQL_NAMES=$(docker exec -i $mysql_container_id /bin/bash -c "cat /schema/updaterecord.txt" | awk "/${TO_VERSION//./\\.}/,/${FROM_VERSION//./\\.}/ {print \$2}" | grep -vF "$FROM_VERSION" | awk "{array[NR]=\$0} END { for(i=NR;i>0;i--) {print array[i];} }")
fi

# change sql store directory from /docker-entrypoint-initdb.d to /sql
# from 1.3.0
Expand Down
7 changes: 4 additions & 3 deletions deploy/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ elif [ "$1" = "worker-sca" ]; then
elif [ "$1" = "worker-other" ]; then
celery -A dongtai_conf worker -l info -X dongtai-periodic-task,dongtai-method-pool-scan,dongtai-replay-vul-scan,dongtai-sca-task $DONGTAI_CONCURRENCY -E --pidfile=
elif [ "$1" = "beat" ]; then
celery -A dongtai_conf beat -l info $DONGTAI_CONCURRENCY --pidfile= --scheduler django_celery_beat.schedulers:DatabaseScheduler
celery -A dongtai_conf beat -l info $DONGTAI_CONCURRENCY --pidfile= --scheduler django_celery_beat.schedulers:DatabaseScheduler
else
echo "Get the latest vulnerability rules ."; python manage.py load_hook_strategy 2> /dev/null || echo "Lost connection to MySQL server !!!"; exit 1
echo "Get the latest vulnerability rules." && python manage.py load_hook_strategy 2> /dev/null
if [ $? -ne 0 ]; then echo "ERROR: Lost connection to MySQL server !!!" && exit 1 ; else echo "succeed" ;fi
/usr/local/bin/uwsgi --ini /opt/dongtai/dongtai_conf/conf/uwsgi.ini $DONGTAI_CONCURRENCY
fi
fi

0 comments on commit 23606d0

Please sign in to comment.