refs #6510 fixes after deps update
gitea/docker-discover/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2023-12-21 20:05:26 +01:00
parent 4c6b236b5d
commit dfe4a11b91
3 changed files with 5 additions and 5 deletions

View File

@ -17,7 +17,7 @@ RUN apt-get update \
WORKDIR /docker-discover WORKDIR /docker-discover
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
RUN npm install --only=prod RUN npm install --omit=dev
COPY index.js config.yml rproxy.handlebars ./ COPY index.js config.yml rproxy.handlebars ./

View File

@ -9,7 +9,7 @@ rproxy:
- rproxy2.local - rproxy2.local
auth: auth:
username: root username: root
privateKey: /root/.ssh/id_rsa privateKeyPath: /root/.ssh/id_rsa
confDir: /etc/haproxy confDir: /etc/haproxy
reloadCmd: service haproxy reload reloadCmd: service haproxy reload
acls: acls:

View File

@ -1,7 +1,7 @@
require('require-yaml'); require('require-yaml');
const Docker = require('dockerode'); const Docker = require('dockerode');
const handlebars = require('handlebars'); const handlebars = require('handlebars');
const ssh = require('node-ssh'); const {NodeSSH} = require('node-ssh');
const fs = require('fs-extra'); const fs = require('fs-extra');
const shajs = require('sha.js'); const shajs = require('sha.js');
const conf = require('./config.yml'); const conf = require('./config.yml');
@ -148,7 +148,7 @@ async function updateProxy(firstRun) {
console.log(`Updating host: ${host}`); console.log(`Updating host: ${host}`);
if (!isProduction) continue; if (!isProduction) continue;
const sshClient = new ssh(); const sshClient = new NodeSSH();
await sshClient.connect(Object.assign({host}, conf.rproxy.auth)); await sshClient.connect(Object.assign({host}, conf.rproxy.auth));
await sshClient.putFiles([files]); await sshClient.putFiles([files]);
if (firstRun) if (firstRun)
@ -158,7 +158,7 @@ async function updateProxy(firstRun) {
{recursive: true} {recursive: true}
); );
if (conf.rproxy.reloadCmd) if (conf.rproxy.reloadCmd)
await sshClient.exec(conf.rproxy.reloadCmd); await sshClient.execCommand(conf.rproxy.reloadCmd);
await sshClient.dispose(); await sshClient.dispose();
} }