This commit is contained in:
Danish 2026-08-27 06:01:44 +00:00 committed by GitHub
commit bd9b13cb54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 49 additions and 28 deletions

View File

@ -54,10 +54,9 @@ Both checks are required before proceeding with the installation.
## Installing the Barman Cloud Plugin ## Installing the Barman Cloud Plugin
import { InstallationSnippet } from '@site/src/components/Installation'; import { InstallationSnippet, ManifestVersion } from '@site/src/components/Installation';
Install the plugin using `kubectl` by applying the manifest for the latest Install the plugin using `kubectl` by applying the manifest for <ManifestVersion />:
release:
<InstallationSnippet /> <InstallationSnippet />
@ -100,10 +99,6 @@ This confirms that the plugin is deployed and ready to use.
## Testing the latest development snapshot ## Testing the latest development snapshot
You can also test the latest development snapshot of the plugin with the import { DevSnapshotSection } from '@site/src/components/Installation';
following command:
```sh <DevSnapshotSection />
kubectl apply -f \
https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml
```

View File

@ -2,6 +2,10 @@ import {ReactElement} from 'react';
import CodeBlock from '@theme/CodeBlock'; import CodeBlock from '@theme/CodeBlock';
import {useActiveVersion} from '@docusaurus/plugin-content-docs/client'; import {useActiveVersion} from '@docusaurus/plugin-content-docs/client';
// DEV_MANIFEST_URL is the URL of the manifest.yaml on the main branch of the plugin repo.
const DEV_MANIFEST_URL =
'https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml';
// InstallationSnippet is the kubectl incantation to install the Barman // InstallationSnippet is the kubectl incantation to install the Barman
// Cloud Plugin: the manifest matching the doc version being viewed, or // Cloud Plugin: the manifest matching the doc version being viewed, or
// (on the unreleased "current" docs) the latest manifest on main. // (on the unreleased "current" docs) the latest manifest on main.
@ -9,7 +13,7 @@ export function InstallationSnippet(): ReactElement<null> {
const activeVersion = useActiveVersion('default'); const activeVersion = useActiveVersion('default');
const url = activeVersion && activeVersion.name !== 'current' const url = activeVersion && activeVersion.name !== 'current'
? `https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/v${activeVersion.name}/manifest.yaml` ? `https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/v${activeVersion.name}/manifest.yaml`
: 'https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml'; : DEV_MANIFEST_URL;
return ( return (
<CodeBlock language="sh"> <CodeBlock language="sh">
{`kubectl apply -f \\ {`kubectl apply -f \\
@ -17,3 +21,35 @@ export function InstallationSnippet(): ReactElement<null> {
</CodeBlock> </CodeBlock>
); );
} }
// ManifestVersion names the manifest the snippet below installs: the
// release tag for a versioned docs page, or the main branch on Dev docs.
export function ManifestVersion(): ReactElement<null> {
const activeVersion = useActiveVersion('default');
return activeVersion && activeVersion.name !== 'current'
? <code>v{activeVersion.name}</code>
: <>the latest development snapshot from the <code>main</code> branch</>;
}
// DevSnapshotSection offers the main-branch manifest as an alternative;
// on the Dev docs the main install already is that manifest, so hide it.
export function DevSnapshotSection(): ReactElement {
const activeVersion = useActiveVersion('default');
if (!activeVersion || activeVersion.name === 'current') {
return (
<p>The <a href="#installing-the-barman-cloud-plugin">install
command above</a> already applies the latest development
snapshot from the <code>main</code> branch.</p>
);
}
return (
<>
<p>You can also test the latest development snapshot of the plugin
with the following command:</p>
<CodeBlock language="sh">
{`kubectl apply -f \\
${DEV_MANIFEST_URL}`}
</CodeBlock>
</>
);
}

View File

@ -54,10 +54,9 @@ Both checks are required before proceeding with the installation.
## Installing the Barman Cloud Plugin ## Installing the Barman Cloud Plugin
import { InstallationSnippet } from '@site/src/components/Installation'; import { InstallationSnippet, ManifestVersion } from '@site/src/components/Installation';
Install the plugin using `kubectl` by applying the manifest for the latest Install the plugin using `kubectl` by applying the manifest for <ManifestVersion />:
release:
<InstallationSnippet /> <InstallationSnippet />
@ -100,10 +99,6 @@ This confirms that the plugin is deployed and ready to use.
## Testing the latest development snapshot ## Testing the latest development snapshot
You can also test the latest development snapshot of the plugin with the import { DevSnapshotSection } from '@site/src/components/Installation';
following command:
```sh <DevSnapshotSection />
kubectl apply -f \
https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml
```

View File

@ -54,10 +54,9 @@ Both checks are required before proceeding with the installation.
## Installing the Barman Cloud Plugin ## Installing the Barman Cloud Plugin
import { InstallationSnippet } from '@site/src/components/Installation'; import { InstallationSnippet, ManifestVersion } from '@site/src/components/Installation';
Install the plugin using `kubectl` by applying the manifest for the latest Install the plugin using `kubectl` by applying the manifest for <ManifestVersion />:
release:
<InstallationSnippet /> <InstallationSnippet />
@ -100,10 +99,6 @@ This confirms that the plugin is deployed and ready to use.
## Testing the latest development snapshot ## Testing the latest development snapshot
You can also test the latest development snapshot of the plugin with the import { DevSnapshotSection } from '@site/src/components/Installation';
following command:
```sh <DevSnapshotSection />
kubectl apply -f \
https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml
```