Skip to content

Commit

Permalink
ci: output-capture commands ignore stderr
Browse files Browse the repository at this point in the history
Any error should be already printed in the previous dry run
  • Loading branch information
j1elo committed May 22, 2024
1 parent c955122 commit 621a7d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion ci-scripts/kurento_get_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ elif [[ -f pom.xml ]]; then

log "REAL RUN. Suppressing Maven logs, just get the result:" >&2
MAVEN_CMD+=(--quiet)
PROJECT_VERSION="$("${MAVEN_CMD[@]}")" || {
PROJECT_VERSION="$("${MAVEN_CMD[@]}" 2>/dev/null)" || {
log "ERROR: Command failed: mvn echo \${project.version}" >&2
exit 1
}
Expand Down
30 changes: 14 additions & 16 deletions ci-scripts/kurento_maven_deploy_github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,20 @@ mvn "${MVN_ARGS[@]}" install || {
}

# For each submodule, go into its path and delete the current GitHub version.
MVN_DIRS=()
{
MAVEN_CMD=(mvn "${MVN_ARGS[@]}" exec:exec -Dexec.executable=pwd)

# 2024-05-22: This command was failing on CI, and errors were suppressed.
# Adding an initial dry run, to be able to see errors in the output logs.
log "DRY RUN. Showing Maven logs:"
"${MAVEN_CMD[@]}"

log "REAL RUN. Suppressing Maven logs, just get the result:"
MAVEN_CMD+=(--quiet)
# shellcheck disable=SC2207
MVN_DIRS=($("${MAVEN_CMD[@]}")) || {
log "ERROR: Command failed: mvn exec pwd"
exit 1
}
MAVEN_CMD=(mvn "${MVN_ARGS[@]}" exec:exec -Dexec.executable=pwd)

# 2024-05-22: This command was failing on CI, and errors were suppressed.
# Use an initial dry run, to be able to see errors in the output logs.
log "DRY RUN. Showing Maven logs:"
"${MAVEN_CMD[@]}"

log "REAL RUN. Suppressing Maven logs, just get the result:"
MAVEN_CMD+=(--quiet)

# shellcheck disable=SC2207
MVN_DIRS=($("${MAVEN_CMD[@]}" 2>/dev/null)) || {
log "ERROR: Command failed: mvn exec pwd"
exit 1
}

for MVN_DIR in "${MVN_DIRS[@]}"; do
Expand Down

0 comments on commit 621a7d6

Please sign in to comment.