@@ -404,12 +404,38 @@ for _ in $(seq 0 30); do
404404 sleep 10
405405done
406406
407- greenprint " 🛃 Copying binary check files to edge vm"
407+ greenprint " 🛃 Copying binary and script files to edge vm"
408+
409+ # Create red.d and green.d directories if they don't exist
410+ ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo mkdir -p /etc/greenboot/red.d /etc/greenboot/green.d"
411+
412+ # Copy all files to temp directory first (all at once)
408413scp " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " ../testing_assets/failing_binary " ${SSH_USER} @${GUEST_ADDRESS} " :/tmp/ && \
409- ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo mv /tmp/failing_binary /etc/greenboot/check/wanted.d/"
410414scp " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " ../testing_assets/passing_binary " ${SSH_USER} @${GUEST_ADDRESS} " :/tmp/ && \
415+ scp " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " ../testing_assets/failing_script.sh " ${SSH_USER} @${GUEST_ADDRESS} " :/tmp/ && \
416+ scp " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " ../testing_assets/passing_script.sh " ${SSH_USER} @${GUEST_ADDRESS} " :/tmp/
417+
418+ # Setup all directories using cp (copy) instead of mv (move) so files stay in /tmp/
419+ greenprint " 🛃 Setting up red.d directory files"
420+ ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo cp /tmp/failing_binary /etc/greenboot/red.d/"
421+ ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo cp /tmp/passing_binary /etc/greenboot/red.d/"
422+ ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo cp /tmp/failing_script.sh /etc/greenboot/red.d/"
423+ ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo cp /tmp/passing_script.sh /etc/greenboot/red.d/"
424+
425+ greenprint " 🛃 Setting up green.d directory files"
426+ ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo cp /tmp/failing_binary /etc/greenboot/green.d/"
427+ ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo cp /tmp/passing_binary /etc/greenboot/green.d/"
428+ ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo cp /tmp/failing_script.sh /etc/greenboot/green.d/"
429+ ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo cp /tmp/passing_script.sh /etc/greenboot/green.d/"
430+
431+ # Setup original check directories (keeping existing behavior)
432+ greenprint " 🛃 Copying binary check files to edge vm"
433+ ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo mv /tmp/failing_binary /etc/greenboot/check/wanted.d/"
411434ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo mv /tmp/passing_binary /etc/greenboot/check/required.d/"
412435
436+ # Clean up remaining temp files
437+ ssh " ${SSH_OPTIONS[@]} " -i " ${SSH_KEY} " " ${SSH_USER} @${GUEST_ADDRESS} " " sudo rm -f /tmp/failing_script.sh /tmp/passing_script.sh"
438+
413439# Add instance IP address into /etc/ansible/hosts
414440tee " ${TEMPDIR} " /inventory > /dev/null << EOF
415441[ostree_guest]
0 commit comments