Giter Site home page Giter Site logo

cli's People

Contributors

commanderk5 avatar damjanbecirovic avatar darkofabijan avatar dexyk avatar hamir-suspect avatar lucaspin avatar mactsouk avatar mattrym avatar milica-nerlovic avatar mimimalizam avatar radwo avatar ralopes avatar rnestler avatar shiroyasha avatar skipi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

sem stop with workflow ID

I'm wondering why we introduced sem stop pipeline but not sem stop workflow?

Workflow is the equivalent of "build" in S1, so that's what I have open in my web browser most of the time. Stopping the whole thing because I made a mistake in config file is exactly what I want, and I can easily copy the workflow ID from the address bar. Whereas I don't know how to get ID of the pipeline.

sem command breaks

Apart from sem version that works, sem delete project S2, sem get projects and sem get secrets break:

The output of sem get secrets is the following:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x13a9fb1]

goroutine 1 [running]:
github.com/renderedtext/sem/cmd.RunGet(0x16d1840, 0xc420049110, 0x1, 0x1)
	/home/runner/workspace/src/github.com/renderedtext/sem/cmd/get.go:30 +0x71
github.com/renderedtext/sem/cmd.glob..func6(0x16d1840, 0xc420049110, 0x1, 0x1)
	/home/runner/workspace/src/github.com/renderedtext/sem/cmd/get.go:16 +0x49
github.com/spf13/cobra.(*Command).execute(0x16d1840, 0xc4200490d0, 0x1, 0x1, 0x16d1840, 0xc4200490d0)
	/home/runner/workspace/src/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/spf13/cobra.(*Command).ExecuteC(0x16d0540, 0x16f79da, 0xc42012bf38, 0xc42012bf40)
	/home/runner/workspace/src/github.com/spf13/cobra/command.go:852 +0x334
github.com/spf13/cobra.(*Command).Execute(0x16d0540, 0x0, 0x1)
	/home/runner/workspace/src/github.com/spf13/cobra/command.go:800 +0x2b
github.com/renderedtext/sem/cmd.Execute()
	/home/runner/workspace/src/github.com/renderedtext/sem/cmd/root.go:37 +0x31
main.main()
	/home/runner/workspace/src/github.com/renderedtext/sem/main.go:6 +0x20```

use EDITOR env var

I was very frustrated to find that my $EDITOR or $VISUAL env var had no effect. please use standards.

Cannot add project

Does this mean that project with same name is already added or something else is the issue?

✲ demo [1 hidden] (⎈ |s2prod:default) (master) sem init
error: repository is already initialized

Wrong messages in apply and create

Example:

Missing newline:

✲ sem apply -f /tmp/a.yml
Unknown resource kind ''%

Missing newline, and the message says 'created' instead of 'updated'

✲ sem apply -f /tmp/a.yml
Secret test10 created.%

Missing newlines:

✲ sem create -f /tmp/a.yml
Dashboard my-work-3 created.%

In Zsh, % signifies the missing newline.

`sem edit mySecrets` crashes `sem`

$ sem version
v0.5.0-preview1
$ sem edit mySecrets
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/renderedtext/sem/cmd.RunEdit(0x16dffc0, 0xc42004b120, 0x1, 0x1)
	/home/semaphore/go/src/github.com/renderedtext/sem/cmd/edit.go:26 +0xc4
github.com/renderedtext/sem/cmd.glob..func9(0x16dffc0, 0xc42004b120, 0x1, 0x1)
	/home/semaphore/go/src/github.com/renderedtext/sem/cmd/edit.go:16 +0x49
github.com/spf13/cobra.(*Command).execute(0x16dffc0, 0xc42004b0e0, 0x1, 0x1, 0x16dffc0, 0xc42004b0e0)
	/home/semaphore/go/src/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/spf13/cobra.(*Command).ExecuteC(0x16e0480, 0xc42012bf30, 0xc42012bf38, 0x13b448e)
	/home/semaphore/go/src/github.com/spf13/cobra/command.go:852 +0x334
github.com/spf13/cobra.(*Command).Execute(0x16e0480, 0x0, 0x16e06e0)
	/home/semaphore/go/src/github.com/spf13/cobra/command.go:800 +0x2b
github.com/renderedtext/sem/cmd.Execute()
	/home/semaphore/go/src/github.com/renderedtext/sem/cmd/root.go:37 +0x31
main.main()
	/home/semaphore/go/src/github.com/renderedtext/sem/main.go:6 +0x20

`sem create project aName` crashes

$ sem create project aName
error: Failed to read from resource file.
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/semaphoreci/cli/cmd.glob..func7(0x1808be0, 0xc000092980, 0x2, 0x2)
	/home/semaphore/cli/cmd/create.go:37 +0x83a
github.com/spf13/cobra.(*Command).execute(0x1808be0, 0xc000092900, 0x2, 0x2, 0x1808be0, 0xc000092900)
	/home/semaphore/go/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x2cc
github.com/spf13/cobra.(*Command).ExecuteC(0x180bb60, 0x180bdc0, 0xc000111f50, 0x13c76ae)
	/home/semaphore/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2fd
github.com/spf13/cobra.(*Command).Execute(0x180bb60, 0x1005380, 0xc00006c058)
	/home/semaphore/go/pkg/mod/github.com/spf13/[email protected]/command.go:800 +0x2b
github.com/semaphoreci/cli/cmd.Execute()
	/home/semaphore/cli/cmd/root.go:37 +0x2d
main.main()
	/home/semaphore/cli/main.go:6 +0x20
$ sem version
v0.7.5

Empty api version and kind while getting resources

Example:

✲ sem get secrets abc
apiVersion: ""
kind: ""
metadata:
  name: abc
  id: 297fcb54-0fd7-4ae0-b682-86b3eded6ded
  create_time: "1536600478"
  update_time: "1536918023"
data:
  env_vars:
  - name: A
    value: B
  files: []

Erroneous YAML file to `sem apply -f` panics

$ cat /tmp/aFile
apiVersion: v1beta
kind: Secret
metadata:
  name: my-secrets
  id: 24d1932b-1c9b-4068-ac6a-1845a7816889
  create_time: 1536679082
  update_time: 1536755195
data:
  - name: SECRET_ONE
  - name: SECRET_TWO
  files:
  - path: file.txt
    content: BbXQo=

Generates the following output:

$ sem apply -f /tmp/aFile
error: Failed to parse resource file.
panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/semaphoreci/cli/cmd.RunApply(0x17f1f00, 0xc00000a8c0, 0x0, 0x2)
	/home/semaphore/cli/cmd/apply.go:42 +0x32f
github.com/semaphoreci/cli/cmd.glob..func1(0x17f1f00, 0xc00000a8c0, 0x0, 0x2)
	/home/semaphore/cli/cmd/apply.go:18 +0x49
github.com/spf13/cobra.(*Command).execute(0x17f1f00, 0xc00000a880, 0x2, 0x2, 0x17f1f00, 0xc00000a880)
	/home/semaphore/go/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x2cc
github.com/spf13/cobra.(*Command).ExecuteC(0x17f1a40, 0x17f1ca0, 0xc0000fbf50, 0x13c163e)
	/home/semaphore/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2fd
github.com/spf13/cobra.(*Command).Execute(0x17f1a40, 0x1005380, 0xc00006c058)
	/home/semaphore/go/pkg/mod/github.com/spf13/[email protected]/command.go:800 +0x2b
github.com/semaphoreci/cli/cmd.Execute()
	/home/semaphore/cli/cmd/root.go:37 +0x2d
main.main()
	/home/semaphore/cli/main.go:6 +0x20

sem create notification does not work with aliases

$ sem create notif
$ sem create notification
$ sem create notifs
panic: runtime error: index out of range
...

This works as expected:

$ sem create notifications
error: Failed to read from resource file.

This also happens with other commands:

$ sem create jobs
$ sem create job

sem version is v0.8.10.

Sem CLI collision with old Sem CLI

The Sem CLI can collide with the S1 sem CLI. To mitigate this, we should check the existence of a sem command that is not in the expected path in the installation script, stop and ask the user to remove the old one.

`sem init` looks successful but URL for project does not work

Project is created. You can find it at https://tsoukalos.semaphoreci.com/projects/secretsInvalid.

To run your first pipeline execute:

  git add .semaphore/semaphore.yml && git commit -m "First pipeline" && git push

However, https://tsoukalos.semaphoreci.com/projects/secretsInvalid does not work.

sem init does not talk about .semaphore.yml + Project not added to S2

$ ls -al
total 24
drwxr-xr-x   6 mtsouk  staff   192 Jul  2 17:23 .
drwxr-xr-x@ 13 mtsouk  staff   416 Jul  2 17:23 ..
drwxr-xr-x  13 mtsouk  staff   416 Jul  2 17:23 .git
-rw-r--r--   1 mtsouk  staff  1014 Jul  2 17:23 .semaphore.yml
-rw-r--r--   1 mtsouk  staff    34 Jul  2 17:23 README.md
-rw-r--r--   1 mtsouk  staff   161 Jul  2 17:23 hw.go
$ sem init
error: repository is already initialized 
$ sem get projects
NAME
anotherSecret
secrets
S1

The name of the project is S2 and was not added to Semaphore 2.0.

Display info about SSH session

Motivated by the following question on support:

"Tried to do ssh to remote host but did not find my app folder at all."


One idea could be to display something like this when we jump into the box:

screen shot 2018-12-14 at 11 14 39 am

Here we could point out:

  • Where are your commands stored
  • Duration of this SSH session and that you need to close it
  • How to checkout your code

sem create job myjob --project ...

$ sem create job myjob --project S1 --command "ls -l"
Job '6ae18c12-7341-48d8-9283-5447992e77b6' created.
$ sem logs 6ae18c12-7341-48d8-9283-5447992e77b6

The sem logs command returns no output and the job is shows as FAILED in sem get jobs --all.

Can't set editor to "subl --wait"

Fails with:

error: Failed to open editor 'exec: "subl --wait": executable file not found in $PATH'

Which is obviously correct, there is no file called "subl --wait". --wait is a flag, not part of the filename.

Save a version of YAML resource if edit fails

Example from kubernetes world:

semaphore@semaphore-vm:~/istio-playground$ kc edit virtualservice hello
error: virtualservices.networking.istio.io "hello" is invalid
A copy of your changes has been stored to "/tmp/kubectl-edit-7tb06.yaml"
error: Edit cancelled, no valid changes were saved.

NIcer error messages

If the response is a parsable JSON, extract message:

Current:

error: http status 400 with message "{"error":"Pattern /*/ is not a valid regex statement","message":"Pattern /*/ is not a valid regex statement","code":3}" received from upstream

Desired:

error: Pattern /*/ is not a valid regex statement

Sem init project url is broken

✲ sem init
Project is created. You can find it at https:///projects/yapi.

To run your first pipeline execute:

  git add .semaphore.yml && git commit -m "First pipeline" && git push

Simple way to create a dashboard

sem create dashboard product-team-master --projects "cli,ui,api-v1" --branch master

Creates a dashboard that display all pipelines from the master branch on projects a, b, and c.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.