From aeffc2b9d40ce495fe4dd8b263de22f9c4db99c6 Mon Sep 17 00:00:00 2001 From: zodern Date: Mon, 13 Sep 2021 14:56:06 -0500 Subject: [PATCH 1/5] Add logs --- src/plugins/meteor/__tests__/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/meteor/__tests__/index.js b/src/plugins/meteor/__tests__/index.js index c14cfd89..fe9a1d64 100644 --- a/src/plugins/meteor/__tests__/index.js +++ b/src/plugins/meteor/__tests__/index.js @@ -254,7 +254,7 @@ describe('module - meteor', function() { expect(out.output).to.have.entriesCount('Prepare Bundle: SUCCESS', 1); }); - it('should allow overriding PORT on specific servers', async () => { + it.only('should allow overriding PORT on specific servers', async () => { sh.cd(path.resolve(os.tmpdir(), 'tests/project-1')); sh.exec('mup --config mup.override-port.js setup'); @@ -262,6 +262,9 @@ describe('module - meteor', function() { await checkDeploy(out, 'Codestin Search App', 4000); + sh.exec('mup docker ps'); + sh.exec('mup logs'); + const status = sh.exec('mup --config mup.override-port.js meteor status'); expect(status.output).to.have.entriesCount('- 3000/tcp => 4000', 1); expect(status.output).to.have.entriesCount(`App running at http://${serverInfo.host}:4000`, 1); From 5a0ad696e86b144186a0fc672903dcabb16b9568 Mon Sep 17 00:00:00 2001 From: zodern Date: Mon, 13 Sep 2021 15:03:21 -0500 Subject: [PATCH 2/5] Add logs --- src/plugins/meteor/__tests__/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/meteor/__tests__/index.js b/src/plugins/meteor/__tests__/index.js index fe9a1d64..79ec9849 100644 --- a/src/plugins/meteor/__tests__/index.js +++ b/src/plugins/meteor/__tests__/index.js @@ -266,6 +266,9 @@ describe('module - meteor', function() { sh.exec('mup logs'); const status = sh.exec('mup --config mup.override-port.js meteor status'); + sh.exec('mup docker ps'); + sh.exec('mup logs'); + expect(status.output).to.have.entriesCount('- 3000/tcp => 4000', 1); expect(status.output).to.have.entriesCount(`App running at http://${serverInfo.host}:4000`, 1); expect(status.output).to.have.entriesCount('Available in app\'s docker container: true', 1); From 5ac5566f277ee8be037bd9adf57eff2e8cd65ff3 Mon Sep 17 00:00:00 2001 From: zodern Date: Mon, 13 Sep 2021 15:24:40 -0500 Subject: [PATCH 3/5] Add logs --- src/plugins/meteor/status.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/meteor/status.js b/src/plugins/meteor/status.js index a457ab10..89783ebc 100644 --- a/src/plugins/meteor/status.js +++ b/src/plugins/meteor/status.js @@ -5,6 +5,8 @@ export function getInformation(server, appName, api) { return api.runSSHCommand(server, `docker inspect ${appName} --format "{{json .}}"`) // eslint-disable-next-line complexity .then(({ host, output }) => { + console.log(appName); + console.dir(output); let info; const stoppedResult = { statusColor: 'red', From afb0e663e93df1ff4116a5ed13296de9745d76f2 Mon Sep 17 00:00:00 2001 From: zodern Date: Mon, 13 Sep 2021 15:38:18 -0500 Subject: [PATCH 4/5] Fix docker permission error --- src/plugins/meteor/status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/meteor/status.js b/src/plugins/meteor/status.js index 89783ebc..8db1b524 100644 --- a/src/plugins/meteor/status.js +++ b/src/plugins/meteor/status.js @@ -2,7 +2,7 @@ import axios from 'axios'; import chalk from 'chalk'; export function getInformation(server, appName, api) { - return api.runSSHCommand(server, `docker inspect ${appName} --format "{{json .}}"`) + return api.runSSHCommand(server, `sudo docker inspect ${appName} --format "{{json .}}"`) // eslint-disable-next-line complexity .then(({ host, output }) => { console.log(appName); From bf2629ee7f9422d3b62a8633c865608056fe8452 Mon Sep 17 00:00:00 2001 From: zodern Date: Mon, 13 Sep 2021 16:08:07 -0500 Subject: [PATCH 5/5] Fix docker permission error --- src/plugins/meteor/status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/meteor/status.js b/src/plugins/meteor/status.js index 8db1b524..a663115e 100644 --- a/src/plugins/meteor/status.js +++ b/src/plugins/meteor/status.js @@ -130,7 +130,7 @@ export async function checkUrls(server, appConfig, api) { local ] = await Promise.all([ api.runSSHCommand(server, `curl ${getCheckAddress(server, appConfig)}:${port}`), - api.runSSHCommand(server, `docker exec ${appConfig.name} curl http://localhost:${appConfig.docker.imagePort}`), + api.runSSHCommand(server, `sudo docker exec ${appConfig.name} curl http://localhost:${appConfig.docker.imagePort}`), checkUrlLocally(server, appConfig, port) ]); const inDockerResult = inDocker.code === 0;