Skip to content

Commit

Permalink
Move casc sub-command into jcli-casc-plugin (#475)
Browse files Browse the repository at this point in the history
* Export some common functions

* Remove casc sub-command, make it as a plugin

The plugin repo is https://github.com/jenkins-zh/jcli-casc-plugin

* Reduce the size of jcli binary

* Add comments for export functions

* Test release in pull request

* Try to fix upx missing issues

* Do not load uninstalled plugins

* Remove e2e test for casc

* Adjust the badages
  • Loading branch information
LinuxSuRen committed Nov 27, 2020
1 parent 613705c commit edea2f3
Show file tree
Hide file tree
Showing 29 changed files with 94 additions and 654 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
pull-request-branch-name:
separator: "-"
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
pull-request-branch-name:
separator: "-"
1 change: 0 additions & 1 deletion .github/workflows/backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
git clone https://github.com/jenkins-zh/jcli-repo
cp release/checksums.txt jcli-repo
cp release/jcli-darwin-amd64.tar.gz jcli-repo
cp release/jcli-freebsd-amd64.tar.gz jcli-repo
cp release/jcli-linux-64bit.deb jcli-repo
cp release/jcli-linux-64bit.rpm jcli-repo
cp release/jcli-linux-amd64.tar.gz jcli-repo
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ jobs:
args: check
- name: Build
run: |
export PATH=$PATH:${PWD}/bin:$GOPATH/bin:/home/runner/go/bin
make clean gen-data-darwin tools release
export PATH=$PATH:${PWD}/bin:$GOPATH/bin:/home/runner/go/bin:.
curl -L https://github.com/goreleaser/goreleaser/releases/download/v0.147.2/goreleaser_Darwin_x86_64.tar.gz | tar xz
goreleaser -v
brew install upx
upx -V
make clean gen-data-darwin tools release test-release
GoLint:
name: Lint
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
git clone https://github.com/jenkins-zh/jcli-repo
cp release/checksums.txt jcli-repo
cp release/jcli-darwin-amd64.tar.gz jcli-repo
cp release/jcli-freebsd-amd64.tar.gz jcli-repo
cp release/jcli-linux-64bit.deb jcli-repo
cp release/jcli-linux-64bit.rpm jcli-repo
cp release/jcli-linux-amd64.tar.gz jcli-repo
Expand Down
8 changes: 4 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ builds:
- amd64
- arm64
goos:
- freebsd
- windows
- linux
- darwin
ignore:
- goos: freebsd
goarch: arm64
hooks:
post:
- upx "{{ .Path }}"
ldflags:
- -X github.com/jenkins-zh/jenkins-cli/app.version={{.Version}}
- -X github.com/jenkins-zh/jenkins-cli/app.commit={{.ShortCommit}}
- -X github.com/jenkins-zh/jenkins-cli/app.date={{.Date}}
- -w
dist: release
archives:
- name_template: "{{ .Binary }}-{{ .Os }}-{{ .Arch }}"
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ win: pre-build
build-all: darwin linux win

release: build-all
mkdir release
mkdir -p release
cd ./bin/darwin; upx jcli; tar -zcvf ../../release/jcli-darwin-amd64.tar.gz jcli; cd ../../release/; shasum -a 256 jcli-darwin-amd64.tar.gz > jcli-darwin-amd64.txt
cd ./bin/linux; upx jcli; tar -zcvf ../../release/jcli-linux-amd64.tar.gz jcli; cd ../../release/; shasum -a 256 jcli-linux-amd64.tar.gz > jcli-linux-amd64.txt
cd ./bin/windows; upx jcli.exe; tar -zcvf ../../release/jcli-windows-386.tar.gz jcli.exe; cd ../../release/; shasum -a 256 jcli-windows-386.tar.gz > jcli-windows-386.txt
Expand Down Expand Up @@ -136,7 +136,7 @@ test:
# go test ./app/cmd -v -count=1

test-release:
goreleaser release --rm-dist --snapshot
goreleaser release --rm-dist --snapshot --skip-publish

dep:
go get github.com/AlecAivazis/survey/v2
Expand Down
13 changes: 12 additions & 1 deletion README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@

## Jenkins CLI

[![](https://goreportcard.com/badge/jenkins-zh/jenkins-cli)](https://goreportcard.com/report/jenkins-zh/jenkins-cli) [![](https://sonarcloud.io/api/project_badges/measure?project=jenkins-zh_jenkins-cli&metric=alert_status)](https://sonarcloud.io/dashboard?id=jenkins-zh_jenkins-cli) [![](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/github.com/jenkins-zh/jenkins-cli) ![Sonar Coverage](https://img.shields.io/sonar/coverage/jenkins-zh_jenkins-cli?server=https%3A%2F%2Fsonarcloud.io) [![Travis](https://img.shields.io/travis/jenkins-zh/jenkins-cli.svg?logo=travis&label=build&logoColor=white)](https://travis-ci.org/jenkins-zh/jenkins-cli) [![Contributors](https://img.shields.io/github/contributors/jenkins-zh/jenkins-cli.svg)](https://github.com/jenkins-zh/jenkins-cli/graphs/contributors) [![GitHub release](https://img.shields.io/github/release/jenkins-zh/jenkins-cli.svg?label=release)](https://github.com/jenkins-zh/jenkins-cli/releases/latest) ![GitHub All Releases](https://img.shields.io/github/downloads/jenkins-zh/jenkins-cli/total) [![Docker Pulls](https://img.shields.io/docker/pulls/jenkinszh/jcli.svg)](https://hub.docker.com/r/jenkinszh/jcli/tags) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/jenkins-zh/jenkins-cli) [![Gitter](https://badges.gitter.im/jenkinsci/jenkins-cli.svg)](https://gitter.im/jenkinsci/jenkins-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![HitCount](http://hits.dwyl.com/jenkins-zh/jenkins-cli.svg)](http://hits.dwyl.com/jenkins-zh/jenkins-cli)
<!--
[![](https://sonarcloud.io/api/project_badges/measure?project=jenkins-zh_jenkins-cli&metric=alert_status)](https://sonarcloud.io/dashboard?id=jenkins-zh_jenkins-cli)
-->
[![](https://goreportcard.com/badge/jenkins-zh/jenkins-cli)](https://goreportcard.com/report/jenkins-zh/jenkins-cli)
[![](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/github.com/jenkins-zh/jenkins-cli)
![Sonar Coverage](https://img.shields.io/sonar/coverage/jenkins-zh_jenkins-cli?server=https%3A%2F%2Fsonarcloud.io)
[![Contributors](https://img.shields.io/github/contributors/jenkins-zh/jenkins-cli.svg)](https://github.com/jenkins-zh/jenkins-cli/graphs/contributors)
[![GitHub release](https://img.shields.io/github/release/jenkins-zh/jenkins-cli.svg?label=release)](https://github.com/jenkins-zh/jenkins-cli/releases/latest)
![GitHub All Releases](https://img.shields.io/github/downloads/jenkins-zh/jenkins-cli/total)
[![Docker Pulls](https://img.shields.io/docker/pulls/jenkinszh/jcli.svg)](https://hub.docker.com/r/jenkinszh/jcli/tags)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/jenkins-zh/jenkins-cli)
[![HitCount](http://hits.dwyl.com/jenkins-zh/jenkins-cli.svg)](http://hits.dwyl.com/jenkins-zh/jenkins-cli)

Jenkins CLI 可以帮忙你轻松地管理 Jenkins。不管你是一名插件开发者、管理员或者只是一个普通的 Jenkins 用户,它都是为你而生的!

Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@

## Jenkins CLI

[![](https://goreportcard.com/badge/jenkins-zh/jenkins-cli)](https://goreportcard.com/report/jenkins-zh/jenkins-cli) [![](https://sonarcloud.io/api/project_badges/measure?project=jenkins-zh_jenkins-cli&metric=alert_status)](https://sonarcloud.io/dashboard?id=jenkins-zh_jenkins-cli) [![](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/github.com/jenkins-zh/jenkins-cli) ![Sonar Coverage](https://img.shields.io/sonar/coverage/jenkins-zh_jenkins-cli?server=https%3A%2F%2Fsonarcloud.io) [![Travis](https://img.shields.io/travis/jenkins-zh/jenkins-cli.svg?logo=travis&label=build&logoColor=white)](https://travis-ci.org/jenkins-zh/jenkins-cli) [![Contributors](https://img.shields.io/github/contributors/jenkins-zh/jenkins-cli.svg)](https://github.com/jenkins-zh/jenkins-cli/graphs/contributors) [![GitHub release](https://img.shields.io/github/release/jenkins-zh/jenkins-cli.svg?label=release)](https://github.com/jenkins-zh/jenkins-cli/releases/latest) ![GitHub All Releases](https://img.shields.io/github/downloads/jenkins-zh/jenkins-cli/total) [![Docker Pulls](https://img.shields.io/docker/pulls/jenkinszh/jcli.svg)](https://hub.docker.com/r/jenkinszh/jcli/tags) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/jenkins-zh/jenkins-cli) [![Gitter](https://badges.gitter.im/jenkinsci/jenkins-cli.svg)](https://gitter.im/jenkinsci/jenkins-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![HitCount](http://hits.dwyl.com/jenkins-zh/jenkins-cli.svg)](http://hits.dwyl.com/jenkins-zh/jenkins-cli)
<!--
[![](https://sonarcloud.io/api/project_badges/measure?project=jenkins-zh_jenkins-cli&metric=alert_status)](https://sonarcloud.io/dashboard?id=jenkins-zh_jenkins-cli)
-->
[![](https://goreportcard.com/badge/jenkins-zh/jenkins-cli)](https://goreportcard.com/report/jenkins-zh/jenkins-cli)
[![](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/github.com/jenkins-zh/jenkins-cli)
![Sonar Coverage](https://img.shields.io/sonar/coverage/jenkins-zh_jenkins-cli?server=https%3A%2F%2Fsonarcloud.io)
[![Contributors](https://img.shields.io/github/contributors/jenkins-zh/jenkins-cli.svg)](https://github.com/jenkins-zh/jenkins-cli/graphs/contributors)
[![GitHub release](https://img.shields.io/github/release/jenkins-zh/jenkins-cli.svg?label=release)](https://github.com/jenkins-zh/jenkins-cli/releases/latest)
![GitHub All Releases](https://img.shields.io/github/downloads/jenkins-zh/jenkins-cli/total)
[![Docker Pulls](https://img.shields.io/docker/pulls/jenkinszh/jcli.svg)](https://hub.docker.com/r/jenkinszh/jcli/tags)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/jenkins-zh/jenkins-cli)
[![HitCount](http://hits.dwyl.com/jenkins-zh/jenkins-cli.svg)](http://hits.dwyl.com/jenkins-zh/jenkins-cli)

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!

Expand Down
38 changes: 0 additions & 38 deletions app/cmd/casc.go

This file was deleted.

41 changes: 0 additions & 41 deletions app/cmd/casc_apply.go

This file was deleted.

57 changes: 0 additions & 57 deletions app/cmd/casc_apply_test.go

This file was deleted.

46 changes: 0 additions & 46 deletions app/cmd/casc_export.go

This file was deleted.

57 changes: 0 additions & 57 deletions app/cmd/casc_export_test.go

This file was deleted.

Loading

0 comments on commit edea2f3

Please sign in to comment.