From 4b9df906d2da5396eb1244576c5f21b983441e53 Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Mon, 2 Dec 2024 07:57:49 +0000 Subject: [PATCH] devtool: add `download_ci_artifacts` command Every now and then, I managed to end up with an empty CI artifacts folder, for whatever reason (mostly me being silly). The solution is generally to remove whatever messed up stuff I ended up with in build/img, and run some arbitrary devtool command that I know will redownload everything. Similar workflows must happen whenever we do an in-place update of our CI artifacts. Abstract this away into a command that deletes the build/img folder, and then redownloads it. Signed-off-by: Patrick Roy --- tools/devtool | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/devtool b/tools/devtool index d3a59f7c5b2..4019a7f4b1e 100755 --- a/tools/devtool +++ b/tools/devtool @@ -418,6 +418,10 @@ cmd_help() { echo " Builds the rootfs and guest kernel artifacts we use for our CI." echo " Run './tools/devtool build_ci_artifacts help' for more details about the available commands." echo "" + echo " download_ci_artifacts [--force]" + echo " Downloads the CI artifacts used for testing from our S3 bucket. If --force is passed, purges any existing" + echo " artifacts first. Useful for refreshing local artifacts after an update, or if something got messed up." + echo "" cat <]] @@ -555,6 +559,14 @@ cmd_distclean() { fi } +cmd_download_ci_artifacts() { + if [ "$1" = "--force" ]; then + rm -rf $FC_BUILD_DIR/img + fi + + ensure_ci_artifacts +} + ensure_ci_artifacts() { if ! command -v aws >/dev/null; then die "AWS CLI not installed, which is required for downloading artifacts for integration tests."