From 69a47f380fe44666bd6a2e26372eae20de8868d7 Mon Sep 17 00:00:00 2001 From: Itai Gendler Date: Sat, 13 Jan 2018 11:38:04 +0200 Subject: [PATCH] Update documentation with pipeline entity --- _config.yml | 1 - docs-template/content/authentication.md | 5 +- docs-template/content/pipelines.md | 130 ++++++++++----- docs/index.html | 208 ++++++++++++++++++------ docs/index.xml | 32 ++-- docs/sitemap.xml | 6 +- package.json | 3 +- 7 files changed, 286 insertions(+), 99 deletions(-) delete mode 100644 _config.yml diff --git a/_config.yml b/_config.yml deleted file mode 100644 index c4192631f..000000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-cayman \ No newline at end of file diff --git a/docs-template/content/authentication.md b/docs-template/content/authentication.md index 93b93654e..ce38cf551 100644 --- a/docs-template/content/authentication.md +++ b/docs-template/content/authentication.md @@ -7,7 +7,8 @@ title: Authentication ## Basic Usage In order to start working with the cli you will need to update the authentication configuration.
-Generate a new API key through the account settings page.
-Once you have the API key, create a new authentication context: `codefresh auth create-context --api-key {API_KEY}` +Generate a new API key through the account settings page. + +Once you have the API key, create a new authentication context:
`codefresh auth create-context --api-key {API_KEY}` ## Advanced Usage diff --git a/docs-template/content/pipelines.md b/docs-template/content/pipelines.md index 449bc1e47..3ff74f486 100644 --- a/docs-template/content/pipelines.md +++ b/docs-template/content/pipelines.md @@ -3,56 +3,112 @@ weight: 40 title: Pipelines --- -# Kittens +# Pipelines -## Get All Kittens +## Get All Pipelines ```cli -package main +$ codefresh get pipelines +``` -import "github.com/bep/kittn/auth" +```string +ID NAME REPOOWNER REPONAME +55fa65a21058fb6778dc5eef codefresh-io codefresh-io codefresh-io +55fa65a21058fb6778dc5f19 repo-analyser verchol repo-analyser +55fa65a21058fb6778dc5f4f engine codefresh-io engine +55fa65a21058fb6778dc5f55 git-clone codefresh-io cf-base-images +``` -func main() { - api := auth.Authorize("meowmeowmeow") +```cli +$ codefresh get pipelines --name engine +``` - _ = api.GetKittens() -} +```string +ID NAME REPOOWNER REPONAME +55fa65a21058fb6778dc5f4f engine codefresh-io engine ``` -> The above command returns JSON structured like this: +```cli +$ codefresh get pipelines --repo-name repo-analyser +``` -```json -[ - { - "id": 1, - "name": "Fluffums", - "breed": "calico", - "fluffiness": 6, - "cuteness": 7 - }, - { - "id": 2, - "name": "Max", - "breed": "unknown", - "fluffiness": 5, - "cuteness": 10 - } -] +```string +ID NAME REPOOWNER REPONAME +55fa65a21058fb6778dc5f19 repo-analyser verchol repo-analyser ``` -This endpoint retrieves all kittens. +```cli +$ codefresh get pipelines --repo-owner codefresh-io +``` + +```string +ID NAME REPOOWNER REPONAME +55fa65a21058fb6778dc5eef codefresh-io codefresh-io codefresh-io +55fa65a21058fb6778dc5f4f engine codefresh-io engine +55fa65a21058fb6778dc5f55 git-clone codefresh-io cf-base-images +``` + +This command will retrieve an array of pipelines according to the passed filters. + +### Command + +`codefresh get pipelines`
+ +### Aliases + + + +### Filter Options + +Option | Default | Description +--------- | ----------- | ----------- +--repo-owner | | Filter pipelines by repository owner. +--repo-name | | Filter pipelines by repository name. +--name | | Filter pipelines by pipeline name. + +### Output Options + +Option | Default | Description +--------- | ----------- | ----------- +--output | | Output format [choices: "json", "yaml", "wide", "name"]. +--watch | false | If set to true, the output will continue to get updated. +--watch-interval | 3 | Interval time to get updates from the server. +--limit | 25 | Limit amount of returned results. +--page | 1 | Get a specific set of results according to the defined limit option. + + +## Get a Single Pipeline + +```cli +$ codefresh get pipeline 55fa65a21058fb6778dc5eef +``` + +> The above command returns a structured table like this: + +```string +ID NAME REPOOWNER REPONAME +55fa65a21058fb6778dc5eef codefresh-io codefresh-io codefresh-io +``` + +This command will retrieve a single pipeline. + +### Command -### HTTP Request +`codefresh get pipeline {ID}` -`GET http://example.com/api/kittens` +### Positionals arguments -### Query Parameters +Argument | Description +--------- | ----------- +id | Pipeline id. -Parameter | Default | Description ---------- | ------- | ----------- -include_cats | false | If set to true, the result will also include cats. -available | true | If set to false, the result will include kittens that have already been adopted. +### Output Options - +Option | Default | Description +--------- | ----------- | ----------- +--output | | Output format [choices: "json", "yaml", "wide", "name"]. +--watch | false | If set to true, the output will continue to get updated. +--watch-interval | 3 | Interval time to get updates from the server. diff --git a/docs/index.html b/docs/index.html index 3ec457ec1..4e1ee470c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -51,6 +51,21 @@ +

Introduction

+ +

Welcome to Codefresh’s official CLI documentation!

+ +

Codefresh CLI provides a full and flexible interface to interact with Codefresh.
+The CLI can be used to achieve the following: +

+ + + +

Installation

Codefresh CLI is developed and built with node.js. @@ -116,60 +131,159 @@

Docker image

-

Introduction

+

Authentication

-

Welcome to Codefresh’s official CLI documentation!

+

Basic Usage

+ +

In order to start working with the cli you will need to update the authentication configuration.
+Generate a new API key through the account settings page.

-

Installation

+

Once you have the API key, create a new authentication context:
codefresh auth create-context --api-key {API_KEY}

-

From Binaries

+

Advanced Usage

-

Kittens

+

Pipelines

+ +

Get All Pipelines

+
$ codefresh get pipelines
ID                       NAME               REPOOWNER          REPONAME
+55fa65a21058fb6778dc5eef codefresh-io       codefresh-io       codefresh-io
+55fa65a21058fb6778dc5f19 repo-analyser      verchol            repo-analyser
+55fa65a21058fb6778dc5f4f engine             codefresh-io       engine
+55fa65a21058fb6778dc5f55 git-clone          codefresh-io       cf-base-images
$ codefresh get pipelines --name engine
ID                       NAME               REPOOWNER          REPONAME
+55fa65a21058fb6778dc5f4f engine             codefresh-io       engine
$ codefresh get pipelines --repo-name repo-analyser
ID                       NAME               REPOOWNER          REPONAME
+55fa65a21058fb6778dc5f19 repo-analyser      verchol            repo-analyser
$ codefresh get pipelines --repo-owner codefresh-io
ID                       NAME               REPOOWNER          REPONAME
+55fa65a21058fb6778dc5eef codefresh-io       codefresh-io       codefresh-io
+55fa65a21058fb6778dc5f4f engine             codefresh-io       engine
+55fa65a21058fb6778dc5f55 git-clone          codefresh-io       cf-base-images
+

This command will retrieve an array of pipelines according to the passed filters.

+ +

Command

+ +

codefresh get pipelines

+ +

Aliases

+ + + +

Filter Options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefaultDescription
–repo-ownerFilter pipelines by repository owner.
–repo-nameFilter pipelines by repository name.
–nameFilter pipelines by pipeline name.
+ +

Output Options

+ + + + + + + + + + + + + + + + + + + + + + -

Get All Kittens

-
package main
+
+ + + + -import "github.com/bep/kittn/auth" + + + + + -func main() { - api := auth.Authorize("meowmeowmeow") + + + + + + +
OptionDefaultDescription
–outputOutput format [choices: “json”, “yaml”, “wide”, “name”].
–watchfalseIf set to true, the output will continue to get updated.
–watch-interval3Interval time to get updates from the server.
–limit25Limit amount of returned results.
–page1Get a specific set of results according to the defined limit option.
- _ = api.GetKittens() -} +

Get a Single Pipeline

+
$ codefresh get pipeline 55fa65a21058fb6778dc5eef
-

The above command returns JSON structured like this:

+

The above command returns a structured table like this:

-
[
-  {
-    "id": 1,
-    "name": "Fluffums",
-    "breed": "calico",
-    "fluffiness": 6,
-    "cuteness": 7
-  },
-  {
-    "id": 2,
-    "name": "Max",
-    "breed": "unknown",
-    "fluffiness": 5,
-    "cuteness": 10
-  }
-]
-

This endpoint retrieves all kittens.

- -

HTTP Request

- -

GET http://example.com/api/kittens

- -

Query Parameters

+
ID                       NAME               REPOOWNER          REPONAME
+55fa65a21058fb6778dc5eef codefresh-io       codefresh-io       codefresh-io
+

This command will retrieve a single pipeline.

+ +

Command

+ +

codefresh get pipeline {ID}

+ +

Positionals arguments

- + + + + + + + + + + + +
ParameterArgumentDescription
idPipeline id.
+ +

Output Options

+ + + + + @@ -177,23 +291,25 @@

Query Parameters

- + + + + + + + - + - - - + + +
Option Default Description
include_cats–outputOutput format [choices: “json”, “yaml”, “wide”, “name”].
–watch falseIf set to true, the result will also include cats.If set to true, the output will continue to get updated.
availabletrueIf set to false, the result will include kittens that have already been adopted.–watch-interval3Interval time to get updates from the server.
- - diff --git a/docs/index.xml b/docs/index.xml index 4234718fd..dc68cf1f5 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -11,7 +11,18 @@ - API Reference + Introduction + http://cli.codefresh.io/introduction/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://cli.codefresh.io/introduction/ + Introduction Welcome to Codefresh’s official CLI documentation! +Codefresh CLI provides a full and flexible interface to interact with Codefresh. +The CLI can be used to achieve the following: Perform any opeartion you would be able to do through the UI Create complex automations from your local machine Run complex pipeline use cases by using the CLI inside your pipeline steps + + + + Installation http://cli.codefresh.io/installation/ Mon, 01 Jan 0001 00:00:00 +0000 @@ -25,25 +36,24 @@ Update to latest version: npm install -g codefresh - API Reference - http://cli.codefresh.io/introduction/ + Authentication + http://cli.codefresh.io/authentication/ Mon, 01 Jan 0001 00:00:00 +0000 - http://cli.codefresh.io/introduction/ - Introduction Welcome to Codefresh’s official CLI documentation! -Installation From Binaries + http://cli.codefresh.io/authentication/ + Authentication Basic Usage In order to start working with the cli you will need to update the authentication configuration. Generate a new API key through the account settings page. +Once you have the API key, create a new authentication context: +codefresh auth create-context --api-key {API_KEY} +Advanced Usage - API asdsad + Pipelines http://cli.codefresh.io/pipelines/ Mon, 01 Jan 0001 00:00:00 +0000 http://cli.codefresh.io/pipelines/ - Kittens Get All Kittens package main import "github.com/bep/kittn/auth" func main() { api := auth.Authorize("meowmeowmeow") _ = api.GetKittens() } The above command returns JSON structured like this: - [ { "id": 1, "name": "Fluffums", "breed": "calico", "fluffiness": 6, "cuteness": 7 }, { "id": 2, "name": "Max", "breed": "unknown", "fluffiness": 5, "cuteness": 10 } ] This endpoint retrieves all kittens. -HTTP Request GET http://example.com/api/kittens -Query Parameters Parameter Default Description include_cats false If set to true, the result will also include cats. + Pipelines Get All Pipelines $ codefresh get pipelinesID NAME REPOOWNER REPONAME 55fa65a21058fb6778dc5eef codefresh-io codefresh-io codefresh-io 55fa65a21058fb6778dc5f19 repo-analyser verchol repo-analyser 55fa65a21058fb6778dc5f4f engine codefresh-io engine 55fa65a21058fb6778dc5f55 git-clone codefresh-io cf-base-images$ codefresh get pipelines --name engineID NAME REPOOWNER REPONAME 55fa65a21058fb6778dc5f4f engine codefresh-io engine$ codefresh get pipelines --repo-name repo-analyserID NAME REPOOWNER REPONAME 55fa65a21058fb6778dc5f19 repo-analyser verchol repo-analyser$ codefresh get pipelines --repo-owner codefresh-ioID NAME REPOOWNER REPONAME 55fa65a21058fb6778dc5eef codefresh-io codefresh-io codefresh-io 55fa65a21058fb6778dc5f4f engine codefresh-io engine 55fa65a21058fb6778dc5f55 git-clone codefresh-io cf-base-images This command will retrieve an array of pipelines according to the passed filters. diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 5d560871b..c3fbf34a3 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -2,12 +2,16 @@ + + http://cli.codefresh.io/introduction/ + + http://cli.codefresh.io/installation/ - http://cli.codefresh.io/introduction/ + http://cli.codefresh.io/authentication/ diff --git a/package.json b/package.json index 8962dbab2..c69ac05c2 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "eslint": "eslint lib/logic/**", "ci-publish": "ci-publish", "pkg": "pkg . -t node9-macos-x64,node9-linux-x64,node9-win-x64 --out-path ./dist", - "docs": "cd docs && hugo server -D" + "serve-docs": "cd docs-template && hugo server -D", + "build-docs": "cd docs-template && hugo" }, "bin": { "codefresh": "./lib/interface/cli/codefresh"