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

chore!: Remove deprecated commands and plrlctl binary #579

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d4c408c
remove stack commands
maciaszczykm Dec 4, 2024
13bbc84
remove deploy and destroy commands
maciaszczykm Dec 4, 2024
9234e05
remove build, bundle and bounce commands
maciaszczykm Dec 4, 2024
79056b0
remove push and repos commands
maciaszczykm Dec 4, 2024
f1d80ff
remove link, output, packages commands
maciaszczykm Dec 4, 2024
765c830
remove info and upgrade commands
maciaszczykm Dec 4, 2024
293af74
remove log and proxy commands
maciaszczykm Dec 4, 2024
f835450
remove most of api commands
maciaszczykm Dec 4, 2024
82eaadd
remove some of common commands
maciaszczykm Dec 4, 2024
c3302bb
remove unused code
maciaszczykm Dec 4, 2024
ab99a78
replace ops and workspace commands with mgmt
maciaszczykm Dec 4, 2024
e96a3ea
remove ai commands
maciaszczykm Dec 4, 2024
b390fb3
remove unused code
maciaszczykm Dec 4, 2024
f774be1
remove unused client methods
maciaszczykm Dec 4, 2024
f4cee40
remove plrlctl
maciaszczykm Dec 4, 2024
b44c908
remove unused code and old diagrams
maciaszczykm Dec 4, 2024
308b7df
remove unused client methods
maciaszczykm Dec 5, 2024
d81f1cc
update readme
maciaszczykm Dec 5, 2024
01de040
run genmock
maciaszczykm Dec 5, 2024
dc4be37
update linter and fix errors
maciaszczykm Dec 5, 2024
6f4fd93
remove unused code
maciaszczykm Dec 5, 2024
8f8bbbc
remove kind provider and capi leftovers
maciaszczykm Dec 5, 2024
9239c2b
avoid double go install in ci
maciaszczykm Dec 5, 2024
ffebdd7
update ci action
maciaszczykm Dec 5, 2024
c61c6cf
remove unused code
maciaszczykm Dec 5, 2024
17d254b
remove exec, logs and portforward code
maciaszczykm Dec 5, 2024
54c14a1
fix std.in syscall when building for windows
maciaszczykm Dec 5, 2024
46bbbb6
remove test and template commands
maciaszczykm Dec 10, 2024
bf9c436
remove vpn commands
maciaszczykm Dec 10, 2024
bec7df4
remove some workspace commands
maciaszczykm Dec 10, 2024
61c4f07
move stacks directly under cd category
maciaszczykm Dec 10, 2024
1cdcaf0
update descriptions
maciaszczykm Dec 10, 2024
bf2c9ca
remove ui
maciaszczykm Dec 10, 2024
97c979e
go mod tidy
maciaszczykm Dec 10, 2024
6465033
remove unused code
maciaszczykm Dec 10, 2024
f8de7c4
genmock
maciaszczykm Dec 10, 2024
810779d
remove unused code
maciaszczykm Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 8 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
actions: read
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
actions: read
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner in fs mode
uses: aquasecurity/trivy-action@master
with:
Expand All @@ -248,7 +248,7 @@ jobs:
name: Unit test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
Expand All @@ -264,17 +264,18 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.59.1
version: v1.62.2
skip-cache: true
build:
name: GoReleaser build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4.1.0
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: GoReleaser (Build)
Expand Down
89 changes: 0 additions & 89 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,11 @@ builds:
- -X "github.com/pluralsh/plural-cli/pkg/common.Date={{.Date}}"
- -X "github.com/pluralsh/plural-cli/pkg/scm.GitlabClientSecret={{.Env.GITLAB_CLIENT_SECRET}}"
binary: plural
- id: plrlctl
main: ./cmd/plrlctl
targets:
- linux_amd64
- linux_arm64
- windows_amd64
- windows_arm64
- darwin_amd64
- darwin_arm64
env:
- CGO_ENABLED=0
ldflags:
- -s
- -w
- -X "github.com/pluralsh/plural-cli/pkg/common.Version={{.Version}}"
- -X "github.com/pluralsh/plural-cli/pkg/common.Commit={{.Commit}}"
- -X "github.com/pluralsh/plural-cli/pkg/common.Date={{.Date}}"
- -X "github.com/pluralsh/plural-cli/pkg/scm.GitlabClientSecret={{.Env.GITLAB_CLIENT_SECRET}}"
binary: pluralctl

archives:
- id: plural-cli
builds: [plural-cli]
name_template: '{{ .ProjectName }}_{{ .Version }}_{{- title .Os -}}_{{- if eq .Arch "386" -}}i386{{- else -}}{{ .Arch }}{{- end -}}'
- id: plrlctl
builds: [plrlctl]
name_template: '{{ .Binary }}_{{ .Version }}_{{- title .Os -}}_{{- if eq .Arch "386" -}}i386{{- else -}}{{ .Arch }}{{- end -}}'

checksum:
name_template: 'checksums.txt'
Expand Down Expand Up @@ -160,70 +138,3 @@ brews:

test: |
system "#{bin}/plural", "--help"

- name: plrlctl
ids: [plrlctl]
repository:
owner: pluralsh
name: homebrew-plural

# Optionally a branch can be provided.
# Defaults to the default repository branch.
branch: main

# Optionally a token can be provided, if it differs from the token provided to GoReleaser
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"

# Template for the url which is determined by the given Token (github, gitlab or gitea)
#
# Default depends on the client.
url_template: "https://github.com/pluralsh/plural-cli/releases/download/{{ .Tag }}/{{ .ArtifactName }}"

# Allows you to set a custom download strategy. Note that you'll need
# to implement the strategy and add it to your tap repository.
# Example: https://docs.brew.sh/Formula-Cookbook#specifying-the-download-strategy-explicitly
# Default is empty.
download_strategy: CurlDownloadStrategy

# Git author used to commit to the repository.
# Defaults are shown.
commit_author:
name: plural-bot
email: [email protected]

# The project name and current git tag are used in the format string.
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"

# Folder inside the repository to put the formula.
# Default is the root folder.
directory: Formula

# Your app's homepage.
# Default is empty.
homepage: "https://docs.plural.sh"

# Template of your app's description.
# Default is empty.
description: "CLI to manage and operate a fleet of clusters"

# SPDX identifier of your app's license.
# Default is empty.
license: "MIT"

# Setting this will prevent goreleaser to actually try to commit the updated
# formula - instead, the formula file will be stored on the dist folder only,
# leaving the responsibility of publishing it to the user.
# If set to auto, the release will not be uploaded to the homebrew tap
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
# Default is false.
skip_upload: "auto"

# Custom block for brew.
# Can be used to specify alternate downloads for devel or head releases.
# Default is empty.
custom_block: |
head "https://github.com/pluralsh/plural-cli.git"

test: |
system "#{bin}/plrlctl", "--help"

50 changes: 2 additions & 48 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ include $(ROOT_DIRECTORY)/hack/include/build.mk

GCP_PROJECT ?= pluralsh
APP_NAME ?= plural-cli
APP_CTL_NAME ?= plrlctl
APP_VSN ?= $(shell git describe --tags --always --dirty)
APP_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%S%z")
BUILD ?= $(shell git rev-parse --short HEAD)
Expand All @@ -22,12 +21,7 @@ LDFLAGS ?= $(BASE_LDFLAGS) $\
-X "$(PACKAGE)/pkg/common.Date=$(APP_DATE)" $\
-X "$(PACKAGE)/pkg/scm.GitlabClientSecret=${GITLAB_CLIENT_SECRET}" $\
-X "$(PACKAGE)/pkg/scm.BitbucketClientSecret=${BITBUCKET_CLIENT_SECRET}"
WAILS_TAGS ?= desktop,production,ui,debug
WAILS_BINDINGS_TAGS ?= bindings,generate
WAILS_BINDINGS_BINARY_NAME ?= wailsbindings
TAGS ?= $(WAILS_TAGS)
OUTFILE ?= plural.o
OUTCTLFILE ?= plrlctl.o
GOBIN ?= go env GOBIN

# Targets to run before other targets
Expand All @@ -42,43 +36,14 @@ git-push:
.PHONY: install
install:
go build -ldflags '$(LDFLAGS)' -o $(GOBIN)/plural ./cmd/plural
go build -ldflags '$(LDFLAGS)' -o $(GOBIN)/plrlctl ./cmd/plrlctl

.PHONY: build-cli
build-cli: ## Build a CLI binary for the host architecture without embedded UI
go build -ldflags='$(LDFLAGS)' -o $(OUTFILE) ./cmd/plural

.PHONY: build-ctl
build-ctl: ## Build a CLI binary for the fleet management
go build -ldflags='$(LDFLAGS)' -o $(OUTCTLFILE) ./cmd/plrlctl

.PHONY: build-cli-ui
build-cli-ui: $(PRE) generate-bindings ## Build a CLI binary for the host architecture with embedded UI
CGO_LDFLAGS=$(CGO_LDFLAGS) go build -tags $(WAILS_TAGS) -ldflags='$(LDFLAGS)' -o $(OUTFILE) ./cmd/plural

.PHONY: build-web
build-web: ## Build just the embedded UI
cd pkg/ui/web && yarn --immutable && yarn build

.PHONY: run-web
run-web: $(PRE) ## Run the UI for development
@CGO_LDFLAGS=$(CGO_LDFLAGS) wails dev -tags ui -browser -skipbindings

# This is somewhat an equivalent of wails `GenerateBindings` method.
# Ref: https://github.com/wailsapp/wails/blob/master/v2/pkg/commands/bindings/bindings.go#L28
.PHONY: generate-bindings
generate-bindings: build-web ## Generate backend bindings for the embedded UI
@echo Building bindings binary
@CGO_LDFLAGS=$(CGO_LDFLAGS) go build -tags $(WAILS_BINDINGS_TAGS) -ldflags='$(LDFLAGS)' -o $(WAILS_BINDINGS_BINARY_NAME) .
@echo Generating bindings
@./$(WAILS_BINDINGS_BINARY_NAME) > /dev/null 2>&1
@echo Cleaning up
@rm $(WAILS_BINDINGS_BINARY_NAME)

.PHONY: release
release:
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags='$(LDFLAGS)' -o $(OUTFILE) ./cmd/plural
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags='$(LDFLAGS)' -o $(OUTCTLFILE) ./cmd/plrlctl

.PHONY: goreleaser
goreleaser:
Expand All @@ -103,17 +68,6 @@ build: ## Build the Docker image
-t gcr.io/$(GCP_PROJECT)/$(APP_NAME):$(APP_VSN) \
-t $(DKR_HOST)/plural/$(APP_NAME):$(APP_VSN) .

.PHONY: build-ctl
build-ctl: ## Build the plrctl Docker image
docker build --build-arg APP_NAME=$(APP_CTL_NAME) \
--build-arg APP_VSN=$(APP_VSN) \
--build-arg APP_DATE=$(APP_DATE) \
--build-arg APP_COMMIT=$(BUILD) \
-t $(APP_CTL_NAME):$(APP_VSN) \
-t $(APP_CTL_NAME):latest \
-t gcr.io/$(GCP_PROJECT)/$(APP_CTL_NAME):$(APP_VSN) \
-t $(DKR_HOST)/plural/$(APP_CTL_NAME):$(APP_VSN) -f dockerfiles/plrlctl/Dockerfile .

.PHONY: build-cloud
build-cloud: ## build the cloud docker image
docker build --build-arg APP_NAME=$(APP_NAME) \
Expand Down Expand Up @@ -186,15 +140,15 @@ test: setup-tests

.PHONY: format
format: ## formats all go code to prep for linting
docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.59.1 golangci-lint run --fix
docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.62.2 golangci-lint run --fix

.PHONY: genmock
genmock: ## generates mocks before running tests
hack/gen-client-mocks.sh

.PHONY: lint
lint:
docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.59.1 golangci-lint run
docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.62.2 golangci-lint run

.PHONY: delete-tag
delete-tag:
Expand Down
77 changes: 12 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,29 @@
# Plural CLI

The plural cli automates all gitops operations for your deployments of plural applications. The core workflow should mostly be as simple as:

```bash
plural build
plural deploy
```

And if you want to teardown your infrastructure, you can simply run:

```bash
plural destroy
```

To add, update or reconfigure any applications deployed by plural. But it goes even deeper and solves things like:

* Secret management (via a similar mechanism as git-crypt)
* Application Health checking - `plural watch APP`
* Log tailing - `plural logs list APP` and `plural logs tail APP LOGSTREAM`
* Setting up secure proxies into databases, private web UIs - `plural proxy list APP` and `plural proxy connect APP NAME`
Deploying your services using the Plural CLI.

## Installation

There are a number of means to install plural, the simplest is to use our homebrew tap if you're using mac:
The Plural CLI is available on homebrew, a single line install can be done with:

```bash
brew install pluralsh/plural/plural
```

More detailed instructions for other platforms can be found at https://docs.plural.sh/getting-started#1.-install-plural-cli-and-dependencies

Plural does require a few other cli's to be installed, namely:
* helm
* terraform
* kubectl
* cloud provider cli for the infrastructure you're deploying to, like `awscli`, `gcloud`, etc
* [kind](https://kind.sigs.k8s.io/) if using kind to deploy a local cluster for testing

## Setup

The core workflow is all git based, so you should create a git repository on github or wherever you're using SCM, clone it locally, then run:
If you are using a machine that is not compatible with homebrew,
we recommend simply downloading a pre-built release on github and installing it onto your machines path. The releases can be found here: https://github.com/pluralsh/plural-cli/releases.

```bash
plural init
```
## Requirements

You'll want to then install a bundle for whatever application you'd like, we'll use https://github.com/airbytehq/airbyte as an example. You can search for the bundles using:
Plural does require a few other CLI's to be installed, namely:
* `helm`
* `terraform`
* `kubectl`
* cloud provider CLI for the infrastructure you're deploying to, like `aws`, `az`, `gcloud` etc.

## Quickstart

```bash
plural bundle list airbyte
```

And chose one (using aws as an example cloud provider target) like:

```bash
plural bundle install airbyte airbyte-aws
```

This will set the basic configuration parameters for all the infrastructure needed to install airbyte. Then just run:

```bash
plural build
plural deploy --commit "deploying my first plural app!"
```

To install it.


## Installing the Plural Console

We highly recommend installing the [plural console](https://github.com/pluralsh/console) alongside your plural applications. That can be done easily with:

```bash
plural bundle install console console-aws
plural build
plural deploy --commit "deploying the plural console"
```
Detailed instructions can be found at https://docs.plural.sh/deployments/cli-quickstart.

## Reaching Out

Expand Down
File renamed without changes.
Loading
Loading