constellation/docs/screencasts/docker/delete-iam.expect
Fabian Kammel 1e74dfd1c4 Polish screen casts.
Signed-off-by: Fabian Kammel <fk@edgeless.systems>
2023-03-10 15:02:10 +01:00

33 lines
730 B
Text
Executable file

#!/usr/bin/expect -f
# Note: Expects to be able to run 'sudo install' without a password
set timeout -1
set send_human {0.05 0 1 0.05 0.3}
set CTRLC \003
set CTRLX \030
set record_name [lindex $argv 0];
proc expect_prompt {} {
# This matches the trailing 0m of our ANSI control sequence. See PS1 in Dockerfile.
expect "0m "
}
proc run_command {cmd} {
send -h "$cmd"
send "\r"
expect -timeout 1
}
# Start recording
spawn asciinema rec --overwrite /recordings/delete-iam.cast
send "\r"
expect_prompt
run_command "cd constellation-iam-terraform"
expect_prompt
run_command "terraform apply -destroy -auto-approve"
expect -timeout 25
run_command "# All resources are cleaned up."
# Stop recording
send "exit"