Migrate Code Queue infra target to G14
This commit is contained in:
@@ -23,6 +23,10 @@ const defaultPrivateKeyPath = "/root/.ssh/id_ed25519";
|
||||
const defaultKnownHostsPath = "/root/.ssh/known_hosts";
|
||||
const providerGatewayWsEgressProxyUrl = "http://127.0.0.1:18789";
|
||||
|
||||
function providerHomeDir(providerId: string): string {
|
||||
return providerId === "G14" ? "/root" : "/home/ubuntu";
|
||||
}
|
||||
|
||||
function pgLiteral(value: string): string {
|
||||
return `'${value.replace(/'/gu, "''")}'`;
|
||||
}
|
||||
@@ -202,7 +206,8 @@ import subprocess
|
||||
import sys
|
||||
|
||||
data = json.load(sys.stdin)
|
||||
ssh_dir = pathlib.Path("/home/ubuntu/.ssh")
|
||||
home_dir = pathlib.Path(str(data.get("homeDir") or os.environ.get("HOME") or "/home/ubuntu"))
|
||||
ssh_dir = home_dir / ".ssh"
|
||||
private_key = str(data.get("privateKey") or "")
|
||||
public_key = str(data.get("publicKey") or "").strip()
|
||||
known_hosts = str(data.get("knownHosts") or "")
|
||||
@@ -321,6 +326,7 @@ function distributeGithubIdentity(providerId: string, identity: GithubSshIdentit
|
||||
privateKey: identity.privateKey,
|
||||
publicKey: identity.publicKey,
|
||||
knownHosts: identity.knownHosts,
|
||||
homeDir: providerHomeDir(providerId),
|
||||
});
|
||||
const remotePython = remoteInstallPythonSource();
|
||||
const proxyPython = gitSshHttpConnectProxySource();
|
||||
|
||||
Reference in New Issue
Block a user