From f5b01e89cda0b3658e4e32572c9494a973fe28a1 Mon Sep 17 00:00:00 2001 From: Jerome Prinet Date: Mon, 25 Apr 2022 12:06:02 +0200 Subject: [PATCH 1/4] Add symbolic link to latest run Signed-off-by: Jerome Prinet --- .../scripts/gradle/01-validate-incremental-building.sh | 4 ++++ .../02-validate-local-build-caching-same-location.sh | 4 ++++ .../03-validate-local-build-caching-different-locations.sh | 4 ++++ .../gradle/04-validate-remote-build-caching-ci-ci.sh | 4 ++++ .../gradle/05-validate-remote-build-caching-ci-local.sh | 4 ++++ components/scripts/lib/init.sh | 7 +++++++ .../maven/01-validate-local-build-caching-same-location.sh | 4 ++++ .../02-validate-local-build-caching-different-locations.sh | 4 ++++ .../maven/03-validate-remote-build-caching-ci-ci.sh | 4 ++++ .../maven/04-validate-remote-build-caching-ci-local.sh | 4 ++++ 10 files changed, 43 insertions(+) diff --git a/components/scripts/gradle/01-validate-incremental-building.sh b/components/scripts/gradle/01-validate-incremental-building.sh index a7427a92..7ab141b8 100755 --- a/components/scripts/gradle/01-validate-incremental-building.sh +++ b/components/scripts/gradle/01-validate-incremental-building.sh @@ -64,6 +64,8 @@ execute() { print_bl print_summary + + create_alias_latest } wizard_execute() { @@ -105,6 +107,8 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary + + create_alias_latest } execute_first_build() { diff --git a/components/scripts/gradle/02-validate-local-build-caching-same-location.sh b/components/scripts/gradle/02-validate-local-build-caching-same-location.sh index 0a16732a..1ba5bdf1 100755 --- a/components/scripts/gradle/02-validate-local-build-caching-same-location.sh +++ b/components/scripts/gradle/02-validate-local-build-caching-same-location.sh @@ -65,6 +65,8 @@ execute() { print_bl print_summary + + create_alias_latest } wizard_execute() { @@ -107,6 +109,8 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary + + create_alias_latest } execute_first_build() { diff --git a/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh b/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh index 76768fdd..5a431396 100755 --- a/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh +++ b/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh @@ -66,6 +66,8 @@ execute() { print_bl print_summary + + create_alias_latest } wizard_execute() { @@ -111,6 +113,8 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary + + create_alias_latest } execute_first_build() { diff --git a/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh b/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh index 156da625..58b88c9e 100755 --- a/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh +++ b/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh @@ -59,6 +59,8 @@ execute() { print_bl print_summary + + create_alias_latest } wizard_execute() { @@ -101,6 +103,8 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary + + create_alias_latest } validate_required_args() { diff --git a/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh b/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh index d24aeda8..70e744f8 100755 --- a/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh +++ b/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh @@ -67,6 +67,8 @@ execute() { print_bl print_summary + + create_alias_latest } wizard_execute() { @@ -128,6 +130,8 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary + + create_alias_latest } process_script_arguments() { diff --git a/components/scripts/lib/init.sh b/components/scripts/lib/init.sh index e311d44d..e71280b7 100644 --- a/components/scripts/lib/init.sh +++ b/components/scripts/lib/init.sh @@ -6,6 +6,13 @@ make_experiment_dir() { rm -f "${BUILD_SCAN_FILE}" } +create_alias_latest() { + LINK_NAME="$(dirname "${EXP_DIR}")/latest" + readonly LINK_NAME + rm -f "${LINK_NAME}" > /dev/null 2>&1 + ln -s "${EXP_DIR}" "${LINK_NAME}" > /dev/null 2>&1 +} + generate_run_id() { printf '%x' "$(date +%s)" } diff --git a/components/scripts/maven/01-validate-local-build-caching-same-location.sh b/components/scripts/maven/01-validate-local-build-caching-same-location.sh index dc42079a..d70fada1 100755 --- a/components/scripts/maven/01-validate-local-build-caching-same-location.sh +++ b/components/scripts/maven/01-validate-local-build-caching-same-location.sh @@ -65,6 +65,8 @@ execute() { print_bl print_summary + + create_alias_latest } wizard_execute() { @@ -107,6 +109,8 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary + + create_alias_latest } execute_first_build() { diff --git a/components/scripts/maven/02-validate-local-build-caching-different-locations.sh b/components/scripts/maven/02-validate-local-build-caching-different-locations.sh index 19a7fa89..1b799380 100755 --- a/components/scripts/maven/02-validate-local-build-caching-different-locations.sh +++ b/components/scripts/maven/02-validate-local-build-caching-different-locations.sh @@ -65,6 +65,8 @@ execute() { print_bl print_summary + + create_alias_latest } wizard_execute() { @@ -110,6 +112,8 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary + + create_alias_latest } execute_first_build() { diff --git a/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh b/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh index 5b360b4e..95d0ef1c 100755 --- a/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh +++ b/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh @@ -57,6 +57,8 @@ execute() { print_bl print_summary + + create_alias_latest } wizard_execute() { @@ -99,6 +101,8 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary + + create_alias_latest } validate_required_args() { diff --git a/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh b/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh index 7c6f78f7..7c6815cf 100755 --- a/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh +++ b/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh @@ -66,6 +66,8 @@ execute() { print_bl print_summary + + create_alias_latest } wizard_execute() { @@ -127,6 +129,8 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary + + create_alias_latest } process_script_arguments() { From 839d6c635fc266e8b7be968c9e6aa73bb43b4fc2 Mon Sep 17 00:00:00 2001 From: Jerome Prinet Date: Tue, 26 Apr 2022 10:03:04 +0200 Subject: [PATCH 2/4] CR follow-up: move call to make_experiment_dir Signed-off-by: Jerome Prinet --- components/scripts/gradle/01-validate-incremental-building.sh | 4 ---- .../gradle/02-validate-local-build-caching-same-location.sh | 4 ---- .../03-validate-local-build-caching-different-locations.sh | 4 ---- .../scripts/gradle/04-validate-remote-build-caching-ci-ci.sh | 4 ---- .../gradle/05-validate-remote-build-caching-ci-local.sh | 4 ---- components/scripts/lib/init.sh | 4 +++- .../maven/01-validate-local-build-caching-same-location.sh | 4 ---- .../02-validate-local-build-caching-different-locations.sh | 4 ---- .../scripts/maven/03-validate-remote-build-caching-ci-ci.sh | 4 ---- .../maven/04-validate-remote-build-caching-ci-local.sh | 4 ---- 10 files changed, 3 insertions(+), 37 deletions(-) diff --git a/components/scripts/gradle/01-validate-incremental-building.sh b/components/scripts/gradle/01-validate-incremental-building.sh index 7ab141b8..a7427a92 100755 --- a/components/scripts/gradle/01-validate-incremental-building.sh +++ b/components/scripts/gradle/01-validate-incremental-building.sh @@ -64,8 +64,6 @@ execute() { print_bl print_summary - - create_alias_latest } wizard_execute() { @@ -107,8 +105,6 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary - - create_alias_latest } execute_first_build() { diff --git a/components/scripts/gradle/02-validate-local-build-caching-same-location.sh b/components/scripts/gradle/02-validate-local-build-caching-same-location.sh index 1ba5bdf1..0a16732a 100755 --- a/components/scripts/gradle/02-validate-local-build-caching-same-location.sh +++ b/components/scripts/gradle/02-validate-local-build-caching-same-location.sh @@ -65,8 +65,6 @@ execute() { print_bl print_summary - - create_alias_latest } wizard_execute() { @@ -109,8 +107,6 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary - - create_alias_latest } execute_first_build() { diff --git a/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh b/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh index 5a431396..76768fdd 100755 --- a/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh +++ b/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh @@ -66,8 +66,6 @@ execute() { print_bl print_summary - - create_alias_latest } wizard_execute() { @@ -113,8 +111,6 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary - - create_alias_latest } execute_first_build() { diff --git a/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh b/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh index 58b88c9e..156da625 100755 --- a/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh +++ b/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh @@ -59,8 +59,6 @@ execute() { print_bl print_summary - - create_alias_latest } wizard_execute() { @@ -103,8 +101,6 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary - - create_alias_latest } validate_required_args() { diff --git a/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh b/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh index 70e744f8..d24aeda8 100755 --- a/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh +++ b/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh @@ -67,8 +67,6 @@ execute() { print_bl print_summary - - create_alias_latest } wizard_execute() { @@ -130,8 +128,6 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary - - create_alias_latest } process_script_arguments() { diff --git a/components/scripts/lib/init.sh b/components/scripts/lib/init.sh index e71280b7..e502be33 100644 --- a/components/scripts/lib/init.sh +++ b/components/scripts/lib/init.sh @@ -4,9 +4,11 @@ make_experiment_dir() { mkdir -p "${EXP_DIR}" cd "${EXP_DIR}" || die "Unable to access the experiment dir (${EXP_DIR})." 2 rm -f "${BUILD_SCAN_FILE}" + + make_symlink_to_latest_experiment_dir } -create_alias_latest() { +make_symlink_to_latest_experiment_dir() { LINK_NAME="$(dirname "${EXP_DIR}")/latest" readonly LINK_NAME rm -f "${LINK_NAME}" > /dev/null 2>&1 diff --git a/components/scripts/maven/01-validate-local-build-caching-same-location.sh b/components/scripts/maven/01-validate-local-build-caching-same-location.sh index d70fada1..dc42079a 100755 --- a/components/scripts/maven/01-validate-local-build-caching-same-location.sh +++ b/components/scripts/maven/01-validate-local-build-caching-same-location.sh @@ -65,8 +65,6 @@ execute() { print_bl print_summary - - create_alias_latest } wizard_execute() { @@ -109,8 +107,6 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary - - create_alias_latest } execute_first_build() { diff --git a/components/scripts/maven/02-validate-local-build-caching-different-locations.sh b/components/scripts/maven/02-validate-local-build-caching-different-locations.sh index 1b799380..19a7fa89 100755 --- a/components/scripts/maven/02-validate-local-build-caching-different-locations.sh +++ b/components/scripts/maven/02-validate-local-build-caching-different-locations.sh @@ -65,8 +65,6 @@ execute() { print_bl print_summary - - create_alias_latest } wizard_execute() { @@ -112,8 +110,6 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary - - create_alias_latest } execute_first_build() { diff --git a/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh b/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh index 95d0ef1c..5b360b4e 100755 --- a/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh +++ b/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh @@ -57,8 +57,6 @@ execute() { print_bl print_summary - - create_alias_latest } wizard_execute() { @@ -101,8 +99,6 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary - - create_alias_latest } validate_required_args() { diff --git a/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh b/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh index 7c6815cf..7c6f78f7 100755 --- a/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh +++ b/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh @@ -66,8 +66,6 @@ execute() { print_bl print_summary - - create_alias_latest } wizard_execute() { @@ -129,8 +127,6 @@ wizard_execute() { explain_measure_build_results print_bl explain_and_print_summary - - create_alias_latest } process_script_arguments() { From 4701723b59799f9783b40d01ab0e17351d1146e6 Mon Sep 17 00:00:00 2001 From: Jerome Prinet Date: Tue, 26 Apr 2022 17:00:38 +0200 Subject: [PATCH 3/4] CR follow-up: update changes.md Signed-off-by: Jerome Prinet --- release/changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release/changes.md b/release/changes.md index 2b294130..d4ff0fa9 100644 --- a/release/changes.md +++ b/release/changes.md @@ -1 +1,2 @@ * FIX: Gradle experiment scripts fail when using the ```--project-dir``` argument to specify the build invocation directory. +* Add a symbolic link to latest experiment to ease folder navigation From 72f10a283fbd5d52107c65d2beb60567be965e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Prinet?= Date: Tue, 26 Apr 2022 17:05:04 +0200 Subject: [PATCH 4/4] Update release/changes.md Co-authored-by: Jim Hurne --- release/changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/changes.md b/release/changes.md index d4ff0fa9..73903047 100644 --- a/release/changes.md +++ b/release/changes.md @@ -1,2 +1,2 @@ * FIX: Gradle experiment scripts fail when using the ```--project-dir``` argument to specify the build invocation directory. -* Add a symbolic link to latest experiment to ease folder navigation +* Add a symbolic link to the latest experiment folder to ease folder navigation.