mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-30 22:24:14 +01:00
28 lines
485 B
Python
28 lines
485 B
Python
|
#!/usr/bin/python
|
||
|
|
||
|
import pexpect
|
||
|
import os
|
||
|
import sys
|
||
|
import time
|
||
|
import socket
|
||
|
|
||
|
ip = socket.gethostbyname(socket.gethostname())
|
||
|
cmd = "docker push "+ip+"/library/tomcat:latest"
|
||
|
passw = "Harbor12345"
|
||
|
child = pexpect.spawn(cmd)
|
||
|
time.sleep(5)
|
||
|
|
||
|
child.expect(':')
|
||
|
child.sendline(passw)
|
||
|
time.sleep(1)
|
||
|
child.expect(':')
|
||
|
child.sendline(passw)
|
||
|
time.sleep(1)
|
||
|
child.expect(':')
|
||
|
child.sendline(passw)
|
||
|
time.sleep(1)
|
||
|
child.expect(':')
|
||
|
child.sendline(passw)
|
||
|
time.sleep(1)
|
||
|
child.expect(pexpect.EOF)
|