Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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
16 changes: 11 additions & 5 deletions .github/workflows/modular-docs-publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# This workflow will generate modular docs and publish to the modular-docs branch

name: Modular docs publish
name: Downstream docs publish

# on:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will be enabled once approved. We use other trigger for testing

# push:
# tags:
# - 'v*'

## For testing
on:
push:
branches: [ main ]
branches: [ adoc-modular ]

jobs:
build:
Expand All @@ -16,10 +22,10 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- run: make generate-modular-docs
name: Generate modular-docs
- run: make generate-downstream-docs
name: Generate generate-downstream-docs
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: modular-docs # The branch the action should deploy to.
branch: downstream-docs # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,5 +268,18 @@
"--yes"
]
},
{
"name": "Docs",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/rhoas",
"env": {},
"args": [
"docs",
"--file-format", "adoc",
"--dir", "./docs/commands"
]
},
]
}
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ check-docs: generate-docs ## Check whether reference documentation needs to be g

generate-docs: ## Generate command-line reference documentation
rm -rf ./docs/commands/*
go run ./cmd/rhoas docs --dir ./docs/commands --file-format adoc
go run ./cmd/rhoas docs --dir ./docs/commands --file-format md
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Markdown by default - same rules as with adoc (already replaced in the PR).
Downstream gets adoc files that are pushed to separate branch that no one will see.

Copy link
Contributor

Choose a reason for hiding this comment

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

tip: md is already the default value, so you could omit it, if you wanted to.

.PHONY: generate-docs

generate-modular-docs: generate-docs ## Generate modular command-line reference documentation
SRC_DIR=$$(pwd)/docs/commands DEST_DIR=$$(pwd)/dist go run ./cmd/modular-docs
.PHONY: generate-modular-docs
generate-downstream-docs: ## Generate command-line reference documentation in adoc format
rm -rf ./docs/commands/*
go run ./cmd/rhoas docs --dir ./dist --file-format adoc
Comment on lines +92 to +93
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this removing ./docs/commands, but then generating the documentation into a completely different directory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Very good question. I think I need to provide documentation for that in the contributing to make it clear.

So the new workflow will split upstream and downstream:

  1. We will have markdown ./docs/commands/ (./docs/commands/rhoas-cluster.md).
    I did not push that markdown here due to number of files created that will obfuscate already large PR
    Phase 2 for this would be to use that markdown with docusaurus website and create couple other placeholders like CLI guidelines etc.

  2. We will have adoc/downstream pushed to different branch (only on releases) - for that we use ./dist/ folder that is gitignored so we can use it to push entire content to the new branch using github action.

.PHONY: generate-downstream-docs

lint-lang: ## Lint i18n files
go install github.com/redhat-developer/app-services-go-linter/cmd/app-services-go-linter@latest
Expand Down
16 changes: 0 additions & 16 deletions cmd/modular-docs/main.go

This file was deleted.

107 changes: 0 additions & 107 deletions docs/commands/rhoas.adoc

This file was deleted.

48 changes: 48 additions & 0 deletions docs/commands/rhoas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## rhoas

RHOAS CLI

### Synopsis

Red Hat OpenShift Application Services

Manage your application services from the command line. You can manage service accounts, Kafka instances, and Service Registry instances, and connect them to your OpenShift clusters and applications.


### Examples

```
# Authenticate securely through your web browser
$ rhoas login

# Create a Kafka instance
$ rhoas kafka create --name my-kafka-instance

# Create a service account and save credentials to a JSON file
$ rhoas service-account create -o json

# Connect your Kubernetes/OpenShift cluster to a service
$ rhoas cluster connect

```

### Options

```
-h, --help Show help for a command
-v, --verbose Enable verbose mode
--version Show rhoas version
```

### SEE ALSO

* [rhoas cluster](rhoas_cluster.md) - View and perform operations on your Kubernetes or OpenShift cluster
* [rhoas completion](rhoas_completion.md) - Install command completion for your shell (bash, zsh, or fish)
* [rhoas kafka](rhoas_kafka.md) - Create, view, use, and manage your Kafka instances
* [rhoas login](rhoas_login.md) - Log in to RHOAS
* [rhoas logout](rhoas_logout.md) - Log out from RHOAS
* [rhoas service-account](rhoas_service-account.md) - Create, list, describe, delete, and update service accounts
* [rhoas service-registry](rhoas_service-registry.md) - Service Registry commands
* [rhoas status](rhoas_status.md) - View the status of your application services
* [rhoas whoami](rhoas_whoami.md) - Output the current username

78 changes: 0 additions & 78 deletions docs/commands/rhoas_cluster.adoc

This file was deleted.

43 changes: 43 additions & 0 deletions docs/commands/rhoas_cluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## rhoas cluster

View and perform operations on your Kubernetes or OpenShift cluster

### Synopsis

Connect and bind your services to Kubernetes or OpenShift applications. You can also check if the Kubernetes or OpenShift cluster has the required Operators to perform this operation.

### Examples

```
# Check the status of the connection to your cluster
$ rhoas cluster status

# Connect to cluster without including currently selected services
$ rhoas cluster connect --ignore-context

# Connect to cluster using the specified token
$ rhoas cluster connect --token=value

# Connect to cluster and save script to create service binding
$ rhoas cluster connect --yes > create_service_binding.sh

# Connect managed service with your application
$ rhoas cluster bind

```

### Options inherited from parent commands

```
-h, --help Show help for a command
-v, --verbose Enable verbose mode
```

### SEE ALSO

* [rhoas](rhoas.md) - RHOAS CLI
* [rhoas cluster bind](rhoas_cluster_bind.md) - Connect your RHOAS services to Kubernetes or OpenShift applications
* [rhoas cluster clean](rhoas_cluster_clean.md) - Remove all resources created by cluster extensions
* [rhoas cluster connect](rhoas_cluster_connect.md) - Connect your services to Kubernetes or OpenShift
* [rhoas cluster status](rhoas_cluster_status.md) - View the status of the current Kubernetes or OpenShift cluster

Loading