-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bump mock-fs vesrion * add experimental support for pipelines * fix app flag * refactor, add push support * fix bug * fix bug, update header & README
- Loading branch information
Showing
8 changed files
with
2,308 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,4 @@ jspm_packages | |
# Optional REPL history | ||
.node_repl_history | ||
.vscode | ||
yarn.lock | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,70 @@ | ||
// command line args | ||
|
||
module.exports = [ | ||
{ | ||
name: 'file', | ||
char: 'f', | ||
hasValue: true, | ||
description: 'specify target filename' | ||
module.exports = { | ||
shared: [ | ||
{ | ||
name: 'file', | ||
char: 'f', | ||
hasValue: true, | ||
description: 'specify target filename', | ||
}, | ||
{ | ||
name: 'overwrite', | ||
char: 'o', | ||
description: 'overwrite destination config vars', | ||
}, | ||
{ name: 'quiet', char: 'q', description: 'supress all non-error output' }, | ||
{ | ||
name: 'expanded', | ||
char: 'e', | ||
description: 'allow non-standard characters in variable names', | ||
}, | ||
{ | ||
name: 'pipeline-name', | ||
description: | ||
'pull or push the configuration of a specific pipeline. If provided, must also specify pipeline-stage', | ||
hasValue: true, | ||
}, | ||
{ | ||
name: 'pipeline-stage', | ||
description: | ||
'pull or push the configuration of a specific pipeline. If provided, must also specify pipeline-name', | ||
hasValue: true, | ||
}, | ||
], | ||
pipelineFlagsAreValid: (flags) => { | ||
const pipelineName = flags['pipeline-name'] | ||
const pipelineStage = flags['pipeline-stage'] | ||
|
||
if ((pipelineName || pipelineStage) && !(pipelineName && pipelineStage)) { | ||
return false | ||
} | ||
return true | ||
}, | ||
{ | ||
name: 'overwrite', | ||
char: 'o', | ||
description: 'overwrite destination config vars' | ||
buildPullUrl: async (context, heroku, cli) => { | ||
const pipelineName = context.flags['pipeline-name'] | ||
const pipelineStage = context.flags['pipeline-stage'] | ||
|
||
let pullUrl | ||
|
||
if (pipelineName) { | ||
let pipelineData | ||
try { | ||
pipelineData = await heroku.get(`/pipelines/${pipelineName}`) | ||
} catch (err) { | ||
cli.error('problem fetching pipeline info') | ||
cli.exit(1, String(err)) | ||
} | ||
pullUrl = `/pipelines/${pipelineData.id}/stage/${pipelineStage}/config-vars` | ||
} else { | ||
if (!context.app) { | ||
cli.exit( | ||
1, | ||
'Must specify `--app` parameter, or `--pipeline-name` and `--pipeline-stage`' | ||
) | ||
} | ||
pullUrl = `/apps/${context.app}/config-vars` | ||
} | ||
return pullUrl | ||
}, | ||
{ name: 'quiet', char: 'q', description: 'supress all non-error output' }, | ||
{ | ||
name: 'expanded', | ||
char: 'e', | ||
description: 'allow non-standard characters in variable names' | ||
} | ||
] | ||
} |
Oops, something went wrong.