Skip to content

Commit

Permalink
devtool: add download_ci_artifacts command
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
roypat authored and bchalios committed Dec 2, 2024
1 parent aed4abe commit 4b9df90
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tools/devtool
Original file line number Diff line number Diff line change
@@ -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 <<EOF
test_debug [-- [<pytest args>]]
@@ -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."

0 comments on commit 4b9df90

Please sign in to comment.