Skip to content

Commit 571429e

Browse files
committed
feat: add devtool cmd to move generated artifacts to build/img
This allows for quick testing of locally generated CI artifacts with the other devtool commands (sandbox, test, ...). Signed-off-by: Riccardo Mancini <[email protected]>
1 parent 727aec8 commit 571429e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tools/devtool

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,9 @@ cmd_help() {
418418
echo " Builds the rootfs and guest kernel artifacts we use for our CI."
419419
echo " Run './tools/devtool build_ci_artifacts help' for more details about the available commands."
420420
echo ""
421+
echo " setup_local_ci_artifacts"
422+
echo " Copies and setups the artifacts built using "build_ci_artifacts" to use them with the devtool commands"
423+
echo ""
421424

422425
cat <<EOF
423426
test_debug [-- [<pytest args>]]
@@ -1210,6 +1213,14 @@ cmd_build_ci_artifacts() {
12101213
cmd_fix_perms
12111214
}
12121215

1216+
cmd_setup_local_ci_artifacts() {
1217+
LOCAL_ARTIFACTS="resources/$(uname -m)"
1218+
ARTIFACTS=$MICROVM_IMAGES_DIR/$(uname -m)
1219+
rm -rfv "$ARTIFACTS"
1220+
mkdir -pv "$ARTIFACTS"
1221+
cp -ruvf "$LOCAL_ARTIFACTS/" "$MICROVM_IMAGES_DIR"
1222+
cmd_sh "./tools/setup-ci-artifacts.sh"
1223+
}
12131224

12141225
main() {
12151226

tools/setup-ci-artifacts.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ say "Setup CI artifacts"
1212
cd build/img/$(uname -m)
1313

1414
say "Fix executable permissions"
15-
find "firecracker" -type f |xargs chmod -c 755
15+
if [ -d "firecracker" ]; then
16+
find "firecracker" -type f |xargs chmod -c 755
17+
fi
1618

1719
say "Generate SSH key to connect from host"
1820
if [ ! -s id_rsa ]; then

0 commit comments

Comments
 (0)