From 3342cc8ce51e5a50cfc3dc08c8d7a1d831bc14d4 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Thu, 3 Jun 2021 18:38:24 +0200 Subject: [PATCH] Add docker log head Summary: Should now display some of the docker logs if there are some errors Test Plan: run the script Reviewers: #reviewers Differential Revision: https://hub.sealcode.org/D1072 --- jenkins.start.sh | 15 ++++++++++++--- package-lock.json | 37 +++++++++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/jenkins.start.sh b/jenkins.start.sh index faca64c..76f936d 100755 --- a/jenkins.start.sh +++ b/jenkins.start.sh @@ -15,7 +15,7 @@ docker-compose up -d db rm -f log.txt -docker-compose run --user="$UID"\ +CONTAINER=$(docker-compose run --user="$UID"\ -e "SEALIOUS_MONGO_PORT=27017" \ -e "SEALIOUS_MONGO_HOST=db" \ -e "SEALIOUS_PORT=$SEALIOUS_PORT" \ @@ -23,5 +23,14 @@ docker-compose run --user="$UID"\ -p ${SEALIOUS_PORT}:${SEALIOUS_PORT} \ -d \ test \ - /bin/sh -c "{ node . --color 2>&1; } | ./node_modules/.bin/ansi-html-stream > log.html" \ - && echo "App started on $SEALIOUS_PORT" + /bin/sh -c "{ node . --color 2>&1; } | ./node_modules/.bin/ansi-html-stream > log.html") + +echo "App started on $SEALIOUS_PORT" + +echo "App running in container $CONTAINER" + +sleep 1 + +echo "Docker logs so far:" + +docker logs "$CONTAINER" diff --git a/package-lock.json b/package-lock.json index d09da94..b1fdba9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "stimulus": "^2.0.0" }, "devDependencies": { - "@sealcode/ansi-html-stream": "^1.0.0", + "@sealcode/ansi-html-stream": "^1.0.1", "@types/koa__router": "^8.0.4", "babel-loader": "^8.2.2", "concurrently": "^5.3.0", @@ -422,10 +422,13 @@ } }, "node_modules/@sealcode/ansi-html-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@sealcode/ansi-html-stream/-/ansi-html-stream-1.0.0.tgz", - "integrity": "sha512-OrEbze90s1bpJFiblMiMRHsVLGK4aO3f3Nzzw9HnER28igdLKZ+OSf3bu3Y19LLmCjGrVX5do5SXcrYGPKQ7VQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@sealcode/ansi-html-stream/-/ansi-html-stream-1.0.1.tgz", + "integrity": "sha512-J5KyrLxzLtu4CcGkqXsLtqKMbKCp4LeOnXDYNI1mk1WaQYrMgczg7d9yngo2XabDFcs1yVqs7SZzdBRxWN9BEg==", "dev": true, + "dependencies": { + "ansi_up": "^5.0.1" + }, "bin": { "ansi-html-stream": "index.js" } @@ -1389,6 +1392,15 @@ "ajv": "^6.9.1" } }, + "node_modules/ansi_up": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi_up/-/ansi_up-5.0.1.tgz", + "integrity": "sha512-HGOTjFQECRKZM9fIlGhJfR2pcK8PMUWzFOqcPwqBEnNIa4P2r0Di+g2hxCX0hL0n1NUtAHGRA+fUyA/OajZYFw==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/ansi-align": { "version": "3.0.0", "license": "ISC", @@ -9389,10 +9401,13 @@ } }, "@sealcode/ansi-html-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@sealcode/ansi-html-stream/-/ansi-html-stream-1.0.0.tgz", - "integrity": "sha512-OrEbze90s1bpJFiblMiMRHsVLGK4aO3f3Nzzw9HnER28igdLKZ+OSf3bu3Y19LLmCjGrVX5do5SXcrYGPKQ7VQ==", - "dev": true + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@sealcode/ansi-html-stream/-/ansi-html-stream-1.0.1.tgz", + "integrity": "sha512-J5KyrLxzLtu4CcGkqXsLtqKMbKCp4LeOnXDYNI1mk1WaQYrMgczg7d9yngo2XabDFcs1yVqs7SZzdBRxWN9BEg==", + "dev": true, + "requires": { + "ansi_up": "^5.0.1" + } }, "@sindresorhus/is": { "version": "0.14.0" @@ -10037,6 +10052,12 @@ "dev": true, "requires": {} }, + "ansi_up": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi_up/-/ansi_up-5.0.1.tgz", + "integrity": "sha512-HGOTjFQECRKZM9fIlGhJfR2pcK8PMUWzFOqcPwqBEnNIa4P2r0Di+g2hxCX0hL0n1NUtAHGRA+fUyA/OajZYFw==", + "dev": true + }, "ansi-align": { "version": "3.0.0", "requires": {