Skip to content

Commit

Permalink
doc: add gif for command line in readme (#4012)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlt authored and yesnault committed Mar 11, 2019
1 parent 903a141 commit a8527cd
Show file tree
Hide file tree
Showing 6 changed files with 255 additions and 14 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@ CDS is an Enterprise-Grade Continuous Delivery & DevOps Automation Platform writ
## Intuitive UI
CDS provides an intuitive UI that allows you to build complex workflows, run them and dig into the logs when needed.

<kbd>
<img src="./docs/static/images/capture-start.gif" alt="CDS Demonstration">
</kbd>
<p align="center">
<kbd>
<img src="./docs/static/images/capture-start.gif" alt="create and run workflow with CDS ui" title="create and run workflow with CDS ui">
</kbd>
<i>Create and run workflow with CDS ui.</i>
</p>

## The most powerful Command Line for a CI/CD Platform

cdsctl is the CDS Command Line - you can script everything with it, cdsctl also provide some cool commands such as `cdsctl shell` to browse your projects and workflows without the need to open a browser.

[See all cdsctl commands](https://ovh.github.io/cds/cli/cdsctl/#see-also)

<p align="center">
<img src="./docs/static/images/init_template_as_code.gif" alt="create workflow as code with CDS command line" title="create workflow as code with CDS command line">
<i>Create workflow as code with CDS command line.</i>
</p>

## Want a try?

Expand Down
19 changes: 10 additions & 9 deletions cli/cdsctl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/dgrijalva/jwt-go"
"github.com/fsamin/go-repo"
"github.com/pkg/errors"

"github.com/ovh/cds/cli"
"github.com/ovh/cds/sdk"
Expand Down Expand Up @@ -192,11 +193,11 @@ func discoverConf(ctx []cli.Arg) ([]string, error) {
if needConfirmation {
fetchURL, err := r.FetchURL()
if err != nil {
return nil, err
return nil, errors.Wrap(err, "cannot get url from local git repository")
}
name, err := r.Name()
if err != nil {
return nil, err
return nil, errors.Wrap(err, "cannot get name from local git repository")
}
repoExists = cli.AskForConfirmation(fmt.Sprintf("Detected repository as %s (%s). Is it correct?", name, fetchURL))
}
Expand Down Expand Up @@ -227,7 +228,7 @@ func discoverConf(ctx []cli.Arg) ([]string, error) {
if repoExists {
name, err := r.Name()
if err != nil {
return nil, err
return nil, errors.Wrap(err, "cannot get name from current repository")
}
ps, err := client.ProjectList(true, true, cdsclient.Filter{Name: "repo", Value: name})
if err != nil {
Expand Down Expand Up @@ -267,7 +268,7 @@ func discoverConf(ctx []cli.Arg) ([]string, error) {
if !cli.AskForConfirmation(fmt.Sprintf("Found one CDS project '%s - %s'. Is it correct?", projects[0].Key, projects[0].Name)) {
// there is no filter on repo so there was only one choice possible
if !repoExists {
return nil, fmt.Errorf("Can't find a project to use")
return nil, errors.New("can't find a project to use")
}
} else {
project = &projects[0]
Expand Down Expand Up @@ -296,7 +297,7 @@ func discoverConf(ctx []cli.Arg) ([]string, error) {
projectKey = project.Key
if repoExists {
if err := r.LocalConfigSet("cds", "project", projectKey); err != nil {
return nil, err
return nil, errors.Wrap(err, "cannot set local git configuration")
}
}

Expand Down Expand Up @@ -325,15 +326,15 @@ func discoverConf(ctx []cli.Arg) ([]string, error) {
}
}
if application == nil && !mctx[_ApplicationName].AllowEmpty {
return nil, fmt.Errorf("Can't find an application to use")
return nil, errors.New("can't find an application to use")
}

// set application name and override repository config if exists
applicationName = application.Name
if application != nil {
if repoExists {
if err := r.LocalConfigSet("cds", "application", applicationName); err != nil {
return nil, err
return nil, errors.Wrap(err, "cannot set local git configuration")
}
}
}
Expand Down Expand Up @@ -364,15 +365,15 @@ func discoverConf(ctx []cli.Arg) ([]string, error) {
}
}
if workflow == nil && !mctx[_WorkflowName].AllowEmpty {
return nil, fmt.Errorf("Can't find a workflow to use")
return nil, errors.New("can't find a workflow to use")
}

// set workflow name and override repository config if exists
if workflow != nil {
workflowName = workflow.Name
if repoExists {
if err := r.LocalConfigSet("cds", "workflow", workflowName); err != nil {
return nil, err
return nil, errors.Wrap(err, "cannot set local git configuration")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cobra.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func newCommand(c Command, run interface{}, subCommands SubCommands, mods ...Com
cmd.Run = func(cmd *cobra.Command, args []string) {
if c.PreRun != nil {
if err := c.PreRun(&c, &args); err != nil {
ExitOnError(ErrWrongUsage, cmd.Help)
ExitOnError(err)
return
}
}
Expand Down
Loading

0 comments on commit a8527cd

Please sign in to comment.