Skip to content

Commit da712f3

Browse files
authored
Merge pull request #444 from jmtd/OPENJDK-2427-rsync-preserve-ubi8
Openjdk 2427 rsync preserve ubi8
2 parents 749bb3f + 17e0d3e commit da712f3

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

modules/s2i/bash/artifacts/opt/jboss/container/java/s2i/maven-s2i-overrides

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function maven_s2i_custom_binary_build() {
2828
binary_dir="${S2I_SOURCE_DIR}"
2929
fi
3030
log_info "Copying binaries from ${binary_dir} to ${S2I_TARGET_DEPLOYMENTS_DIR} ..."
31-
rsync -rl --out-format='%n' "${binary_dir}"/ "${S2I_TARGET_DEPLOYMENTS_DIR}"
31+
rsync --archive --out-format='%n' "${binary_dir}"/ "${S2I_TARGET_DEPLOYMENTS_DIR}"
3232
}
3333

3434
function maven_s2i_deploy_artifacts_override() {

modules/s2i/core/bash/artifacts/opt/jboss/container/s2i/core/s2i-core

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function s2i_core_copy_configuration() {
6464
mkdir -pm 775 "${S2I_TARGET_CONFIGURATION_DIR}"
6565
fi
6666
log_info "Copying configuration from $(realpath --relative-to ${S2I_SOURCE_DIR} ${1}/${S2I_SOURCE_CONFIGURATION_DIR}) to ${S2I_TARGET_CONFIGURATION_DIR}..."
67-
rsync -rl --out-format='%n' "${1}/${S2I_SOURCE_CONFIGURATION_DIR}"/ "${S2I_TARGET_CONFIGURATION_DIR}"
67+
rsync --archive --out-format='%n' "${1}/${S2I_SOURCE_CONFIGURATION_DIR}"/ "${S2I_TARGET_CONFIGURATION_DIR}"
6868
fi
6969
fi
7070
}
@@ -81,7 +81,7 @@ function s2i_core_copy_data() {
8181
mkdir -pm 775 "${S2I_TARGET_DATA_DIR}"
8282
fi
8383
log_info "Copying app data from $(realpath --relative-to ${S2I_SOURCE_DIR} ${1}/${S2I_SOURCE_DATA_DIR}) to ${S2I_TARGET_DATA_DIR}..."
84-
rsync -rl --out-format='%n' "${1}/${S2I_SOURCE_DATA_DIR}"/ "${S2I_TARGET_DATA_DIR}"
84+
rsync --archive --out-format='%n' "${1}/${S2I_SOURCE_DATA_DIR}"/ "${S2I_TARGET_DATA_DIR}"
8585
# s2i used to be more forgiving, but the build will fail if this call
8686
# fails. emit a warning and allow the build to succeed
8787
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)."

tests/features/java/java_s2i.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,9 @@ Feature: Openshift OpenJDK S2I tests
331331
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from OPENJDK-1549 with env
332332
| variable | value |
333333
| MAVEN_ARGS | validate |
334+
335+
Scenario: Ensure mtime is preserved for build artifacts (OPENJDK-2427)
336+
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from OPENJDK-2408-bin-custom-s2i-assemble with env
337+
| variable | value |
338+
| S2I_DELETE_SOURCE | false |
339+
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 commit comments

Comments
 (0)