ci(log): write per-image logs to log/ci/ and summary.txt
This commit is contained in:
parent
b926417227
commit
22ace2a948
@ -25,6 +25,12 @@ if [ ! -f .gitmodules ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Prépare le répertoire de logs
|
||||||
|
LOG_DIR="log/ci/${DOCKER_TAG}"
|
||||||
|
mkdir -p "${LOG_DIR}"
|
||||||
|
SUMMARY_FILE="${LOG_DIR}/summary.txt"
|
||||||
|
: > "${SUMMARY_FILE}"
|
||||||
|
|
||||||
# Parcourt les submodules déclarés
|
# Parcourt les submodules déclarés
|
||||||
mapfile -t submodules < <(git config -f .gitmodules --name-only --get-regexp 'submodule\..*\.path' | sed -E 's/\.path$//')
|
mapfile -t submodules < <(git config -f .gitmodules --name-only --get-regexp 'submodule\..*\.path' | sed -E 's/\.path$//')
|
||||||
|
|
||||||
@ -51,14 +57,27 @@ for name in "${submodules[@]}"; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[docker] build ${full_ref} depuis ${path} (branche ${branch})"
|
log_file="${LOG_DIR}/$(basename "${path}").log"
|
||||||
docker buildx build \
|
echo "[docker] build ${full_ref} depuis ${path} (branche ${branch}) | log: ${log_file}"
|
||||||
--pull \
|
{
|
||||||
--tag "${full_ref}" \
|
echo "== BUILD ${full_ref} =="
|
||||||
"${path}"
|
date -Is
|
||||||
|
docker buildx build \
|
||||||
|
--pull \
|
||||||
|
--progress=plain \
|
||||||
|
--tag "${full_ref}" \
|
||||||
|
"${path}"
|
||||||
|
} 2>&1 | tee -a "${log_file}"
|
||||||
|
|
||||||
echo "[docker] push ${full_ref}"
|
echo "[docker] push ${full_ref} | log: ${log_file}"
|
||||||
docker push "${full_ref}"
|
{
|
||||||
|
echo "== PUSH ${full_ref} =="
|
||||||
|
date -Is
|
||||||
|
docker push "${full_ref}"
|
||||||
|
} 2>&1 | tee -a "${log_file}"
|
||||||
|
|
||||||
|
echo "${full_ref} ${log_file}" >> "${SUMMARY_FILE}"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "[docker] terminé"
|
echo "[docker] terminé"
|
||||||
|
echo "[docker] récapitulatif: ${SUMMARY_FILE}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user