20 lines
594 B
Python
20 lines
594 B
Python
import pexpect
|
|
|
|
c = pexpect.spawn('ssh -q -o StrictHostKeyChecking=no root@210.16.161.214', encoding='utf-8', timeout=60)
|
|
c.expect('password:')
|
|
c.sendline('XHR521yhf')
|
|
c.expect('[$#]')
|
|
|
|
# Start DB containers
|
|
c.sendline('cd /www/wwwroot/velobase-harness && docker compose up -d postgres redis 2>&1')
|
|
c.expect('[$#]', timeout=30)
|
|
print('=== DOCKER UP ===')
|
|
print(c.before.strip()[-800:])
|
|
|
|
# Check containers
|
|
c.sendline('docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep velobase')
|
|
c.expect('[$#]')
|
|
print('=== CONTAINERS ===')
|
|
print(c.before.strip()[-600:])
|
|
|
|
c.sendline('exit') |