Browse Source

fix: dev: multiple typos corrected, an export on ``relation-target-compose-get`` fixed.

raw-remaining-args
Valentin Lab 9 years ago
parent
commit
9d55b35f44
  1. 18
      bin/compose

18
bin/compose

@ -259,7 +259,7 @@ export -f yaml_key_val_str
docker_has_image() { docker_has_image() {
local image="$1" local image="$1"
images=$(docker images -q "$image" 2>/dev/null) || { images=$(docker images -q "$image" 2>/dev/null) || {
err "docker images call has failled unexpectedly."
err "docker images call has failed unexpectedly."
return 1 return 1
} }
[ "$images" ] [ "$images" ]
@ -427,7 +427,7 @@ are_files_locked_in_dir() {
found=1 found=1
break break
fi fi
done < <(cat /proc/locks | grep " $hdev:$ldev:" | sed -r "s/^.*$hdev:$ldev:([0-9]+).*$/\1/g")
done < <(cat /proc/locks | grep " $hdev:$ldev:" | sed -r "s/^.*$hdev:$ldev:([0-9]+).*$/\1/g")
[ "$found" ] [ "$found" ]
} }
@ -787,7 +787,7 @@ get_docker_compose () {
declare -A entries declare -A entries
start_compilation=$SECONDS start_compilation=$SECONDS
debug "Compiling 'docker-compose.conf' base for $DARKYELLOW$@$NORMAL..."
debug "Compiling 'docker-compose.yml' base for $DARKYELLOW$@$NORMAL..."
for target_service in "$@"; do for target_service in "$@"; do
start=$SECONDS start=$SECONDS
services=$(get_ordered_service_dependencies "$target_service") || return 1 services=$(get_ordered_service_dependencies "$target_service") || return 1
@ -813,8 +813,8 @@ get_docker_compose () {
merge_yaml_str "${entries[@]}" > "$cache_file" merge_yaml_str "${entries[@]}" > "$cache_file"
export _current_docker_compose="$(cat "$cache_file")" export _current_docker_compose="$(cat "$cache_file")"
echo "$_current_docker_compose" echo "$_current_docker_compose"
debug " ..compilation of base 'docker-compose.conf' done $GRAY(in $((SECONDS - start_compilation))s)$NORMAL" || true
# debug " ** ${WHITE}docker-compose.conf${NORMAL}:"
debug " ..compilation of base 'docker-compose.yml' done $GRAY(in $((SECONDS - start_compilation))s)$NORMAL" || true
# debug " ** ${WHITE}docker-compose.yml${NORMAL}:"
# debug "$_current_docker_compose" # debug "$_current_docker_compose"
} }
export -f get_docker_compose export -f get_docker_compose
@ -893,7 +893,7 @@ get_service_def () {
def=$(echo "$_current_docker_compose" | shyaml get-value "$service" 2>/dev/null) def=$(echo "$_current_docker_compose" | shyaml get-value "$service" 2>/dev/null)
if [ -z "$def" ]; then if [ -z "$def" ]; then
err "No definition for service $DARKYELLOW$service$NORMAL in compiled 'docker-compose.conf'."
err "No definition for service $DARKYELLOW$service$NORMAL in compiled 'docker-compose.yml'."
return 1 return 1
fi fi
echo "$def" echo "$def"
@ -1019,7 +1019,7 @@ _rec_get_depth() {
#debug "Requesting depth[$dep]" #debug "Requesting depth[$dep]"
if (( ${depths[$dep]} > max )); then if (( ${depths[$dep]} > max )); then
max="${depths[$dep]}" max="${depths[$dep]}"
fi
fi
done done
# debug "Setting depth[$elt] to $((max + 1))" # debug "Setting depth[$elt] to $((max + 1))"
depths[$elt]=$((max + 1)) depths[$elt]=$((max + 1))
@ -1134,7 +1134,7 @@ relation-target-compose-get () {
return 1 return 1
fi fi
} }
export -f relation-base-compose-get
export -f relation-target-compose-get
relation-set () { relation-set () {
@ -2213,7 +2213,7 @@ esac
get_docker_compose $services >/dev/null || { ## precalculate variable \$_current_docker_compose get_docker_compose $services >/dev/null || { ## precalculate variable \$_current_docker_compose
err "Fails to compile base 'docker-compose.conf'"
err "Fails to compile base 'docker-compose.yml'"
exit 1 exit 1
} }

Loading…
Cancel
Save