2020-06-01 21:48:25 +00:00
|
|
|
import VERSION from 'data/version.js'
|
2020-02-06 23:45:31 +00:00
|
|
|
import ProductDownloader from '@hashicorp/react-product-downloader'
|
|
|
|
import Head from 'next/head'
|
2020-03-16 17:10:31 +00:00
|
|
|
import HashiHead from '@hashicorp/react-head'
|
2020-02-06 23:45:31 +00:00
|
|
|
|
2020-06-01 21:48:25 +00:00
|
|
|
export default function DownloadsPage({ releaseData }) {
|
2020-02-06 23:45:31 +00:00
|
|
|
return (
|
|
|
|
<div id="p-downloads" className="g-container">
|
2020-03-16 17:10:31 +00:00
|
|
|
<HashiHead is={Head} title="Downloads | Nomad by HashiCorp" />
|
2020-02-06 23:45:31 +00:00
|
|
|
<ProductDownloader
|
|
|
|
product="Nomad"
|
|
|
|
version={VERSION}
|
2020-06-01 21:48:25 +00:00
|
|
|
releaseData={releaseData}
|
2020-03-02 20:11:18 +00:00
|
|
|
community="/resources"
|
2020-10-27 16:20:11 +00:00
|
|
|
prerelease={{
|
|
|
|
type: 'Beta',
|
|
|
|
name: 'v1.0.0',
|
|
|
|
version: '1.0.0-beta2'
|
|
|
|
}}
|
2020-02-06 23:45:31 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-03-25 20:34:16 +00:00
|
|
|
export async function getStaticProps() {
|
2020-02-06 23:45:31 +00:00
|
|
|
return fetch(`https://releases.hashicorp.com/nomad/${VERSION}/index.json`)
|
2020-06-01 21:48:25 +00:00
|
|
|
.then((res) => res.json())
|
|
|
|
.then((releaseData) => ({ props: { releaseData } }))
|
2020-03-03 20:31:05 +00:00
|
|
|
.catch(() => {
|
|
|
|
throw new Error(
|
|
|
|
`--------------------------------------------------------
|
|
|
|
Unable to resolve version ${VERSION} on releases.hashicorp.com from link
|
|
|
|
<https://releases.hashicorp.com/nomad/${VERSION}/index.json>. Usually this
|
|
|
|
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-02-06 23:45:31 +00:00
|
|
|
}
|