Giter Site home page Giter Site logo

jenkins-zh / jenkins-cli Goto Github PK

View Code? Open in Web Editor NEW
379.0 12.0 77.0 6.54 MB

Jenkins CLI allows you to manage your Jenkins in an easy way. Jenkins 命令行客户端

Home Page: http://www.jenkins-zh.cn/jenkins-cli/

License: MIT License

Makefile 0.99% Go 98.98% Dockerfile 0.04%
jenkins cli client golang jcli jenkins-cli hacktoberfest

jenkins-cli's Introduction

This file was generated by README.tpl via yaml-readme, please don't edit it directly!

Quick start

简体中文

Jenkins CLI

Gitpod ready-to-code codecov Contributors GitHub release GitHub All Releases Docker Pulls GitHub code size in bytes HitCount

Jenkins CLI allows you manage your Jenkins in an easy way. No matter if you're a plugin developer, administrator or just a regular user, it is made for you!

Features

  • Multiple Jenkins support
  • Plugins management (list, search, install, upload)
  • Job management (search, build, log)
  • Configuration as Code support
  • Open your Jenkins with a browser
  • Restart your Jenkins
  • Connection with proxy support

Get it

We support macOS, Linux and Windows for now. Packaging status

macOS

You can use brew to install jcli.

brew tap jenkins-zh/jcli
brew install jcli

Alternatively, you can use MacPorts.

sudo port install jenkins-cli

For MacPorts, add +bash_completion or +zsh_completion for shell completion.

Linux

To install jcli on your Linux OS, execute the following command:

curl -L https://github.com/jenkins-zh/jenkins-cli/releases/latest/download/jcli-linux-amd64.tar.gz|tar xzv
sudo mv jcli /usr/local/bin/

Windows

You can install jcli via scoop or choco.

Or you can also find the latest version from the release page. Download the zip file and copy the uncompressed jcli directory into your system path.

Other package managers

Here are other package managers:

Install Upgrade Uninstall Platform
scoop install jcli Windows
choco install jcli choco upgrade jcli choco uninstall jcli Windows
snap install jcli snap refresh jcli snap remove jcli Linux
sudo port install jenkins-cli sudo port selfupdate && sudo port upgrade jenkins-cli sudo port uninstall jenkins-cli macOS

See more about how to download jcli. You can find the download details from here.

Get started

Read the official document for more details on how to use jcli.

Or, you can take a live interactive course of Jenkins CLI.

Plugins

Jenkins CLI could have more features by installing a plugin for it. You can install a plugin by the following command:

jcli config plugin fetch
jcli config plugin install account

All official plugins could be found at here.

Contribution

If you're interested in this project. Please go through the contribution guide. Any contributions are welcome.

Thanks to JetBrains for giving us the open source licence.
goland.svg

Similar Projects

There're a few similar projects that you might be interested in:

  • jenni is a Jenkins Personal Assistant
  • jenkins-job-cli Easy way to run Jenkins job from the Command Line

Stargazers over time

Star History Chart

License

FOSSA Status

jenkins-cli's People

Contributors

afkbrb avatar anxk avatar dependabot-preview[bot] avatar dependabot[bot] avatar donhui avatar fossabot avatar gocruncher avatar harens avatar jxr98 avatar k8scat avatar linuxsuren avatar maxzirps avatar oleg-nenashev avatar sbcd90 avatar scottydocs avatar sikmir avatar sladyn98 avatar wangxiangustc avatar wxharry avatar yjuns 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar

jenkins-cli's Issues

Add support to add or del a user

API is /securityRealm/createAccountByAdmin

payload should be json: {"username": "abc", "password1": "abc", "$redact": ["password1", "password2"], "password2": "abc", "fullname": "abc", "email": "[email protected]", "Jenkins-Crumb": "675d33520ed8c07d8ac40e44015a3b2b"}

the request should be POST

No clear description about how to delete a nested folder

Execute cmd jcli job delete "rick folder" -b. Then will got error output:

status code: 404
2019/07/27 09:24:41 <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing //job/rick%20folder/doDelete. Reason:
<pre>    Not Found</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>

</body>
</html>

Job build error

[root@master ~]# jcli job search publish |grep demo
      "Name": "test_publish_demo"
      "Name": "ops_auto_dev_go_publish_demo"
      "Name": "ops_auto_pre_go_publish_demo"
      "Name": "ops_all_pkg_java_publish_demo"
      "Name": "ops_auto_dev_go_publish_demo1"
[root@master ~]# jcli job build -n test_publish_demo
? Are you sure to build job test_publish_demo Yes
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x6bf987]

goroutine 1 [running]:
github.com/linuxsuren/jenkins-cli/client.(*JenkinsCore).CrumbHandle(0xc00018fcf0, 0xc0001c6000, 0xd, 0xc000015e80)
 /Users/mac/go/src/github.com/linuxsuren/jenkins-cli/client/core.go:55 +0x47
github.com/linuxsuren/jenkins-cli/client.(*JobClient).Build(0xc00018fcf0, 0x7ffd543466c8, 0x11, 0x1, 0x1)
 /Users/mac/go/src/github.com/linuxsuren/jenkins-cli/client/job.go:72 +0x31b
github.com/linuxsuren/jenkins-cli/app/cmd.glob..func9(0xbdac60, 0xc00016c160, 0x0, 0x2)
 /Users/mac/go/src/github.com/linuxsuren/jenkins-cli/app/cmd/job_build.go:43 +0x235
github.com/spf13/cobra.(*Command).execute(0xbdac60, 0xc00016c100, 0x2, 0x2, 0xbdac60, 0xc00016c100)
 /Users/mac/go/src/github.com/spf13/cobra/command.go:766 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0xbdc1c0, 0x869843, 0x1, 0x0)
 /Users/mac/go/src/github.com/spf13/cobra/command.go:852 +0x2ec
github.com/spf13/cobra.(*Command).Execute(...)
 /Users/mac/go/src/github.com/spf13/cobra/command.go:800
github.com/linuxsuren/jenkins-cli/app/cmd.Execute()
 /Users/mac/go/src/github.com/linuxsuren/jenkins-cli/app/cmd/root.go:40 +0x32
main.main()
 /Users/mac/go/src/github.com/linuxsuren/jenkins-cli/main.go:8 +0x20
[root@master ~]# jcli job build -n test_publish_demo -b
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x6bf987]

goroutine 1 [running]:
github.com/linuxsuren/jenkins-cli/client.(*JenkinsCore).CrumbHandle(0xc00006fcf0, 0xc00014b600, 0xd, 0xc000015e80)
 /Users/m

Mess up the output when words are not English

Like below:

number name                   type
0      构建一个自由风格的软件项目          Standalone Projects
1      流水线                    Standalone Projects
2      构建一个多配置项目              Standalone Projects
0      Bitbucket Team/Project Nested Projects
1      文件夹                    Nested Projects
2      GitHub 组织              Nested Projects
3      Gitea Organization     Nested Projects
4      多分支流水线                 Nested Projects

触发参数化任务时报错

执行的命令,以及错误提示如下:

jcli job build -n "rick echo"
 Are you sure to build job rick echo Yes
2019/07/18 11:14:38 <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 400 Nothing is submitted</title>
</head>
<body><h2>HTTP ERROR 400</h2>
<p>Problem accessing ///job/rick/job/echo/build. Reason:
<pre>    Nothing is submitted</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>

</body>
</html>

Error when executing jcli config

This is my first time to execute this cmd. Error output is below:

2019/07/27 11:40:48 No config file found.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x13a1945]

goroutine 1 [running]:
github.com/linuxsuren/jenkins-cli/app/cmd.glob..func2(0x1805020, 0xc000091060, 0x1, 0x1)
	/Users/mac/go/src/github.com/linuxsuren/jenkins-cli/app/cmd/config.go:30 +0xd5
github.com/spf13/cobra.(*Command).execute(0x1805020, 0xc000091020, 0x1, 0x1, 0x1805020, 0xc000091020)
	/Users/mac/go/src/github.com/spf13/cobra/command.go:766 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0x1809760, 0x147de42, 0x1, 0x0)
	/Users/mac/go/src/github.com/spf13/cobra/command.go:852 +0x2ec
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/mac/go/src/github.com/spf13/cobra/command.go:800
github.com/linuxsuren/jenkins-cli/app/cmd.Execute()
	/Users/mac/go/src/github.com/linuxsuren/jenkins-cli/app/cmd/root.go:40 +0x32
main.main()
	/Users/mac/go/src/github.com/linuxsuren/jenkins-cli/main.go:8 +0x20

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.