From 19853f5fb34b6e707e5e74d064119ba1d6b78866 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Thu, 5 Mar 2020 08:39:04 -0800 Subject: [PATCH 1/4] Comment out file checks during deploy --- src/commands/app/deploy.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/commands/app/deploy.js b/src/commands/app/deploy.js index 1f2ababe..401106ec 100644 --- a/src/commands/app/deploy.js +++ b/src/commands/app/deploy.js @@ -64,11 +64,11 @@ class Deploy extends BaseCommand { } if (!flags['skip-actions']) { - if (fs.existsSync('actions/')) { + // if (fs.existsSync('actions/')) { await scripts.buildActions([], { filterActions }) - } else { - this.log('no action src, skipping action build') - } + // } else { + // this.log('no action src, skipping action build') + // } } if (!flags['skip-static']) { if (fs.existsSync('web-src/')) { @@ -91,16 +91,16 @@ class Deploy extends BaseCommand { // this is assumed to be a missing script error } if (!flags['skip-actions']) { - if (fs.existsSync('actions/')) { + // if (fs.existsSync('actions/')) { let filterEntities if (filterActions) { filterEntities = { actions: filterActions } } await scripts.deployActions([], { filterEntities }) // todo show action urls !!! - } else { - this.log('no action src, skipping action deploy') - } + // } else { + // this.log('no action src, skipping action deploy') + // } } if (!flags['skip-static']) { if (fs.existsSync('web-src/')) { From a77c6b6526e449b9d99de5fdc3c8a01a2e008c16 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Thu, 5 Mar 2020 08:50:05 -0800 Subject: [PATCH 2/4] Test update --- src/commands/app/deploy.js | 21 ++++++--------------- test/commands/app/deploy.test.js | 4 ++-- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/commands/app/deploy.js b/src/commands/app/deploy.js index 401106ec..fc73aaab 100644 --- a/src/commands/app/deploy.js +++ b/src/commands/app/deploy.js @@ -64,11 +64,7 @@ class Deploy extends BaseCommand { } if (!flags['skip-actions']) { - // if (fs.existsSync('actions/')) { - await scripts.buildActions([], { filterActions }) - // } else { - // this.log('no action src, skipping action build') - // } + await scripts.buildActions([], { filterActions }) } if (!flags['skip-static']) { if (fs.existsSync('web-src/')) { @@ -91,16 +87,11 @@ class Deploy extends BaseCommand { // this is assumed to be a missing script error } if (!flags['skip-actions']) { - // if (fs.existsSync('actions/')) { - let filterEntities - if (filterActions) { - filterEntities = { actions: filterActions } - } - await scripts.deployActions([], { filterEntities }) - // todo show action urls !!! - // } else { - // this.log('no action src, skipping action deploy') - // } + let filterEntities + if (filterActions) { + filterEntities = { actions: filterActions } + } + await scripts.deployActions([], { filterEntities }) } if (!flags['skip-static']) { if (fs.existsSync('web-src/')) { diff --git a/test/commands/app/deploy.test.js b/test/commands/app/deploy.test.js index 54db96e2..340d7468 100644 --- a/test/commands/app/deploy.test.js +++ b/test/commands/app/deploy.test.js @@ -123,9 +123,9 @@ describe('run', () => { mockFS.existsSync.mockReturnValue(false) await command.run() expect(command.error).toHaveBeenCalledTimes(0) - expect(mockScripts.deployActions).toHaveBeenCalledTimes(0) + expect(mockScripts.deployActions).toHaveBeenCalledTimes(1) expect(mockScripts.deployUI).toHaveBeenCalledTimes(0) - expect(mockScripts.buildActions).toHaveBeenCalledTimes(0) + expect(mockScripts.buildActions).toHaveBeenCalledTimes(1) expect(mockScripts.buildUI).toHaveBeenCalledTimes(0) }) From 4d2e3dbec249b1ca8900b5608f46b1b38e738b8a Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 6 Mar 2020 10:05:53 -0800 Subject: [PATCH 3/4] Verify for manifest instead of action folder --- src/commands/app/deploy.js | 19 ++++++++++++++----- test/commands/app/deploy.test.js | 13 ++++++++++++- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/commands/app/deploy.js b/src/commands/app/deploy.js index fc73aaab..6c0b95cf 100644 --- a/src/commands/app/deploy.js +++ b/src/commands/app/deploy.js @@ -64,7 +64,11 @@ class Deploy extends BaseCommand { } if (!flags['skip-actions']) { - await scripts.buildActions([], { filterActions }) + if (fs.existsSync('manifest.yml')) { + await scripts.buildActions([], { filterActions }) + } else { + this.log('no action src, skipping action build') + } } if (!flags['skip-static']) { if (fs.existsSync('web-src/')) { @@ -87,11 +91,16 @@ class Deploy extends BaseCommand { // this is assumed to be a missing script error } if (!flags['skip-actions']) { - let filterEntities - if (filterActions) { - filterEntities = { actions: filterActions } + if (fs.existsSync('manifest.yml')) { + let filterEntities + if (filterActions) { + filterEntities = { actions: filterActions } + } + await scripts.deployActions([], { filterEntities }) + // todo show action urls !!! + } else { + this.log('no action src, skipping action deploy') } - await scripts.deployActions([], { filterEntities }) } if (!flags['skip-static']) { if (fs.existsSync('web-src/')) { diff --git a/test/commands/app/deploy.test.js b/test/commands/app/deploy.test.js index 340d7468..e3e05c77 100644 --- a/test/commands/app/deploy.test.js +++ b/test/commands/app/deploy.test.js @@ -118,11 +118,22 @@ describe('run', () => { }) }) - test('build & deploy actions with no actions folder ', async () => { + test('build & deploy actions with no actions folder and no manifest', async () => { command.argv = ['--skip-static'] mockFS.existsSync.mockReturnValue(false) await command.run() expect(command.error).toHaveBeenCalledTimes(0) + expect(mockScripts.deployActions).toHaveBeenCalledTimes(0) + expect(mockScripts.deployUI).toHaveBeenCalledTimes(0) + expect(mockScripts.buildActions).toHaveBeenCalledTimes(0) + expect(mockScripts.buildUI).toHaveBeenCalledTimes(0) + }) + + test('build & deploy actions with no actions folder but with a manifest', async () => { + command.argv = ['--skip-static'] + mockFS.existsSync.mockReturnValue(true) + await command.run() + expect(command.error).toHaveBeenCalledTimes(0) expect(mockScripts.deployActions).toHaveBeenCalledTimes(1) expect(mockScripts.deployUI).toHaveBeenCalledTimes(0) expect(mockScripts.buildActions).toHaveBeenCalledTimes(1) From 07d49bf20438f9949376c2422764844ef7ceb5b5 Mon Sep 17 00:00:00 2001 From: Tania Mathern Date: Fri, 6 Mar 2020 10:12:47 -0800 Subject: [PATCH 4/4] Update log messages too --- src/commands/app/deploy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/app/deploy.js b/src/commands/app/deploy.js index 6c0b95cf..1736b040 100644 --- a/src/commands/app/deploy.js +++ b/src/commands/app/deploy.js @@ -67,7 +67,7 @@ class Deploy extends BaseCommand { if (fs.existsSync('manifest.yml')) { await scripts.buildActions([], { filterActions }) } else { - this.log('no action src, skipping action build') + this.log('no manifest.yml, skipping action build') } } if (!flags['skip-static']) { @@ -99,7 +99,7 @@ class Deploy extends BaseCommand { await scripts.deployActions([], { filterEntities }) // todo show action urls !!! } else { - this.log('no action src, skipping action deploy') + this.log('no manifest.yml, skipping action deploy') } } if (!flags['skip-static']) {