emoji updates

This commit is contained in:
Dragan Filipovic 2023-01-02 19:21:33 +01:00
parent 177f5b4b79
commit 9dcb6032a7
6 changed files with 18 additions and 18 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -3,11 +3,11 @@ const { join } = require('path');
const validateDir = (dir) => {
if (!dir) {
console.log('[DIR] dir is not defined');
console.warn('⚠️ [DIR] dir is not defined');
return;
}
if (existsSync(dir)) {
console.log(`[DIR] ${dir} dir exist`);
console.log(`[DIR] ${dir} dir exist`);
return;
}
@ -51,7 +51,7 @@ const validateRequiredInputs = (inputs) => {
const inputValue = inputs[inputKey];
if (!inputValue) {
console.error(`⚠️ [INPUTS] ${inputKey} is mandatory`);
console.error(` [INPUTS] ${inputKey} is mandatory`);
}
return inputValue;

View file

@ -38,10 +38,10 @@ const run = async () => {
};
run()
.then((data) => {
console.log('[DONE]', data);
.then((data = '') => {
console.log('[DONE]', data);
})
.catch((error) => {
console.error('[ERROR]', error.message);
console.error('[ERROR]', error.message);
process.exit(1);
});

View file

@ -15,7 +15,7 @@ const remoteCmd = async (content, privateKeyPath, isRequired, label) => new Prom
const filename = `local_ssh_script-${label}.sh`;
try {
writeToFile({ dir: githubWorkspace, filename, content });
console.log(`Executing remote script: ssh -i ${privateKeyPath} ${sshServer}`, content);
console.log(`Executing remote script: ssh -i ${privateKeyPath} ${sshServer}`);
exec(
`DEBIAN_FRONTEND=noninteractive ssh -i ${privateKeyPath} ${sshServer} 'RSYNC_STDOUT="${process.env.RSYNC_STDOUT}" bash -s' < ${filename}`,
(err, data, stderr) => {

View file

@ -5,20 +5,20 @@ const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => {
try {
nodeRsync(config, (error, stdout, stderr, cmd) => {
if (error) {
console.error('⚠️ [Rsync] error: ');
console.error(' [Rsync] error: ');
console.error(error);
console.error('⚠️ [Rsync] stderr: ');
console.error(' [Rsync] stderr: ');
console.error(stderr);
console.error(' [Rsync] stdout: ');
console.error(' [Rsync] stdout: ');
console.error(stdout);
console.error('⚠️ [Rsync] cmd: ', cmd);
console.error(' [Rsync] cmd: ', cmd);
reject(new Error(`${error.message}\n\n${stderr}`));
} else {
resolve(stdout);
}
});
} catch (error) {
console.error('⚠️ [Rsync] command error: ', error.message, error.stack);
console.error(' [Rsync] command error: ', error.message, error.stack);
reject(error);
}
});
@ -26,13 +26,13 @@ const nodeRsyncPromise = async (config) => new Promise((resolve, reject) => {
const validateRsync = async () => {
try {
execSync('rsync --version', { stdio: 'inherit' });
console.log(' [CLI] Rsync exists');
console.log(' [CLI] Rsync exists');
return;
} catch (error) {
console.log('⚠️ [CLI] Rsync doesn\'t exists', error.message);
console.warn('⚠️ [CLI] Rsync doesn\'t exists', error.message);
}
console.log('⚠️ [CLI] Start rsync installation with "apt-get" \n');
console.log('[CLI] Start rsync installation with "apt-get" \n');
try {
execSync('sudo DEBIAN_FRONTEND=noninteractive apt-get -y update && sudo DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -y install rsync', { stdio: 'inherit' });
console.log('✅ [CLI] Rsync installed. \n');

View file

@ -25,13 +25,13 @@ const addSshKey = (content, deployKeyName) => {
const updateKnownHosts = (host) => {
const { knownHostsPath } = getPrivateKeyPath();
console.log('[SSH] Adding host to `known_hosts` ....', host, knownHostsPath);
console.log('[SSH] Adding host to `known_hosts` ....', host, knownHostsPath);
try {
execSync(`ssh-keyscan -H ${host} >> ${knownHostsPath}`, {
stdio: 'inherit'
});
} catch (error) {
console.error(' [SSH] Adding host to `known_hosts` ERROR', host, error.message);
console.error(' [SSH] Adding host to `known_hosts` ERROR', host, error.message);
}
console.log('✅ [SSH] Adding host to `known_hosts` DONE', host, knownHostsPath);
};