Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
fix(shipit-deploy): only remove workspace if not shallow clone (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
btkostner authored and gregberge committed Jun 14, 2018
1 parent f66c2bb commit 6ba6f00
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 5 additions & 3 deletions packages/shipit-deploy/src/tasks/deploy/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ const updateTask = shipit => {
}

async function removeWorkspace() {
shipit.log(`Removing workspace "${shipit.workspace}"`)
await rmfr(shipit.workspace)
shipit.log(chalk.green('Workspace removed.'))
if (shipit.config.shallowClone) {
shipit.log(`Removing workspace "${shipit.workspace}"`)
await rmfr(shipit.workspace)
shipit.log(chalk.green('Workspace removed.'))
}
}

await setPreviousRelease()
Expand Down
12 changes: 11 additions & 1 deletion packages/shipit-deploy/src/tasks/deploy/update.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,21 @@ describe('deploy:update task', () => {
})
})

it('should remove workspace', async () => {
it('should remove workspace when shallow cloning', async () => {
shipit.config.shallowClone = true
stubShipit(shipit)
rmfr.mockClear()
expect(rmfr).not.toHaveBeenCalled()
await start(shipit, 'deploy:update')
expect(rmfr).toHaveBeenCalledWith('/tmp/workspace')
})

it('should keep workspace when not shallow cloning', async () => {
shipit.config.shallowClone = false
stubShipit(shipit)
rmfr.mockClear()
expect(rmfr).not.toHaveBeenCalled()
await start(shipit, 'deploy:update')
expect(rmfr).not.toHaveBeenCalledWith('/tmp/workspace')
})
})

0 comments on commit 6ba6f00

Please sign in to comment.