2020-08-09 09:10:00 +02:00
|
|
|
#!/usr/bin/env expect
|
2019-12-18 03:42:20 +01:00
|
|
|
|
|
|
|
set HOST [lindex $argv 0]
|
|
|
|
set PROJECT [lindex $argv 1]
|
|
|
|
set IMAGE [lindex $argv 2]
|
2020-01-19 06:56:58 +01:00
|
|
|
set notaryServerEndpoint [lindex $argv 3]
|
2019-12-18 03:42:20 +01:00
|
|
|
set timeout 30
|
|
|
|
|
2020-01-19 06:56:58 +01:00
|
|
|
spawn notary -s https://$notaryServerEndpoint --tlscacert /notary_ca.crt -d /root/.docker/trust remove -p $HOST/$PROJECT/$IMAGE latest
|
2019-12-18 03:42:20 +01:00
|
|
|
|
|
|
|
expect {
|
|
|
|
"Enter username:" {send "admin\r";exp_continue}
|
|
|
|
"Enter password:" {send "Harbor12345\r";exp_continue}
|
|
|
|
"Enter passphrase for targets key with ID*" {send "Harbor12345\r"}
|
|
|
|
timeout {exit 1}
|
|
|
|
}
|
|
|
|
expect eof
|
|
|
|
exit 0
|
|
|
|
|