ff18784983
Build & Deploy / build-and-deploy (push) Failing after 11s
- image: Gitea registry → 서버 로컬 registry(localhost:5000)로 변경 - Service: ClusterIP + Ingress → NodePort(30200/30201) + Traefik docker dynamic 파일 - deploy/traefik-dynamic.yml: /opt/docker/traefik/dynamic/insurance.yml 배치용 - scripts/deploy-remote.sh: 서버 수동 배포 스크립트 (build→push→k3s apply→traefik 설정) - legacy ingress.yaml / ingressroute-traefik.yaml 제거 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
const { Client } = require('ssh2');
|
|
|
|
const HOST = process.env.SSH_HOST || '183.99.177.40';
|
|
const PORT = Number(process.env.SSH_PORT || 22);
|
|
const USER = process.env.SSH_USER || 'chpark';
|
|
const PASS = process.env.SSH_PASS || 'qlalfqjsgh11';
|
|
|
|
async function run(cmd, { silent = false } = {}) {
|
|
return new Promise((resolve, reject) => {
|
|
const conn = new Client();
|
|
let stdout = '';
|
|
let stderr = '';
|
|
conn
|
|
.on('ready', () => {
|
|
conn.exec(cmd, (err, stream) => {
|
|
if (err) { conn.end(); return reject(err); }
|
|
stream.on('close', (code) => { conn.end(); resolve({ code, stdout, stderr }); })
|
|
.on('data', (data) => { const s = data.toString(); stdout += s; if (!silent) process.stdout.write(s); })
|
|
.stderr.on('data', (data) => { const s = data.toString(); stderr += s; if (!silent) process.stderr.write(s); });
|
|
});
|
|
})
|
|
.on('error', reject)
|
|
.connect({ host: HOST, port: PORT, username: USER, password: PASS, readyTimeout: 30000 });
|
|
});
|
|
}
|
|
|
|
module.exports = { run };
|
|
|
|
if (require.main === module) {
|
|
const cmd = process.argv.slice(2).join(' ');
|
|
if (!cmd) {
|
|
console.error('usage: node ssh-run.js <command>');
|
|
process.exit(1);
|
|
}
|
|
run(cmd).then(r => process.exit(r.code)).catch(e => { console.error(e.message); process.exit(1); });
|
|
}
|