Compare commits
2 Commits
v1.8.4.fx2
...
v1.8.5.fx1
| Author | SHA1 | Date | |
|---|---|---|---|
| 80a6ffeb18 | |||
| e7c02587c2 |
@@ -1,6 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
usage() {
|
||||
echo -n "Usage: ${0} <RootDir>"
|
||||
echo
|
||||
@@ -49,7 +48,7 @@ build_docker_image() {
|
||||
image_version=$(get_latest_dist_version ${project})
|
||||
if [ -z "${image_version}" ]; then
|
||||
echo "No latest version found for ${project}"
|
||||
exit 1
|
||||
return
|
||||
fi
|
||||
echo "Latest version is ${image_version}"
|
||||
|
||||
@@ -103,11 +102,12 @@ build_docker_image() {
|
||||
Cmd="rm -rf ${RootDir}/${project}"
|
||||
echo ${Cmd}
|
||||
eval ${Cmd}
|
||||
|
||||
print_all_reg_images ${project}
|
||||
}
|
||||
|
||||
convert_symlink_to_dir() {
|
||||
project=${1}
|
||||
echo "***** DEBUG 1 $(ls -l ${RootDir}/${project})"
|
||||
if [ -L ${RootDir}/${project} ]; then
|
||||
echo "Converting symlink ${RootDir}/${project} to directory"
|
||||
|
||||
@@ -124,7 +124,6 @@ convert_symlink_to_dir() {
|
||||
fi
|
||||
Cmd="rm ${RootDir}/${project}.symlink"
|
||||
echo ${Cmd} && eval ${Cmd}
|
||||
echo "***** DEBUG 2 $(ls -l ${RootDir}/${project})"
|
||||
}
|
||||
|
||||
image_exists() {
|
||||
@@ -141,10 +140,8 @@ image_exists() {
|
||||
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[]')
|
||||
@@ -178,19 +175,21 @@ eval ${Cmd}
|
||||
|
||||
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
|
||||
title=$(echo "$item" | jq -r '.key')
|
||||
image_name=$(echo "$item" | jq -r '.value.image_name')
|
||||
docker_dev_path=$(echo "$item" | jq -r '.value.docker_dev_path')
|
||||
project=$(echo "$item" | jq -r '.value.based_on_project')
|
||||
|
||||
build_docker_image "$title" "$image_name" "$docker_dev_path" "$project"
|
||||
done
|
||||
|
||||
Cmd="docker images"
|
||||
echo ${Cmd}
|
||||
eval ${Cmd}
|
||||
|
||||
Cmd="rm -rf ${RootDir}/docker_dev"
|
||||
echo ${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