-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
olegs-codefresh
authored
Jan 14, 2018
1 parent
c29c554
commit c863895
Showing
4 changed files
with
86 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
lib/interface/cli/commands/pipeline/dynamic/test-release.cmd.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
const Command = require('../../../Command'); | ||
const { | ||
testRelease, | ||
} = require('./../../../../../logic/api/helm'); | ||
const { printError } = require('./../../../helpers/general'); | ||
const { log } = require('../../../../../logic').api; | ||
|
||
const install = new Command({ | ||
root: true, | ||
command: 'test-release [name]', | ||
description: 'Test helm releaes', | ||
builder: (yargs) => { | ||
return yargs | ||
.usage('Test helm relaese') | ||
.option('cluster', { | ||
description: 'Install on cluster', | ||
type: 'string', | ||
required: true, | ||
}) | ||
.option('timeout', { | ||
description: 'time in seconds to wait for any individual kubernetes operation (like Jobs for hooks) (default 300)', | ||
default: '300', | ||
type: 'number', | ||
}) | ||
.option('cleanup', { | ||
description: 'delete test pods upon completion (default false)', | ||
default: 'false', | ||
type: 'boolean', | ||
}); | ||
}, | ||
handler: async (argv) => { | ||
const releaseName = argv.name; | ||
if (!releaseName) { | ||
throw new Error('Release name is required'); | ||
} | ||
try { | ||
const workflowId = await testRelease({ | ||
releaseName, | ||
cluster: argv.cluster, | ||
cleanup: argv.cleanup, | ||
timeout: argv.timeout, | ||
}); | ||
console.log(`Started with id: ${workflowId}`); | ||
await log.showWorkflowLogs(workflowId, true); | ||
process.exit(0); | ||
} catch (err) { | ||
printError(err); | ||
process.exit(1); | ||
} | ||
}, | ||
}); | ||
|
||
module.exports = install; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters