Spacing for readability

This commit is contained in:
decentral1se 2021-03-16 05:58:08 +01:00
parent 9b90712d28
commit d6caf03301
Signed by untrusted user who does not match committer: decentral1se
GPG Key ID: 92DAD76BD9567B8A

6
abra
View File

@ -495,18 +495,24 @@ load_abra_sh() {
output_version_summary() { output_version_summary() {
echo " Versions:" echo " Versions:"
IFS=':' read -ra COMPOSE_FILES <<< "$COMPOSE_FILE" IFS=':' read -ra COMPOSE_FILES <<< "$COMPOSE_FILE"
for COMPOSE in "${COMPOSE_FILES[@]}"; do for COMPOSE in "${COMPOSE_FILES[@]}"; do
SERVICES=$($YQ e '.services | keys | .[]' "${APP_DIR}/${COMPOSE}") SERVICES=$($YQ e '.services | keys | .[]' "${APP_DIR}/${COMPOSE}")
for SERVICE in $SERVICES; do for SERVICE in $SERVICES; do
filter="{{index .Spec.Labels \"coop-cloud.$STACK_NAME.$SERVICE.version\" }}" filter="{{index .Spec.Labels \"coop-cloud.$STACK_NAME.$SERVICE.version\" }}"
label=$(docker service inspect -f "$filter" "${STACK_NAME}_${SERVICE}" 2>/dev/null) label=$(docker service inspect -f "$filter" "${STACK_NAME}_${SERVICE}" 2>/dev/null)
live_version=$(echo "$label" | cut -d- -f1) live_version=$(echo "$label" | cut -d- -f1)
live_digest=$(echo "$label" | cut -d- -f2) live_digest=$(echo "$label" | cut -d- -f2)
if [ -n "$live_version" ] && [ -n "$live_digest" ]; then if [ -n "$live_version" ] && [ -n "$live_digest" ]; then
image=$($YQ e ".services.${SERVICE}.image" "${APP_DIR}/${COMPOSE}" | cut -d':' -f1) image=$($YQ e ".services.${SERVICE}.image" "${APP_DIR}/${COMPOSE}" | cut -d':' -f1)
echo " ${STACK_NAME}_${SERVICE} (${image}):" echo " ${STACK_NAME}_${SERVICE} (${image}):"
echo " deployed: $(tput setaf 2)$live_version ($live_digest)$(tput sgr0)" echo " deployed: $(tput setaf 2)$live_version ($live_digest)$(tput sgr0)"
app_version_lookup="ABRA_TYPE_${SERVICE^^}_VERSION" app_version_lookup="ABRA_TYPE_${SERVICE^^}_VERSION"
app_version=${!app_version_lookup} app_version=${!app_version_lookup}
app_digest_lookup="ABRA_TYPE_${SERVICE^^}_DIGEST" app_digest_lookup="ABRA_TYPE_${SERVICE^^}_DIGEST"