Compare commits
2 Commits
v1.8.4.fx2
...
v1.8.5.fx1
| Author | SHA1 | Date | |
|---|---|---|---|
| 80a6ffeb18 | |||
| e7c02587c2 |
@@ -1,6 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo -n "Usage: ${0} <RootDir>"
|
echo -n "Usage: ${0} <RootDir>"
|
||||||
echo
|
echo
|
||||||
@@ -49,7 +48,7 @@ build_docker_image() {
|
|||||||
image_version=$(get_latest_dist_version ${project})
|
image_version=$(get_latest_dist_version ${project})
|
||||||
if [ -z "${image_version}" ]; then
|
if [ -z "${image_version}" ]; then
|
||||||
echo "No latest version found for ${project}"
|
echo "No latest version found for ${project}"
|
||||||
exit 1
|
return
|
||||||
fi
|
fi
|
||||||
echo "Latest version is ${image_version}"
|
echo "Latest version is ${image_version}"
|
||||||
|
|
||||||
@@ -103,11 +102,12 @@ build_docker_image() {
|
|||||||
Cmd="rm -rf ${RootDir}/${project}"
|
Cmd="rm -rf ${RootDir}/${project}"
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
eval ${Cmd}
|
eval ${Cmd}
|
||||||
|
|
||||||
|
print_all_reg_images ${project}
|
||||||
}
|
}
|
||||||
|
|
||||||
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"
|
||||||
|
|
||||||
@@ -124,7 +124,6 @@ convert_symlink_to_dir() {
|
|||||||
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() {
|
||||||
@@ -141,10 +140,8 @@ image_exists() {
|
|||||||
print_all_reg_images() {
|
print_all_reg_images() {
|
||||||
project=${1}
|
project=${1}
|
||||||
|
|
||||||
# Fetch all repositories (images) from the registry
|
|
||||||
repositories=$(curl -s "${RegistryProtocol}://${RegistryService}/v2/_catalog" | jq -r '.repositories[]')
|
repositories=$(curl -s "${RegistryProtocol}://${RegistryService}/v2/_catalog" | jq -r '.repositories[]')
|
||||||
|
|
||||||
# Iterate over each repository to get its tags
|
|
||||||
for repo in $repositories; do
|
for repo in $repositories; do
|
||||||
# Fetch all tags for the repository
|
# Fetch all tags for the repository
|
||||||
tags=$(curl -s "${RegistryProtocol}://${RegistryService}/v2/$repo/tags/list" | jq -r '.tags[]')
|
tags=$(curl -s "${RegistryProtocol}://${RegistryService}/v2/$repo/tags/list" | jq -r '.tags[]')
|
||||||
@@ -178,19 +175,21 @@ eval ${Cmd}
|
|||||||
|
|
||||||
convert_symlink_to_dir docker_dev
|
convert_symlink_to_dir docker_dev
|
||||||
|
|
||||||
echo "${DIMAGES_CONFIG}" | jq -c 'to_entries[]' | while IFS= read -r item; do
|
Jobs=()
|
||||||
|
while IFS= read -r item; do
|
||||||
|
Jobs+=("$item")
|
||||||
|
done < <(echo "${DIMAGES_CONFIG}" | jq -c 'to_entries[]')
|
||||||
|
|
||||||
|
for item in "${Jobs[@]}"; do
|
||||||
# Extract key (name) and values
|
# Extract key (name) and values
|
||||||
title=$(echo "$item" | jq -r '.key')
|
title=$(echo "$item" | jq -r '.key')
|
||||||
image_name=$(echo "$item" | jq -r '.value.image_name')
|
image_name=$(echo "$item" | jq -r '.value.image_name')
|
||||||
docker_dev_path=$(echo "$item" | jq -r '.value.docker_dev_path')
|
docker_dev_path=$(echo "$item" | jq -r '.value.docker_dev_path')
|
||||||
project=$(echo "$item" | jq -r '.value.based_on_project')
|
project=$(echo "$item" | jq -r '.value.based_on_project')
|
||||||
|
|
||||||
build_docker_image "$title" "$image_name" "$docker_dev_path" "$project"
|
build_docker_image "$title" "$image_name" "$docker_dev_path" "$project"
|
||||||
done
|
done
|
||||||
|
|
||||||
Cmd="docker images"
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
Cmd="rm -rf ${RootDir}/docker_dev"
|
Cmd="rm -rf ${RootDir}/docker_dev"
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
eval ${Cmd}
|
eval ${Cmd}
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
1.8.4.fx2,initial version of docker_image_builder.sh
|
1.8.5.fx1,docker_image_builder
|
||||||
|
|||||||
Reference in New Issue
Block a user