From 9f12d926352f2f6d0ceb9abfcca086ffe4eda16b Mon Sep 17 00:00:00 2001 From: Matias Date: Fri, 26 Apr 2019 14:45:36 -0300 Subject: [PATCH 1/2] Fixing error when logging file content When the content of the file is logged this condition is triggered. If there is an error with the clone, it will be terminated and detailed logs are saved on the storage. --- DebugLog.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/DebugLog.js b/DebugLog.js index d4b23743f..90bce53b3 100644 --- a/DebugLog.js +++ b/DebugLog.js @@ -8,7 +8,7 @@ "." + pad(global.EXECUTION_DATETIME.getUTCDate(), 2) + ".T." + pad(global.EXECUTION_DATETIME.getUTCHours(),2) + "." + pad(global.EXECUTION_DATETIME.getUTCMinutes(),2) + - "." + pad(global.EXECUTION_DATETIME.getUTCSeconds(),2); + "." + pad(global.EXECUTION_DATETIME.getUTCSeconds(),2); let messageId = 0; @@ -148,18 +148,6 @@ if (disableLogging === true) { return; } - if (global.CURRENT_EXECUTION_AT === "Node") { - - /* Only ERRORs go to the cloud console. */ - - if (pMessage.indexOf("[ERROR]") >= 0) { - - let now = new Date; - console.log("Loop." + pad(thisObject.bot.loopCounter, 8) + " " + now.toUTCString() + " CloneExecutor " + spacePad(pModule, 20) + " : " + pMessage); - - } - } - if (thisObject.bot === undefined) { return; } let newDate = new Date(); @@ -172,7 +160,7 @@ let logLine = '\r\n' + "['" + newDate + "'," + messageId + ",'" + pModule + "','" + pMessage + "']"; accumulatedLog = accumulatedLog + logLine; - + } catch (err) { console.log("[ERROR] DebugLog -> write -> err = " + err.message); } From 78cca8c913ea1555272d38050c4dc8382aae9484 Mon Sep 17 00:00:00 2001 From: Matias Date: Fri, 26 Apr 2019 15:02:59 -0300 Subject: [PATCH 2/2] Adding docker config --- Dockerfile | 9 +++++++++ docker-compose.prod.yml | 12 ++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.prod.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..860816832 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:8.6-alpine + +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +COPY package.json ./ +RUN npm install + +COPY . . diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 000000000..b8cfcb208 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,12 @@ +version: '3' +services: + node: + image: superalgos/clone-executor:1.0.2 + build: + context: . + dockerfile: ./Dockerfile + container_name: clone-executor + tty: true + stdin_open: true + command: node Run.js + restart: always