File tree Expand file tree Collapse file tree 4 files changed +101
-1
lines changed
lib/interface/cli/commands/analyzer Expand file tree Collapse file tree 4 files changed +101
-1
lines changed Original file line number Diff line number Diff line change
1
+ const _ = require ( 'lodash' ) ;
2
+ const Command = require ( '../../Command' ) ;
3
+ const Logic = require ( './analyzer.logic' ) ;
4
+
5
+ const command = new Command ( {
6
+ root : true ,
7
+ command : 'analyze <repoOwner> <repoName> [context]' ,
8
+ description : 'Analyze your repo' ,
9
+ webDocs : {
10
+ category : 'Analyzer' ,
11
+ title : 'Analyze'
12
+ } ,
13
+ builder : yargs => yargs
14
+ . positional ( 'repoOwner' , {
15
+ describe : 'Repository owner' ,
16
+ required : true ,
17
+ } )
18
+ . positional ( 'repoName' , {
19
+ describe : 'Repository name' ,
20
+ required : true ,
21
+ } )
22
+ . positional ( 'context' , {
23
+ describe : 'Your git context that you can get from integrations -> git , if empty - using personal context' ,
24
+ required : false
25
+ } )
26
+ . example ( 'codefresh analyze petlove bee github' , 'Analyze repo' ) ,
27
+ handler : async ( argv ) => {
28
+ const { repoOwner, repoName, context } = argv ;
29
+ const yaml = await Logic . analyze ( { repoOwner, repoName, context} ) ;
30
+ console . log ( yaml ) ;
31
+ } ,
32
+ } ) ;
33
+
34
+ module . exports = command ;
Original file line number Diff line number Diff line change
1
+ /* eslint-disable no-use-before-define,object-curly-newline,arrow-body-style */
2
+
3
+ const { sdk } = require ( '../../../../logic' ) ;
4
+
5
+ class AnalyzerLogic {
6
+
7
+ static async analyze ( { repoOwner, repoName, context } ) {
8
+
9
+ const repo = {
10
+ repoOwner,
11
+ repoName,
12
+ git : context ,
13
+ } ;
14
+
15
+ return sdk . pipelines . analyze ( {
16
+ repo,
17
+ type : 'git' ,
18
+ source : 'api'
19
+ } ) ;
20
+ }
21
+
22
+ }
23
+
24
+ module . exports = AnalyzerLogic ;
Original file line number Diff line number Diff line change 1506
1506
"x-sdk-interface" : " onPrem.runtimeEnvs.plan.get"
1507
1507
}
1508
1508
},
1509
+
1510
+ "/pipelines/analyze" : {
1511
+ "post" : {
1512
+ "responses" : {
1513
+ "200" : {
1514
+ "$ref" : " #/components/responses/json"
1515
+ }
1516
+ },
1517
+ "tags" : [
1518
+ " pipelines"
1519
+ ],
1520
+ "operationId" : " pipelines-analyze" ,
1521
+ "parameters" : [],
1522
+ "requestBody" : {
1523
+ "$ref" : " #/components/requestBodies/pipelines_analyze"
1524
+ },
1525
+ "summary" : " Analyze pipeline" ,
1526
+ "x-sdk-interface" : " pipelines.analyze"
1527
+ }
1528
+ },
1529
+
1509
1530
"/annotations" : {
1510
1531
"delete" : {
1511
1532
"responses" : {
6865
6886
},
6866
6887
"required" : true
6867
6888
},
6889
+ "pipelines_analyze" : {
6890
+ "content" : {
6891
+ "application/json" : {
6892
+ "schema" : {
6893
+ "properties" : {
6894
+ "repo" : {
6895
+ "type" : " object"
6896
+ },
6897
+ "type" : {
6898
+ "type" : " string"
6899
+ },
6900
+ "source" : {
6901
+ "type" : " string"
6902
+ }
6903
+ },
6904
+ "type" : " object"
6905
+ }
6906
+ }
6907
+ },
6908
+ "required" : true
6909
+ },
6868
6910
"abac" : {
6869
6911
"content" : {
6870
6912
"application/json" : {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " codefresh" ,
3
- "version" : " 0.20.2 " ,
3
+ "version" : " 0.20.3 " ,
4
4
"description" : " Codefresh command line utility" ,
5
5
"main" : " index.js" ,
6
6
"preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments