fix: keep deployment SSH sessions alive
This commit is contained in:
parent
ee1500ab64
commit
2b51d220a5
@ -155,6 +155,9 @@ function sshArguments(identityFile, knownHostsFile) {
|
||||
'-o', 'StrictHostKeyChecking=yes',
|
||||
'-o', `UserKnownHostsFile=${knownHostsFile}`,
|
||||
'-o', 'ConnectTimeout=10',
|
||||
'-o', 'ServerAliveInterval=3',
|
||||
'-o', 'ServerAliveCountMax=10',
|
||||
'-o', 'TCPKeepAlive=yes',
|
||||
'-i', identityFile,
|
||||
]
|
||||
}
|
||||
|
||||
@ -819,7 +819,9 @@ actual_prod_host_key="$(ssh-keygen -F "$PROD_SERVER_IP" -f "$PROD_KNOWN_HOSTS_FI
|
||||
ok "Build server tools are available"
|
||||
|
||||
prod_ssh() {
|
||||
ssh -o BatchMode=yes -o StrictHostKeyChecking=yes -o "UserKnownHostsFile=$PROD_KNOWN_HOSTS_FILE" -o ConnectTimeout=8 "$PROD_SERVER_USER@$PROD_SERVER_IP" "$@"
|
||||
ssh -o BatchMode=yes -o StrictHostKeyChecking=yes -o "UserKnownHostsFile=$PROD_KNOWN_HOSTS_FILE" \
|
||||
-o ConnectTimeout=8 -o ServerAliveInterval=3 -o ServerAliveCountMax=10 -o TCPKeepAlive=yes \
|
||||
"$PROD_SERVER_USER@$PROD_SERVER_IP" "$@"
|
||||
}
|
||||
|
||||
prod_ssh_script() {
|
||||
|
||||
@ -40,3 +40,15 @@ test('Mac entry requires an exact commit outside DryRun', () => {
|
||||
assert.equal(parseArguments(['--dry-run']).dryRun, true)
|
||||
assert.equal(parseArguments(['--commit', 'b'.repeat(40)]).commit, 'b'.repeat(40))
|
||||
})
|
||||
|
||||
test('deployment SSH hops keep long builds and cutovers alive', () => {
|
||||
const macSource = readFileSync(new URL('./git-incremental-deploy-macos.mjs', import.meta.url), 'utf8')
|
||||
const powerShellSource = readFileSync(new URL('./git-incremental-deploy.ps1', import.meta.url), 'utf8')
|
||||
const payload = extractRemoteTemplate(powerShellSource)
|
||||
|
||||
for (const source of [macSource, payload]) {
|
||||
assert.match(source, /ServerAliveInterval=3/)
|
||||
assert.match(source, /ServerAliveCountMax=10/)
|
||||
assert.match(source, /TCPKeepAlive=yes/)
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user