2020-01-18 00:18:09 +00:00
|
|
|
import Head from 'next/head'
|
2020-07-21 22:11:32 +00:00
|
|
|
import Link from 'next/link'
|
2021-04-07 01:28:42 +00:00
|
|
|
import ProductDownloader from '@hashicorp/react-product-downloader'
|
2020-03-30 17:30:56 +00:00
|
|
|
import HashiHead from '@hashicorp/react-head'
|
2021-04-07 01:28:42 +00:00
|
|
|
import { VERSION, CHANGELOG_URL, packageManagers } from 'data/version'
|
|
|
|
import { productName, productSlug } from 'data/metadata'
|
|
|
|
import s from './style.module.css'
|
2020-01-18 00:18:09 +00:00
|
|
|
|
2021-04-07 01:28:42 +00:00
|
|
|
export default function DownloadsPage({ releases }) {
|
2020-04-22 20:27:34 +00:00
|
|
|
const changelogUrl = CHANGELOG_URL.length
|
|
|
|
? CHANGELOG_URL
|
|
|
|
: `https://github.com/hashicorp/vault/blob/v${VERSION}/CHANGELOG.md`
|
2020-01-18 00:18:09 +00:00
|
|
|
return (
|
|
|
|
<div id="p-downloads" className="g-container">
|
2020-03-30 17:30:56 +00:00
|
|
|
<HashiHead is={Head} title="Downloads | Vault by Hashicorp" />
|
2020-01-18 00:18:09 +00:00
|
|
|
<ProductDownloader
|
2021-04-07 01:28:42 +00:00
|
|
|
releases={releases}
|
|
|
|
packageManagers={packageManagers}
|
|
|
|
productName={productName}
|
|
|
|
productId={productSlug}
|
|
|
|
latestVersion={VERSION}
|
|
|
|
changelog={changelogUrl}
|
|
|
|
getStartedDescription="Follow step-by-step tutorials on the essentials of Nomad."
|
|
|
|
getStartedLinks={[
|
|
|
|
{
|
|
|
|
label: 'Getting Started with the CLI',
|
|
|
|
href:
|
|
|
|
'http://learn.hashicorp.com/collections/vault/getting-started',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Getting Started with Vault UI',
|
|
|
|
href:
|
|
|
|
'http://learn.hashicorp.com/collections/vault/getting-started-ui',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Vault on HCP',
|
|
|
|
href:
|
|
|
|
'http://learn.hashicorp.com/collections/vault/getting-started-ui',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'View all Vault tutorials',
|
|
|
|
href: 'https://learn.hashicorp.com/vault',
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
logo={
|
|
|
|
<img
|
|
|
|
className={s.logo}
|
|
|
|
alt="Nomad"
|
|
|
|
src={require('./img/vault-logo.svg')}
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
tutorialLink={{
|
|
|
|
href: 'https://learn.hashicorp.com/vault',
|
|
|
|
label: 'View Tutorials at HashiCorp Learn',
|
|
|
|
}}
|
|
|
|
merchandisingSlot={
|
|
|
|
<p className={s.releaseNote}>
|
|
|
|
Release notes are available in our{' '}
|
|
|
|
<Link href={`/docs/release-notes/${VERSION}`}>
|
|
|
|
<a>documentation</a>
|
|
|
|
</Link>
|
|
|
|
.
|
|
|
|
</p>
|
|
|
|
}
|
|
|
|
/>
|
2020-01-18 00:18:09 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-03-16 18:56:44 +00:00
|
|
|
export async function getStaticProps() {
|
2021-04-07 01:28:42 +00:00
|
|
|
return fetch(`https://releases.hashicorp.com/vault/index.json`, {
|
|
|
|
headers: {
|
|
|
|
'Cache-Control': 'no-cache',
|
|
|
|
},
|
|
|
|
})
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then((result) => {
|
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
releases: result,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
2020-03-13 22:42:56 +00:00
|
|
|
.catch(() => {
|
|
|
|
throw new Error(
|
|
|
|
`--------------------------------------------------------
|
|
|
|
Unable to resolve version ${VERSION} on releases.hashicorp.com from link
|
2021-04-07 01:28:42 +00:00
|
|
|
<https://releases.hashicorp.com/${productSlug}/${VERSION}/index.json>. Usually this
|
2020-03-13 22:42:56 +00:00
|
|
|
means that the specified version has not yet been released. The downloads page
|
|
|
|
version can only be updated after the new version has been released, to ensure
|
|
|
|
that it works for all users.
|
|
|
|
----------------------------------------------------------`
|
|
|
|
)
|
|
|
|
})
|
2020-01-18 00:18:09 +00:00
|
|
|
}
|