Skip to content
Open
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
15 changes: 9 additions & 6 deletions web/src/components/Installation/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import {ReactElement} from 'react';
import CodeBlock from '@theme/CodeBlock';
import {useCurrentVersion} from '@site/src/hooks/versions';
import {useActiveVersion} from '@docusaurus/plugin-content-docs/client';

// InstallationSnippet is the kubectl incantation to install the lastest
// available version of the Barman Cloud Plugin.
// InstallationSnippet is the kubectl incantation to install the Barman
// Cloud Plugin: the manifest matching the doc version being viewed, or
// (on the unreleased "current" docs) the latest manifest on main.
export function InstallationSnippet(): ReactElement<null> {
const latest = useCurrentVersion('latestReleased');
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';
return (
<CodeBlock language="sh">
{`kubectl apply -f \\
https://github.com/cloudnative-pg/plugin-barman-cloud/releases/download/v${latest}/manifest.yaml`}
${url}`}
</CodeBlock>
);
}

36 changes: 0 additions & 36 deletions web/src/hooks/versions.ts

This file was deleted.

Loading