Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c358371
wait for workflows
verchol Dec 2, 2017
86f097c
add class
verchol Dec 3, 2017
b49bda4
fix
verchol Dec 3, 2017
4a9563b
added initial version of cli
verchol Dec 4, 2017
d715d68
fix context entity
ziv-codefresh Dec 7, 2017
b68f626
fix name function
ziv-codefresh Dec 7, 2017
d750f1c
update
ziv-codefresh Dec 8, 2017
f4c7c42
add describe to base class
ziv-codefresh Dec 10, 2017
6cfae0b
add support for pipeline get and describe + return an pipeline enitit…
ziv-codefresh Dec 10, 2017
8fe0210
add support for workflow & images & composition & environment -for ge…
ziv-codefresh Dec 12, 2017
5e591f6
fix pr notes
ziv-codefresh Dec 13, 2017
2f53e29
fix -o yaml
ziv-codefresh Dec 13, 2017
c78ac42
add get/describe composition by name
ziv-codefresh Dec 13, 2017
c4dd012
add support for delete/replace/create for compostion and support in d…
ziv-codefresh Dec 13, 2017
c600d37
add support for create composition throw arv vars
ziv-codefresh Dec 14, 2017
ddb8a9a
add support for delete environment
ziv-codefresh Dec 14, 2017
ba43f60
fix workflow entity and getall
ziv-codefresh Dec 14, 2017
68c2dfe
update cli to support get with envrionment name
ziv-codefresh Dec 18, 2017
5ba4882
add error handeling for get images
ziv-codefresh Dec 18, 2017
b626668
genearate data for all the entiteis in functions
ziv-codefresh Dec 18, 2017
be86110
add basic support for get auth contexts
ziv-codefresh Dec 18, 2017
54de69d
update
verchol Dec 19, 2017
14e4b3b
merge
verchol Dec 19, 2017
36dec26
merge
verchol Dec 20, 2017
919945b
merge with master
Dec 20, 2017
3a5fd13
refactor
verchol Dec 23, 2017
ce53a1c
Merge branch 'master' into add_wait_refactor
Dec 25, 2017
c6e721a
update
Dec 25, 2017
49c5d49
refactor all existing commands to be constructed using the new class
Dec 26, 2017
8209d0a
remove unddeded references
Dec 26, 2017
1f829c6
update
Dec 26, 2017
d7d055a
add relative path option
ziv-codefresh Dec 26, 2017
6f5ed61
update
Dec 26, 2017
dd45124
update
Dec 26, 2017
4f0686f
Merge branch 'add_wait_refactor' of github.com:codefresh-io/codefresh…
Dec 26, 2017
66f6be6
update
Dec 26, 2017
52b00e3
update
Dec 26, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/cfconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
contexts:
testcontext1:
type: JWT
name: testcontext1
url: 'https://g.codefresh.io'
token: >-
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJfaWQiOiI1NTJlOTQyMjM4MjQ4MzFkMDBiMWNhM2UiLCJhY2NvdW50SWQiOiI1NjgwZjEzMDM0Y2RiMzE3N2M4MmFjYjIiLCJpYXQiOjE1MTIyMzA5MDcsImV4cCI6MTUxNDgyMjkwN30.-OUq7kVLVghCjV4tp7swSzCyzPn-GR3ZF0A-aZo1ic0
acl-type: account
user-id: 552e94223824831d00b1ca3e
account-id: 5680f13034cdb3177c82acb2
expires: 1514822907
user-name: verchol
account-name: verchol_github
current-context: testcontext1
61 changes: 61 additions & 0 deletions lib/interface/cli/Command.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
const yargs = require('yargs');
const assert = require('assert');
const _ = require('lodash');
const { wrapHandler } = require('./helpers/general');

class Command {
constructor(command) {
this.command = command;
this.subCommands = [];
this.builders = [];
(_.isUndefined(command.handler)) ? command.handler = (args) => {
console.log(`i am ${command.description}`);

} : _.noop();
(_.isUndefined(command.builder)) ? _.noop() :
this.addBuilder(command.builder);

}

addBuilder(b) {
this.builders.push(b);
}

subCommand(command) {
this.subCommands.push(command);
return this;
}

toCommand() {
let command = this.command;
//assert(_.get(this.command, "builder", true));

let funcs = _.map(this.builders, (b) => {
return (yargs) => {
b(yargs);
_.forEach(this.subCommands, (subCommand) => {
// TODO use .toCommand here too
if (subCommand instanceof Command) {
yargs.command(subCommand.toCommand());
} else {
yargs.command(subCommand);
}
});
return yargs;
};
});

let builder = (yargs) => {
_.flow(funcs)(yargs);
};

command.builder = builder;
command.handler = wrapHandler(command.handler);
return command;

}

}


module.exports = Command;
44 changes: 0 additions & 44 deletions lib/interface/cli/commands/annotate/commands/image.js

This file was deleted.

5 changes: 0 additions & 5 deletions lib/interface/cli/commands/annotate/commands/index.js

This file was deleted.

23 changes: 0 additions & 23 deletions lib/interface/cli/commands/annotate/index.js

This file was deleted.

43 changes: 0 additions & 43 deletions lib/interface/cli/commands/apply/commands/context.js

This file was deleted.

7 changes: 0 additions & 7 deletions lib/interface/cli/commands/apply/commands/index.js

This file was deleted.

88 changes: 0 additions & 88 deletions lib/interface/cli/commands/apply/commands/pipeline.js

This file was deleted.

25 changes: 0 additions & 25 deletions lib/interface/cli/commands/apply/index.js

This file was deleted.

Loading