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

Automatic generation of README catalogs #737

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,12 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: "Set up Python"
uses: "actions/setup-python@v4"
with:
python-version: '3.10'
- name: "Install dependencies"
run: |
python -m pip install cogapp
- name: Make all
run: make all
7 changes: 7 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: "Set up Python"
uses: "actions/setup-python@v4"
with:
python-version: '3.10'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, a CI job is not the correct place to regenerate a README file, which needs to be committed back into the tree.

This should be a task that contributors run with PRs, and part of the PR template.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, a CI job is not the correct place to regenerate a README file, which needs to be committed back into the tree.

This should be a task that contributors run with PRs, and part of the PR template.

+1 on this, that's why I asked about how to run this locally!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea behind it was that the CI would rerun the generation script (make lint that calls make docs) and verify no changes weren't committed to git.
Of course it can be removed from the publish GHA

- name: "Install dependencies"
run: |
python -m pip install cogapp
- name: Make all
run: make all
- name: Upload release binaries
Expand Down
26 changes: 18 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ LDFLAGS := "-s -w -X github.com/alexellis/arkade/cmd.Version=$(Version) -X githu
PLATFORM := $(shell ./hack/platform-tag.sh)
SOURCE_DIRS = cmd pkg main.go
export GO111MODULE=on
BIN := bin
export PATH := ${PWD}/${BIN}:${PATH}

.PHONY: all
all: gofmt test build dist hash
all: gofmt test build dist hash lint

.PHONY: build
build:
Expand All @@ -26,14 +28,22 @@ e2e:

.PHONY: dist
dist:
mkdir -p bin
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/arkade
CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/arkade-darwin
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/arkade-darwin-arm64
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/arkade-armhf
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/arkade-arm64
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/arkade.exe
mkdir -p ${BIN}
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o ${BIN}/arkade
CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o ${BIN}/arkade-darwin
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o ${BIN}/arkade-darwin-arm64
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o ${BIN}/arkade-armhf
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o ${BIN}/arkade-arm64
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o ${BIN}/arkade.exe

.PHONY: hash
hash:
rm -rf bin/*.sha256 && ./hack/hashgen.sh

.PHONY: lint
lint: docs
git diff --exit-code # fail if generation caused any diff

.PHONY: docs
docs:
cog -r README.md
106 changes: 57 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,71 +488,80 @@ A CLI or "tool" is a command line tool that you run directly on your own worksta

### Catalog of Apps

<!-- [[[cog
import cog
import subprocess
cog.outl(subprocess.getoutput("arkade install --print-table"))
]]] -->
| TOOL | DESCRIPTION |
|-------------------------|---------------------------------------------------------------------|
| docker-registry-ingress | Install registry ingress with TLS |
| inlets-operator | Install inlets-operator |
| kuma | Install Kuma |
| kube-state-metrics | Install kube-state-metrics |
| OSM | Install osm |
| argocd | Install argocd |
| cassandra | Install cassandra |
| cert-manager | Install cert-manager |
| chart | Install the specified helm chart |
| cockroachdb | Install CockroachDB |
| consul-connect | Install Consul Service Mesh |
| cron-connector | Install cron-connector for OpenFaaS |
| crossplane | Install Crossplane |
| docker-registry | Install a Docker registry |
| rabbitmq | Install rabbitmq |
| linkerd | Install linkerd |
| redis | Install redis |
| gitlab | Install GitLab |
| docker-registry-ingress | Install registry ingress with TLS |
| falco | Install Falco |
| registry-creds | Install registry-creds |
| qemu-static | Install qemu-user-static |
| metrics-server | Install metrics-server |
| postgresql | Install postgresql |
| gitea | Install gitea |
| gitlab | Install GitLab |
| grafana | Install grafana |
| influxdb | Install influxdb |
| ingress-nginx | Install ingress-nginx |
| inlets-operator | Install inlets-operator |
| inlets-tcp-client | Install inlets PRO TCP client |
| istio | Install istio |
| jenkins | Install jenkins |
| nginx-inc | Install nginx-inc for OpenFaaS |
| metallb-arp | Install MetalLB in L2 (ARP) mode |
| loki | Install Loki for monitoring and tracing |
| nfs-provisioner | Install nfs subdir external provisioner |
| mqtt-connector | Install mqtt-connector for OpenFaaS |
| kanister | Install kanister for application-level data management |
| openfaas-ingress | Install openfaas ingress with TLS |
| chart | Install the specified helm chart |
| cron-connector | Install cron-connector for OpenFaaS |
| minio | Install minio |
| openfaas | Install openfaas |
| kafka | Install Confluent Platform Kafka |
| kubernetes-dashboard | Install kubernetes-dashboard |
| OSM | Install osm |
| inlets-tcp-client | Install inlets PRO TCP client |
| kafka-connector | Install kafka-connector for OpenFaaS |
| kanister | Install kanister for application-level data management |
| kong-ingress | Install kong-ingress for OpenFaaS |
| sealed-secret | Install sealed-secrets |
| cassandra | Install cassandra |
| waypoint | Install Waypoint |
| opa-gatekeeper | Install Open Policy Agent (OPA) Gatekeeper |
| mongodb | Install mongodb |
| grafana | Install grafana |
| kube-image-prefetch | Install kube-image-prefetch |
| consul-connect | Install Consul Service Mesh |
| argocd | Install argocd |
| prometheus | Install Prometheus for monitoring |
| istio | Install istio |
| crossplane | Install Crossplane |
| cockroachdb | Install CockroachDB |
| kube-state-metrics | Install kube-state-metrics |
| kubernetes-dashboard | Install kubernetes-dashboard |
| kuma | Install Kuma |
| kyverno | Install Kyverno |
| linkerd | Install linkerd |
| loki | Install Loki for monitoring and tracing |
| metallb-arp | Install MetalLB in L2 (ARP) mode |
| metrics-server | Install metrics-server |
| minio | Install minio |
| mongodb | Install mongodb |
| mqtt-connector | Install mqtt-connector for OpenFaaS |
| nats-connector | Install OpenFaaS connector for NATS |
| nfs-provisioner | Install nfs subdir external provisioner |
| nginx-inc | Install nginx-inc for OpenFaaS |
| opa-gatekeeper | Install Open Policy Agent (OPA) Gatekeeper |
| openfaas | Install openfaas |
| openfaas-ingress | Install openfaas ingress with TLS |
| openfaas-loki | Install Loki-OpenFaaS and Configure Loki logs provider for OpenFaaS |
| portainer | Install portainer to visualise and manage containers |
| postgresql | Install postgresql |
| prometheus | Install Prometheus for monitoring |
| qemu-static | Install qemu-user-static |
| rabbitmq | Install rabbitmq |
| redis | Install redis |
| registry-creds | Install registry-creds |
| sealed-secret | Install sealed-secrets |
| tekton | Install Tekton pipelines and dashboard |
| traefik2 | Install traefik2 |
| kafka-connector | Install kafka-connector for OpenFaaS |
| gitea | Install gitea |
| influxdb | Install influxdb |
| nats-connector | Install OpenFaaS connector for NATS |
| kyverno | Install Kyverno |
| waypoint | Install Waypoint |

There are 55 apps that you can install on your cluster.

> Note to contributors, run `arkade install --print-table` to generate this list
<!-- [[[end]]] -->

### Catalog of CLIs

| TOOL | DESCRIPTION |
<!-- [[[cog
import cog
import subprocess
cog.outl(subprocess.getoutput("arkade get --output markdown"))
]]] -->
| TOOL | DESCRIPTION |
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| argocd | Declarative, GitOps continuous delivery tool for Kubernetes. |
| argocd-autopilot | An opinionated way of installing Argo-CD and managing GitOps repositories. |
Expand All @@ -575,8 +584,8 @@ There are 55 apps that you can install on your cluster.
| flux | Continuous Delivery solution for Kubernetes powered by GitOps Toolkit. |
| fzf | General-purpose command-line fuzzy finder |
| gh | GitHub’s official command line tool. |
| gomplate | A flexible commandline tool for template rendering. Supports lots of local and remote datasources. |
| golangci-lint | Go linters aggregator. |
| gomplate | A flexible commandline tool for template rendering. Supports lots of local and remote datasources. |
| goreleaser | Deliver Go binaries as fast and easily as possible |
| helm | The Kubernetes Package Manager: Think of it like apt/yum/homebrew for Kubernetes. |
| helmfile | Deploy Kubernetes Helm Charts |
Expand Down Expand Up @@ -653,5 +662,4 @@ There are 55 apps that you can install on your cluster.
| waypoint | Easy application deployment for Kubernetes and Amazon ECS |
| yq | Portable command-line YAML processor. |
There are 98 tools, use 'arkade get NAME' to download one.

> Note to contributors, run `arkade get --output markdown` to generate this list
<!-- [[[end]]] -->
11 changes: 9 additions & 2 deletions cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cmd
import (
"fmt"
"os"
"sort"

"github.com/alexellis/arkade/cmd/apps"
"github.com/olekukonko/tablewriter"
Expand Down Expand Up @@ -51,8 +52,14 @@ command.`,
table.SetCenterSeparator("|")
table.SetAutoWrapText(false)

for k, v := range appList {
table.Append([]string{k, v.Installer().Short})
keys := make([]string, 0)
for k := range appList {
keys = append(keys, k)
}
sort.Strings(keys)

for _, key := range keys {
table.Append([]string{key, appList[key].Installer().Short})
}

table.Render()
Expand Down