Skip to content

Commit

Permalink
Support having actions at any folder level (#169)
Browse files Browse the repository at this point in the history
* Comment out file checks during deploy

* Test update

* Verify for manifest instead of action folder

* Update log messages too
  • Loading branch information
tmathern authored Mar 9, 2020
1 parent 49d2024 commit 934783f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/commands/app/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class Deploy extends BaseCommand {
}

if (!flags['skip-actions']) {
if (fs.existsSync('actions/')) {
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']) {
Expand All @@ -91,15 +91,15 @@ class Deploy extends BaseCommand {
// this is assumed to be a missing script error
}
if (!flags['skip-actions']) {
if (fs.existsSync('actions/')) {
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')
this.log('no manifest.yml, skipping action deploy')
}
}
if (!flags['skip-static']) {
Expand Down
13 changes: 12 additions & 1 deletion test/commands/app/deploy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ 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()
Expand All @@ -129,6 +129,17 @@ describe('run', () => {
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)
expect(mockScripts.buildUI).toHaveBeenCalledTimes(0)
})

test('build & deploy with --skip-actions', async () => {
command.argv = ['--skip-actions']
mockFS.existsSync.mockReturnValue(true)
Expand Down

0 comments on commit 934783f

Please sign in to comment.