Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor cli #329

Merged
merged 8 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ docker-compose.yml
/.env
extras/
release/
build/
/build/
cli/release/
anbraten marked this conversation as resolved.
Show resolved Hide resolved

server/swagger/files/*.json
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ release-cli:
# disable CGO for cross-compiling
export CGO_ENABLED=0
# compile for all architectures
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o cli/release/linux/amd64/woodpecker github.com/woodpecker-ci/woodpecker/cli/drone
GOOS=linux GOARCH=arm64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o cli/release/linux/arm64/woodpecker github.com/woodpecker-ci/woodpecker/cli/drone
GOOS=linux GOARCH=arm go build -ldflags "-X main.version=${DRONE_TAG##v}" -o cli/release/linux/arm/woodpecker github.com/woodpecker-ci/woodpecker/cli/drone
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o cli/release/windows/amd64/woodpecker github.com/woodpecker-ci/woodpecker/cli/drone
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o cli/release/darwin/amd64/woodpecker github.com/woodpecker-ci/woodpecker/cli/drone
GOOS=linux GOARCH=amd64 go build -ldflags '${LDFLAGS}' -o cli/release/linux/amd64/woodpecker-cli github.com/woodpecker-ci/woodpecker/cmd/cli
GOOS=linux GOARCH=arm64 go build -ldflags '${LDFLAGS}' -o cli/release/linux/arm64/woodpecker-cli github.com/woodpecker-ci/woodpecker/cmd/cli
GOOS=linux GOARCH=arm go build -ldflags '${LDFLAGS}' -o cli/release/linux/arm/woodpecker-cli github.com/woodpecker-ci/woodpecker/cmd/cli
GOOS=windows GOARCH=amd64 go build -ldflags '${LDFLAGS}' -o cli/release/windows/amd64/woodpecker-cli github.com/woodpecker-ci/woodpecker/cmd/cli
GOOS=darwin GOARCH=amd64 go build -ldflags '${LDFLAGS}' -o cli/release/darwin/amd64/woodpecker-cli github.com/woodpecker-ci/woodpecker/cmd/cli
# tar binary files prior to upload
tar -cvzf cli/release/woodpecker_linux_amd64.tar.gz -C cli/release/linux/amd64 woodpecker
tar -cvzf cli/release/woodpecker_linux_arm64.tar.gz -C cli/release/linux/arm64 woodpecker
tar -cvzf cli/release/woodpecker_linux_arm.tar.gz -C cli/release/linux/arm woodpecker
tar -cvzf cli/release/woodpecker_windows_amd64.tar.gz -C cli/release/windows/amd64 woodpecker
tar -cvzf cli/release/woodpecker_darwin_amd64.tar.gz -C cli/release/darwin/amd64 woodpecker
tar -cvzf cli/release/woodpecker_linux_amd64.tar.gz -C cli/release/linux/amd64 woodpecker-cli
tar -cvzf cli/release/woodpecker_linux_arm64.tar.gz -C cli/release/linux/arm64 woodpecker-cli
tar -cvzf cli/release/woodpecker_linux_arm.tar.gz -C cli/release/linux/arm woodpecker-cli
tar -cvzf cli/release/woodpecker_windows_amd64.tar.gz -C cli/release/windows/amd64 woodpecker-cli
tar -cvzf cli/release/woodpecker_darwin_amd64.tar.gz -C cli/release/darwin/amd64 woodpecker-cli
# generate shas for tar files
sha256sum cli/release/*.tar.gz > cli/release/woodpecker_checksums.txt

Expand Down
57 changes: 0 additions & 57 deletions cli/.drone.yml

This file was deleted.

6 changes: 5 additions & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
Command line client for the Drone continuous integration server. Please see the official documentation at http://docs.drone.io/cli-installation/
# Woodpecker CLI

Command line client for the Woodpecker continuous integration server.

Please see the official documentation at https://woodpecker-ci.github.io/docs/cli
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var buildApproveCmd = cli.Command{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var buildDeclineCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/build/build_info.go → cli/build/build_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"text/template"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var buildInfoCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/build/build_kill.go → cli/build/build_kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var buildKillCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/build/build_last.go → cli/build/build_last.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"text/template"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var buildLastCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/build/build_list.go → cli/build/build_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"text/template"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var buildListCmd = cli.Command{
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cli/drone/build/build_ps.go → cli/build/build_ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"text/template"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var buildPsCmd = cli.Command{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"text/template"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var buildQueueCmd = cli.Command{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var buildStartCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/build/build_stop.go → cli/build/build_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var buildStopCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/deploy/deploy.go → cli/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"strconv"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/drone-go/drone"

"github.com/urfave/cli"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cli/drone/info/info.go → cli/info/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

// Command exports the info command.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cli/drone/log/log_purge.go → cli/log/log_purge.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var logPurgeCmd = cli.Command{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io/ioutil"
"strings"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/drone-go/drone"

"github.com/urfave/cli"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"html/template"
"os"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"

"github.com/urfave/cli"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var registryListCmd = cli.Command{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package registry

import (
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"

"github.com/urfave/cli"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io/ioutil"
"strings"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/drone-go/drone"

"github.com/urfave/cli"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cli/drone/repo/repo_add.go → cli/repo/repo_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var repoAddCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/repo/repo_chown.go → cli/repo/repo_chown.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var repoChownCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/repo/repo_info.go → cli/repo/repo_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"text/template"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var repoInfoCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/repo/repo_list.go → cli/repo/repo_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"text/template"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var repoListCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/repo/repo_repair.go → cli/repo/repo_repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package repo

import (
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var repoRepairCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/repo/repo_rm.go → cli/repo/repo_rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package repo
import (
"fmt"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"

"github.com/urfave/cli"
)
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/repo/repo_sync.go → cli/repo/repo_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"text/template"

"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var repoSyncCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/repo/repo_update.go → cli/repo/repo_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/drone-go/drone"

"github.com/urfave/cli"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io/ioutil"
"strings"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/drone-go/drone"

"github.com/urfave/cli"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var secretInfoCmd = cli.Command{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var secretListCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/secret/secret_rm.go → cli/secret/secret_rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package secret
import (
"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var secretDeleteCmd = cli.Command{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io/ioutil"
"strings"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
"github.com/woodpecker-ci/woodpecker/drone-go/drone"

"github.com/urfave/cli"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cli/drone/user/user_add.go → cli/user/user_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/urfave/cli"
"github.com/woodpecker-ci/woodpecker/drone-go/drone"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var userAddCmd = cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion cli/drone/user/user_info.go → cli/user/user_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/urfave/cli"

"github.com/woodpecker-ci/woodpecker/cli/drone/internal"
"github.com/woodpecker-ci/woodpecker/cli/internal"
)

var userInfoCmd = cli.Command{
Expand Down
Loading