Skip to content

Commit

Permalink
ci: mark dry runs as such in the logs
Browse files Browse the repository at this point in the history
  • Loading branch information
j1elo committed May 22, 2024
1 parent 71a03f7 commit c955122
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 4 additions & 2 deletions ci-scripts/kurento_get_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ elif [[ -f pom.xml ]]; then
if [[ -n "${CFG_MAVEN_SETTINGS_PATH:-}" ]]; then
MAVEN_CMD+=(--settings "$CFG_MAVEN_SETTINGS_PATH")
fi
# First run, to log all downloading of dependencies.

log "DRY RUN. Showing Maven logs:" >&2
"${MAVEN_CMD[@]}" >&2
# Second run, suppressing Maven logs to get just the result.

log "REAL RUN. Suppressing Maven logs, just get the result:" >&2
MAVEN_CMD+=(--quiet)
PROJECT_VERSION="$("${MAVEN_CMD[@]}")" || {
log "ERROR: Command failed: mvn echo \${project.version}" >&2
Expand Down
13 changes: 8 additions & 5 deletions ci-scripts/kurento_maven_deploy_github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function delete_github_version {
# But the operation is still successful for our intents. We don't want to be
# deleting and recreating the whole package, only its excess versions.

log "INFO: Successfully deleted version '${PROJECT_NAME}:${PROJECT_VERSION}' from GitHub."
log "INFO: Finished deleting versions of '${PROJECT_NAME}:${PROJECT_VERSION}' from GitHub."
}


Expand All @@ -64,13 +64,16 @@ mvn "${MVN_ARGS[@]}" install || {
MVN_DIRS=()
{
MAVEN_CMD=(mvn "${MVN_ARGS[@]}" exec:exec -Dexec.executable=pwd)
# First run, to log any error that could happen.
# 2024-05-22: This command was failing on CI.

# 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[@]}"
# Second run, suppressing Maven logs to get just the result.

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

0 comments on commit c955122

Please sign in to comment.