mirror of https://github.com/certd/certd
Merge branch 'v2-dev' into v2-plugin
commit
ec22070957
|
@ -139,6 +139,7 @@ export class AsyncSsh2Client {
|
|||
script: string,
|
||||
opts: {
|
||||
throwOnStdErr?: boolean;
|
||||
env?: any;
|
||||
} = {}
|
||||
): Promise<string> {
|
||||
if (!script) {
|
||||
|
@ -153,7 +154,7 @@ export class AsyncSsh2Client {
|
|||
// }
|
||||
return new Promise((resolve, reject) => {
|
||||
this.logger.info(`执行命令:[${this.connConf.host}][exec]: \n` + script);
|
||||
this.conn.exec(script, (err: Error, stream: any) => {
|
||||
this.conn.exec(script, { pty: true, env: opts.env }, (err: Error, stream: any) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
return;
|
||||
|
@ -456,7 +457,7 @@ export class SshClient {
|
|||
script = envScripts.join(newLine) + newLine + script;
|
||||
}
|
||||
}
|
||||
return await conn.exec(script as string);
|
||||
return await conn.exec(script as string, { env: options.env });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -381,7 +381,8 @@ export class UploadCertToHostPlugin extends AbstractTaskPlugin {
|
|||
for (let i = 0; i < domains.length; i++) {
|
||||
env[`CERT_DOMAIN_${i}`] = domains[i];
|
||||
}
|
||||
env['CERT_EXPIRES'] = dayjs(certReader.getCrtDetail().expires).unix();
|
||||
//环境变量必须是string
|
||||
env['CERT_EXPIRES'] = ""+dayjs(certReader.getCrtDetail().expires).unix();
|
||||
|
||||
env['HOST_CRT_PATH'] = this.hostCrtPath || '';
|
||||
env['HOST_KEY_PATH'] = this.hostKeyPath || '';
|
||||
|
|
Loading…
Reference in New Issue