This commit is contained in:
Oleg Sheynin 2024-11-02 17:54:16 -04:00
parent 36d6914c8c
commit cc2c07741a
2 changed files with 31 additions and 4 deletions

View File

@ -107,20 +107,24 @@ build_docker_image() {
convert_symlink_to_dir() { convert_symlink_to_dir() {
project=${1} project=${1}
echo "***** DEBUG 1 $(ls -l ${RootDir}/${project})"
if [ -L ${RootDir}/${project} ]; then if [ -L ${RootDir}/${project} ]; then
echo "Converting symlink ${RootDir}/${project} to directory" echo "Converting symlink ${RootDir}/${project} to directory"
Cmd="mv ${RootDir}/${project} ${RootDir}/${project}.symlink" Cmd="mv ${RootDir}/${project} ${RootDir}/${project}.symlink"
echo ${Cmd} && eval ${Cmd} echo ${Cmd} && eval ${Cmd}
Cmd="cp -r ${RootDir}/${project}.symlink ${RootDir}/${project}" src_path=$(readlink -f ${RootDir}/${project}.symlink)
Cmd="cp -r ${src_path} ${RootDir}/${project}"
echo ${Cmd} && eval ${Cmd} echo ${Cmd} && eval ${Cmd}
fi fi
if [ -D ${project} ]; then if [ -d ${project} ]; then
echo "${RootDir}/${project} is a Directory" echo "${RootDir}/${project} is a Directory"
fi fi
Cmd="rm ${RootDir}/${project}.symlink" Cmd="rm ${RootDir}/${project}.symlink"
echo ${Cmd} && eval ${Cmd} echo ${Cmd} && eval ${Cmd}
echo "***** DEBUG 2 $(ls -l ${RootDir}/${project})"
} }
image_exists() { image_exists() {
@ -134,6 +138,28 @@ image_exists() {
fi fi
} }
print_all_reg_images() {
project=${1}
# Fetch all repositories (images) from the registry
repositories=$(curl -s "${RegistryProtocol}://${RegistryService}/v2/_catalog" | jq -r '.repositories[]')
# Iterate over each repository to get its tags
for repo in $repositories; do
# Fetch all tags for the repository
tags=$(curl -s "${RegistryProtocol}://${RegistryService}/v2/$repo/tags/list" | jq -r '.tags[]')
# List each tag
for tag in $tags; do
if [ "${project}" == "" ];then
echo "$repo:$tag"
else
echo "$repo:$tag" | grep ${project}
fi
done
done
}
get_latest_dist_version() { get_latest_dist_version() {
project=${1} project=${1}
@ -150,6 +176,8 @@ Cmd="${SetVersionScript} docker_dev latest"
echo ${Cmd} echo ${Cmd}
eval ${Cmd} eval ${Cmd}
convert_symlink_to_dir docker_dev
echo "${DIMAGES_CONFIG}" | jq -c 'to_entries[]' | while IFS= read -r item; do echo "${DIMAGES_CONFIG}" | jq -c 'to_entries[]' | while IFS= read -r item; do
# Extract key (name) and values # Extract key (name) and values
title=$(echo "$item" | jq -r '.key') title=$(echo "$item" | jq -r '.key')
@ -169,4 +197,3 @@ eval ${Cmd}
#=============================================================================== #===============================================================================
#=============================================================================== #===============================================================================

View File

@ -1 +1 @@
1.8.4.fx1,initial version of docker_image_builder.sh 1.8.4.fx2,initial version of docker_image_builder.sh