Skip to content

Commit

Permalink
feat(docs-page): edit this page (#373)
Browse files Browse the repository at this point in the history
* feat(docs-page): construct githubFileUrl
* chore: changeset
* chore: update fixtures and snapshots
* feat: display github link on latest; hide on older

Co-authored-by: Bryce Kalow <bkalow@hashicorp.com>
  • Loading branch information
thiskevinwang and Bryce Kalow committed Oct 4, 2021
1 parent fe1fe69 commit 4a5204b
Show file tree
Hide file tree
Showing 10 changed files with 829 additions and 140 deletions.
8 changes: 8 additions & 0 deletions .changeset/orange-horses-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@hashicorp/react-docs-page': minor
---

construct githubFileUrl to be used w/ **Edit this page**

- This links to the `main` branch file while on the latest version
- This is hidden for non-latest versions
13 changes: 6 additions & 7 deletions packages/docs-page/content-api/__fixtures__/document_200.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@
},
"result": {
"product": "waypoint",
"githubFile": "website/content/commands/index.mdx",
"metadata": {
"layout": "commands",
"description": "Post-Helm-install bootstrapping",
"page_title": "Commands: K8s bootstrap",
"sidebar_title": "k8s bootstrap"
"page_title": "Waypoint Commands (CLI)"
},
"version": "v0.5.x",
"created_at": "Thu Sep 23 2021 05:12:48 GMT+0000 (Coordinated Universal Time)",
"markdownSource": "# Waypoint K8s bootstrap\n\nCommand: `waypoint k8s bootstrap`\n\nPost-Helm-install bootstrapping\n\n## Usage\n\nUsage: `waypoint k8s bootstrap [options]`\n\nBootstrap a Waypoint installation from the Waypoint Helm chart.\nThis is an internal command and not expected to be manually executed.\nThis command only works with in-cluster Kubernetes authentication and\nwill not work with out-of-cluster kubectl configuration.\n\nThis command will do a number of things:\n\n1. Equivalent of \"waypoint server bootstrap\"\n2. Write a bootstrap token to the given Kubernetes secret\n3. Create a token for a static runner and write it to the configured\n Kubernetes secret.\n4. Configure Kubernetes on-demand runners.\n\nThis command will only run if the server hasn't already been bootstrapped.\nIf the server is bootstrapped, this will not run again. This doesn't handle\npartial failures well: if the server bootstrap succeeds but writing the\nsecret fails, then the Waypoint installation should be fully uninstalled\nand then reinstalled. This is only use for fresh installations so there\nshould be no concern of data loss in the event of a bootstrap failure.\n\n#### Global Options\n\n- `-plain` - Plain output: no colors, no animation.\n- `-app=<string>` - App to target. Certain commands require a single app target for Waypoint configurations with multiple apps. If you have a single app, then this can be ignored.\n- `-workspace=<string>` - Workspace to operate in.\n\n#### Connection Options\n\n- `-server-addr=<string>` - Address for the server.\n- `-server-tls` - True if the server should be connected to via TLS.\n- `-server-tls-skip-verify` - True to skip verification of the TLS certificate advertised by the server.\n\n#### Command Options\n\n- `-root-token-secret=<string>` - The name of the Kubernetes secret to write the root token to.\n- `-runner-token-secret=<string>` - The name of the Kubernetes secret to write the runner token to.\n- `-odr-image=<string>` - The name and label of the container image to use for ODR.\n- `-odr-service-account=<string>` - The name of the Kubernetes service account to use for ODR.\n- `-odr-image-pull-policy=<string>` - The pull policy to use for the container image.\n- `-advertise-service=<string>` - The name of the service to advertise.\n- `-advertise-tls` - True if the advertise addr supports TLS.\n- `-advertise-tls-skip-verify` - True if the advertise addr TLS shouldn't be verified.\n",
"created_at": "Sat Oct 02 2021 23:52:13 GMT+0000 (Coordinated Universal Time)",
"markdownSource": "# Waypoint Commands (CLI)\n\nWaypoint is controlled via a very easy to use command-line interface (CLI). Waypoint\nis only a single command-line application: `waypoint`. This application then takes a\nsubcommand such as `artifact` or `deployment`. The complete list of subcommands is in\nthe navigation to the left.\n\nThe waypoint CLI is a well-behaved command line application. In erroneous cases, a\nnon-zero exit status will be returned. It also responds to -h and --help as you'd most\nlikely expect.\n\nTo view a list of the available commands at any time, just run waypoint with no arguments:\n\n```shell-session\n$ waypoint\nUsage: waypoint [-version] [-help] [-autocomplete-(un)install] <command> [args]\n\nCommon commands:\n build Build a new versioned artifact from source\n deploy Deploy a pushed artifact\n release Release a deployment\n up Perform the build, deploy, and release steps for the app\n\nOther commands:\n artifact Artifact and build management\n auth-method Auth method management\n config Application configuration management\n context Server access configurations\n deployment Deployment creation and management\n destroy Delete all the resources created for an app\n docs Show documentation for components\n exec Execute a command in the context of a running application instance\n fmt Rewrite waypoint.hcl configuration to a canonical format\n hostname Application URLs\n init Initialize and validate a project\n install Install the Waypoint server to Kubernetes, Nomad, or Docker\n logs Show log output from the current application deployment\n project Project management\n runner Runner management\n server Server management\n ui Open the web UI\n user User information and management\n version Prints the version of this Waypoint CLI\n```\n\nTo get help for any specific command, pass the -h flag to the relevant subcommand.\nFor example, to see help about the up subcommand:\n\n```shell-session\n$ waypoint up -h\nUsage: waypoint up [options]\n\n Perform the build, deploy, and release steps for the app.\n\nGlobal Options:\n\n -workspace=<string>\n Workspace to operate in. Defaults to 'default'. The default is default.\n\nOperation Options:\n\n -label=<key=value>\n Labels to set for this operation. Can be specified multiple times.\n\n -remote\n True to use a remote runner to execute. This defaults to false unless\n 'runner.default' is set in your configuration. The default is false.\n\n -remote-source=<key=value>\n Override configurations for how remote runners source data. This is\n specified to the data source type being used in your configuration. This\n is used for example to set a specific Git ref to run against.\n```\n\nRunning `waypoint -autocomplete-install` will add the waypoint autocomplete capability\nso you can do `waypoint <tab>` on commands. Running `waypoint -autocomplete-uninstall`\nwill remove it. Please note that this will modify your shell init script, so you will\nneed to reload your shell.\n",
"mdxTransforms": [
"extract-frontmatter",
"include-partials",
"paragraph-custom-alerts"
],
"sha": "bf16748cdeac6915a65442086a347ad56488b55f",
"sha": "f441834f6a78b94c9108f1bf348c793b3bba08a6",
"subpath": "commands",
"fullPath": "doc/v0.5.x/commands/k8s-bootstrap"
"fullPath": "doc/v0.5.x/commands"
}
}
28 changes: 28 additions & 0 deletions packages/docs-page/content-api/__fixtures__/document_v0.4.x.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"meta": {
"status_code": 200,
"status_text": "OK"
},
"result": {
"product": "waypoint",
"githubFile": "website/content/commands/index.mdx",
"metadata": {
"layout": "commands",
"page_title": "Waypoint Commands (CLI)"
},
"version": "v0.4.x",
"created_at": "Sat Oct 02 2021 23:51:18 GMT+0000 (Coordinated Universal Time)",
"markdownSource": "# Waypoint Commands (CLI)\n\nWaypoint is controlled via a very easy to use command-line interface (CLI). Waypoint\nis only a single command-line application: `waypoint`. This application then takes a\nsubcommand such as `artifact` or `deployment`. The complete list of subcommands is in\nthe navigation to the left.\n\nThe waypoint CLI is a well-behaved command line application. In erroneous cases, a\nnon-zero exit status will be returned. It also responds to -h and --help as you'd most\nlikely expect.\n\nTo view a list of the available commands at any time, just run waypoint with no arguments:\n\n```shell-session\n$ waypoint\nUsage: waypoint [-version] [-help] [-autocomplete-(un)install] <command> [args]\n\nCommon commands:\n build Build a new versioned artifact from source\n deploy Deploy a pushed artifact\n release Release a deployment\n up Perform the build, deploy, and release steps for the app\n\nOther commands:\n artifact Artifact and build management\n config Application configuration management\n context Server access configurations\n deployment Deployment creation and management\n destroy Delete all the resources created for an app\n docs Show documentation for components\n exec Execute a command in the context of a running application instance\n fmt Rewrite waypoint.hcl configuration to a canonical format\n hostname Application URLs\n init Initialize and validate a project\n install Install the Waypoint server to Kubernetes, Nomad, or Docker\n logs Show log output from the current application deployment\n project Project management\n runner Runner management\n server Server management\n token Authenticate and invite collaborators\n ui Open the web UI\n version Prints the version of this Waypoint CLI\n```\n\nTo get help for any specific command, pass the -h flag to the relevant subcommand.\nFor example, to see help about the up subcommand:\n\n```shell-session\n$ waypoint up -h\nUsage: waypoint up [options]\n\n Perform the build, deploy, and release steps for the app.\n\nGlobal Options:\n\n -workspace=<string>\n Workspace to operate in. Defaults to 'default'. The default is default.\n\nOperation Options:\n\n -label=<key=value>\n Labels to set for this operation. Can be specified multiple times.\n\n -remote\n True to use a remote runner to execute. This defaults to false unless\n 'runner.default' is set in your configuration. The default is false.\n\n -remote-source=<key=value>\n Override configurations for how remote runners source data. This is\n specified to the data source type being used in your configuration. This\n is used for example to set a specific Git ref to run against.\n```\n\nRunning `waypoint -autocomplete-install` will add the waypoint autocomplete capability\nso you can do `waypoint <tab>` on commands. Running `waypoint -autocomplete-uninstall`\nwill remove it. Please note that this will modify your shell init script, so you will\nneed to reload your shell.\n",
"mdxTransforms": [
"extract-frontmatter",
"include-partials",
"paragraph-custom-alerts",
"rewrite-internal-redirects",
"rewrite-internal-links-v2",
"rewrite-static-assets"
],
"sha": "48f450f6330f39d5e4f2a92f6480a77742e40d2b",
"subpath": "commands",
"fullPath": "doc/v0.4.x/commands"
}
}
48 changes: 15 additions & 33 deletions packages/docs-page/content-api/__fixtures__/navData_200.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
},
"result": {
"product": "waypoint",
"githubFile": "website/content/commands-nav-data.json",
"version": "v0.5.x",
"created_at": "Thu Sep 23 2021 07:56:42 GMT+0000 (Coordinated Universal Time)",
"sha": "214900057317f9fd63eae31f3414a0ba383faa9e",
"created_at": "Sat Oct 02 2021 23:52:11 GMT+0000 (Coordinated Universal Time)",
"sha": "f441834f6a78b94c9108f1bf348c793b3bba08a6",
"subpath": "commands",
"fullPath": "nav-data/v0.5.x/commands",
"navData": [
Expand Down Expand Up @@ -202,18 +203,6 @@
"title": "runner agent",
"path": "runner-agent"
},
{
"title": "runner list",
"path": "runner-list"
},
{
"title": "runner on-demand inspect",
"path": "runner-on-demand-inspect"
},
{
"title": "runner on-demand set",
"path": "runner-on-demand-set"
},
{
"title": "server bootstrap",
"path": "server-bootstrap"
Expand Down Expand Up @@ -250,6 +239,18 @@
"title": "status",
"path": "status"
},
{
"title": "token exchange",
"path": "token-exchange"
},
{
"title": "token invite",
"path": "token-invite"
},
{
"title": "token new",
"path": "token-new"
},
{
"title": "user inspect",
"path": "user-inspect"
Expand All @@ -269,25 +270,6 @@
{
"title": "version",
"path": "version"
},
{
"divider": true
},
{
"title": "k8s bootstrap",
"path": "k8s-bootstrap"
},
{
"title": "token exchange",
"path": "token-exchange"
},
{
"title": "token invite",
"path": "token-invite"
},
{
"title": "token new",
"path": "token-new"
}
]
}
Expand Down
228 changes: 228 additions & 0 deletions packages/docs-page/content-api/__fixtures__/navData_v0.4.x.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
{
"meta": {
"status_code": 200,
"status_text": "OK"
},
"result": {
"product": "waypoint",
"githubFile": "website/content/commands-nav-data.json",
"version": "v0.4.x",
"created_at": "Sat Oct 02 2021 23:51:16 GMT+0000 (Coordinated Universal Time)",
"sha": "48f450f6330f39d5e4f2a92f6480a77742e40d2b",
"subpath": "commands",
"fullPath": "nav-data/v0.4.x/commands",
"navData": [
{
"title": "build",
"path": "v0.4.x/build"
},
{
"title": "deploy",
"path": "v0.4.x/deploy"
},
{
"title": "context",
"path": "v0.4.x/context"
},
{
"title": "context-inspect",
"path": "v0.4.x/context-inspect"
},
{
"title": "destroy",
"path": "v0.4.x/destroy"
},
{
"title": "exec",
"path": "v0.4.x/exec"
},
{
"title": "init",
"path": "v0.4.x/init"
},
{
"title": "install",
"path": "v0.4.x/install"
},
{
"title": "logs",
"path": "v0.4.x/logs"
},
{
"title": "project apply",
"path": "v0.4.x/project-apply"
},
{
"title": "release",
"path": "v0.4.x/release"
},
{
"title": "ui",
"path": "v0.4.x/ui"
},
{
"title": "up",
"path": "v0.4.x/up"
},
{
"divider": true
},
{
"title": "artifact build",
"path": "v0.4.x/artifact-build"
},
{
"title": "artifact list-builds",
"path": "v0.4.x/artifact-list-builds"
},
{
"title": "artifact list",
"path": "v0.4.x/artifact-list"
},
{
"title": "artifact push",
"path": "v0.4.x/artifact-push"
},
{
"title": "config get",
"path": "v0.4.x/config-get"
},
{
"title": "config set",
"path": "v0.4.x/config-set"
},
{
"title": "config source-get",
"path": "v0.4.x/config-source-get"
},
{
"title": "config source-set",
"path": "v0.4.x/config-source-set"
},
{
"title": "config sync",
"path": "v0.4.x/config-sync"
},
{
"title": "context clear",
"path": "v0.4.x/context-clear"
},
{
"title": "context create",
"path": "v0.4.x/context-create"
},
{
"title": "context delete",
"path": "v0.4.x/context-delete"
},
{
"title": "context list",
"path": "v0.4.x/context-list"
},
{
"title": "context rename",
"path": "v0.4.x/context-rename"
},
{
"title": "context use",
"path": "v0.4.x/context-use"
},
{
"title": "context verify",
"path": "v0.4.x/context-verify"
},
{
"title": "deployment deploy",
"path": "v0.4.x/deployment-deploy"
},
{
"title": "deployment destroy",
"path": "v0.4.x/deployment-destroy"
},
{
"title": "deployment list",
"path": "v0.4.x/deployment-list"
},
{
"title": "docs",
"path": "v0.4.x/docs"
},
{
"title": "fmt",
"path": "v0.4.x/fmt"
},
{
"title": "hostname delete",
"path": "v0.4.x/hostname-delete"
},
{
"title": "hostname list",
"path": "v0.4.x/hostname-list"
},
{
"title": "hostname register",
"path": "v0.4.x/hostname-register"
},
{
"title": "plugin",
"path": "v0.4.x/plugin"
},
{
"title": "project list",
"path": "v0.4.x/project-list"
},
{
"title": "runner agent",
"path": "v0.4.x/runner-agent"
},
{
"title": "server bootstrap",
"path": "v0.4.x/server-bootstrap"
},
{
"title": "server config-set",
"path": "v0.4.x/server-config-set"
},
{
"title": "server install",
"path": "v0.4.x/server-install"
},
{
"title": "server restore",
"path": "v0.4.x/server-restore"
},
{
"title": "server run",
"path": "v0.4.x/server-run"
},
{
"title": "server snapshot",
"path": "v0.4.x/server-snapshot"
},
{
"title": "server uninstall",
"path": "v0.4.x/server-uninstall"
},
{
"title": "server upgrade",
"path": "v0.4.x/server-upgrade"
},
{
"title": "token exchange",
"path": "v0.4.x/token-exchange"
},
{
"title": "token invite",
"path": "v0.4.x/token-invite"
},
{
"title": "token new",
"path": "v0.4.x/token-new"
},
{
"title": "version",
"path": "v0.4.x/version"
}
]
}
}

1 comment on commit 4a5204b

@vercel
Copy link

@vercel vercel bot commented on 4a5204b Oct 4, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.