|
|
|
|
@ -1,7 +1,10 @@
|
|
|
|
|
import {ReactElement} from 'react';
|
|
|
|
|
import CodeBlock from '@theme/CodeBlock';
|
|
|
|
|
import {useActiveVersion} from '@docusaurus/plugin-content-docs/client';
|
|
|
|
|
import Heading from '@theme/Heading';
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
// Cloud Plugin: the manifest matching the doc version being viewed, or
|
|
|
|
|
@ -10,7 +13,7 @@ export function InstallationSnippet(): ReactElement<null> {
|
|
|
|
|
const activeVersion = useActiveVersion('default');
|
|
|
|
|
const url = activeVersion && activeVersion.name !== 'current'
|
|
|
|
|
? `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 (
|
|
|
|
|
<CodeBlock language="sh">
|
|
|
|
|
{`kubectl apply -f \\
|
|
|
|
|
@ -24,25 +27,28 @@ export function InstallationSnippet(): ReactElement<null> {
|
|
|
|
|
export function ManifestVersion(): ReactElement<null> {
|
|
|
|
|
const activeVersion = useActiveVersion('default');
|
|
|
|
|
return activeVersion && activeVersion.name !== 'current'
|
|
|
|
|
? <>version <code>v{activeVersion.name}</code></>
|
|
|
|
|
? <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<null> | null {
|
|
|
|
|
export function DevSnapshotSection(): ReactElement {
|
|
|
|
|
const activeVersion = useActiveVersion('default');
|
|
|
|
|
const url = 'https://raw.githubusercontent.com/cloudnative-pg/plugin-barman-cloud/refs/heads/main/manifest.yaml';
|
|
|
|
|
if (!activeVersion || activeVersion.name === 'current') return null;
|
|
|
|
|
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 (
|
|
|
|
|
<>
|
|
|
|
|
<Heading as="h2" id="testing-the-latest-development-snapshot">
|
|
|
|
|
Testing the latest development snapshot
|
|
|
|
|
</Heading>
|
|
|
|
|
<p>You can also test the latest development snapshot of the plugin
|
|
|
|
|
with the following command:</p>
|
|
|
|
|
<CodeBlock language="sh">
|
|
|
|
|
{`kubectl apply -f \\
|
|
|
|
|
${url}`}
|
|
|
|
|
${DEV_MANIFEST_URL}`}
|
|
|
|
|
</CodeBlock>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
|