Skip to content

Commit

Permalink
Merge pull request #444 from jmtd/OPENJDK-2427-rsync-preserve-ubi8
Browse files Browse the repository at this point in the history
Openjdk 2427 rsync preserve ubi8
  • Loading branch information
jmtd authored Feb 14, 2024
2 parents 749bb3f + 17e0d3e commit da712f3
Show file tree
Hide file tree
Showing 3 changed files with 9 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
6 changes: 6 additions & 0 deletions tests/features/java/java_s2i.feature
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,9 @@ Feature: Openshift OpenJDK S2I tests
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from OPENJDK-1549 with env
| variable | value |
| MAVEN_ARGS | validate |

Scenario: Ensure mtime is preserved for build artifacts (OPENJDK-2427)
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from OPENJDK-2408-bin-custom-s2i-assemble with env
| variable | value |
| S2I_DELETE_SOURCE | false |
Then run find /deployments/spring-boot-sample-simple-1.5.0.BUILD-SNAPSHOT.jar ! -newer /tmp/src/spring-boot-sample-simple-1.5.0.BUILD-SNAPSHOT.jar in container and check its output for spring-boot-sample-simple-1.5.0.BUILD-SNAPSHOT.jar

0 comments on commit da712f3

Please sign in to comment.