Skip to content

Commit

Permalink
[OPENJDK-2427] s2i: use --archive flag for rsync
Browse files Browse the repository at this point in the history
Switch from '-rl' to '--archive' which attempts to preserve as much
metadata from the source files as possible, including timestamps, the
motivation behind OPENJDK-2427.

https://issues.redhat.com/browse/OPENJDK-2427

Signed-off-by: Jonathan Dowland <[email protected]>
  • Loading branch information
jmtd committed Feb 13, 2024
1 parent dd57504 commit 9589e54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function maven_s2i_custom_binary_build() {
binary_dir="${S2I_SOURCE_DIR}"
fi
log_info "Copying binaries from ${binary_dir} to ${S2I_TARGET_DEPLOYMENTS_DIR} ..."
rsync -rl --out-format='%n' "${binary_dir}"/ "${S2I_TARGET_DEPLOYMENTS_DIR}"
rsync --archive --out-format='%n' "${binary_dir}"/ "${S2I_TARGET_DEPLOYMENTS_DIR}"
}

function maven_s2i_deploy_artifacts_override() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function s2i_core_copy_configuration() {
mkdir -pm 775 "${S2I_TARGET_CONFIGURATION_DIR}"
fi
log_info "Copying configuration from $(realpath --relative-to ${S2I_SOURCE_DIR} ${1}/${S2I_SOURCE_CONFIGURATION_DIR}) to ${S2I_TARGET_CONFIGURATION_DIR}..."
rsync -rl --out-format='%n' "${1}/${S2I_SOURCE_CONFIGURATION_DIR}"/ "${S2I_TARGET_CONFIGURATION_DIR}"
rsync --archive --out-format='%n' "${1}/${S2I_SOURCE_CONFIGURATION_DIR}"/ "${S2I_TARGET_CONFIGURATION_DIR}"
fi
fi
}
Expand All @@ -81,7 +81,7 @@ function s2i_core_copy_data() {
mkdir -pm 775 "${S2I_TARGET_DATA_DIR}"
fi
log_info "Copying app data from $(realpath --relative-to ${S2I_SOURCE_DIR} ${1}/${S2I_SOURCE_DATA_DIR}) to ${S2I_TARGET_DATA_DIR}..."
rsync -rl --out-format='%n' "${1}/${S2I_SOURCE_DATA_DIR}"/ "${S2I_TARGET_DATA_DIR}"
rsync --archive --out-format='%n' "${1}/${S2I_SOURCE_DATA_DIR}"/ "${S2I_TARGET_DATA_DIR}"
# s2i used to be more forgiving, but the build will fail if this call
# fails. emit a warning and allow the build to succeed
chmod -R g+rwX "${S2I_TARGET_DATA_DIR}" || log_warning "Errors occurred while adding read/write permissions to S2I_TARGET_DATA_DIR ($S2I_TARGET_DATA_DIR)."
Expand Down

0 comments on commit 9589e54

Please sign in to comment.