mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-09 08:42:33 -04:00
feat(website): add official and HCP Packer Ready labels (#11449)
* refactor(website): use prop and CSS for plugin label spacing * fix: add official tier label to built-in plugin docs * feat(website): add BadgesHeader component * refactor(website): use BadgesHeader in all content * feat(website): add HCP ready demo, tweak badge look * refactor: integrate work from add-plugin-version branch * fix(website): correct bad import * fix: use updated MDX custom component * chore: remove plugin version label work from this branch * chore: remove unused var * fix: use new BadgesHeader interface for dual tags * chore: remove unused var, refine comment * fix: remove unused broken import * fix: shorten property for HCP packer readiness * Apply suggestions from code review Remove a few demo labels before merging Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
This commit is contained in:
parent
cf121d899e
commit
cae7bd9e5b
33 changed files with 275 additions and 114 deletions
28
website/components/badge/index.tsx
Normal file
28
website/components/badge/index.tsx
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import React from 'react'
|
||||
import InlineSvg from '@hashicorp/react-inline-svg'
|
||||
import classnames from 'classnames'
|
||||
import s from './style.module.css'
|
||||
|
||||
type BadgeTheme = 'gray' | 'blue' | 'gold'
|
||||
|
||||
interface BadgeProps {
|
||||
label: string
|
||||
iconSvg?: string
|
||||
theme?: BadgeTheme
|
||||
}
|
||||
|
||||
function Badge({
|
||||
theme = 'gray',
|
||||
label,
|
||||
iconSvg,
|
||||
}: BadgeProps): React.ReactElement {
|
||||
return (
|
||||
<div className={classnames(s.root, s[`theme-${theme}`])}>
|
||||
{iconSvg ? <InlineSvg className={s.icon} src={iconSvg} /> : null}
|
||||
<span className={s.text}>{label}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export type { BadgeTheme }
|
||||
export default Badge
|
||||
|
|
@ -1,10 +1,23 @@
|
|||
/*
|
||||
Note: colours have been hard-coded
|
||||
to match Terraform Registry tier labels.
|
||||
*/
|
||||
.root {
|
||||
--background-color: #8f96a2;
|
||||
--text-color: #fff;
|
||||
/* theming. Note that gold and gray
|
||||
have been set to hex values in order
|
||||
to match Terraform Registry tier labels. */
|
||||
&.theme-gray {
|
||||
--background-color: #8f96a2;
|
||||
--text-color: #fff;
|
||||
}
|
||||
&.theme-light-gray {
|
||||
--background-color: var(--gray-6);
|
||||
--text-color: var(--gray-3);
|
||||
}
|
||||
&.theme-gold {
|
||||
--background-color: #f8e397;
|
||||
--text-color: #975b06;
|
||||
}
|
||||
&.theme-blue {
|
||||
--background-color: var(--packer);
|
||||
--text-color: var(--packer-text-on-primary);
|
||||
}
|
||||
|
||||
align-items: center;
|
||||
background: var(--background-color);
|
||||
|
|
@ -15,18 +28,6 @@ to match Terraform Registry tier labels.
|
|||
position: relative;
|
||||
top: -1px;
|
||||
vertical-align: bottom;
|
||||
|
||||
/* variations */
|
||||
&[data-tier='official'] {
|
||||
--background-color: #f8e397;
|
||||
--text-color: #975b06;
|
||||
}
|
||||
|
||||
/* subsequent page titles should get cozy,
|
||||
otherwise the label doesn't look associated */
|
||||
& + h1 {
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
|
|
@ -40,11 +41,5 @@ to match Terraform Registry tier labels.
|
|||
|
||||
.icon {
|
||||
margin-right: 4px;
|
||||
|
||||
& svg {
|
||||
display: block;
|
||||
& [fill] {
|
||||
fill: var(--text-color);
|
||||
}
|
||||
}
|
||||
color: var(--text-color);
|
||||
}
|
||||
25
website/components/badges-header/index.tsx
Normal file
25
website/components/badges-header/index.tsx
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import React from 'react'
|
||||
import s from './style.module.css'
|
||||
|
||||
function BadgesHeader({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactChild[]
|
||||
}): React.ReactElement {
|
||||
const childrenArray = React.Children.toArray(children)
|
||||
return (
|
||||
<div className={s.root}>
|
||||
<div className={s.surroundSpaceCompensator}>
|
||||
{childrenArray.map((badge, idx) => {
|
||||
return (
|
||||
<div className={s.badgeSpacer} key={idx}>
|
||||
{badge}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default BadgesHeader
|
||||
21
website/components/badges-header/style.module.css
Normal file
21
website/components/badges-header/style.module.css
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
.root {
|
||||
position: relative;
|
||||
margin: 32px 0 0 0;
|
||||
|
||||
/* subsequent page titles should get cozy,
|
||||
otherwise the label doesn't look associated */
|
||||
& + h1 {
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.surroundSpaceCompensator {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: -4px;
|
||||
}
|
||||
|
||||
.badgeSpacer {
|
||||
line-height: 0;
|
||||
padding: 4px;
|
||||
}
|
||||
4
website/components/plugin-badge/check-icon.svg
Normal file
4
website/components/plugin-badge/check-icon.svg
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.28 5.72002C11.4205 5.86064 11.4994 6.05126 11.4994 6.25002C11.4994 6.44877 11.4205 6.63939 11.28 6.78002L7.28003 10.78C7.1394 10.9205 6.94878 10.9994 6.75003 10.9994C6.55128 10.9994 6.36065 10.9205 6.22003 10.78L4.22003 8.78002C4.08755 8.63784 4.01543 8.44979 4.01885 8.25549C4.02228 8.06119 4.10099 7.87581 4.23841 7.73839C4.37582 7.60098 4.56121 7.52227 4.75551 7.51884C4.94981 7.51541 5.13785 7.58754 5.28003 7.72002L6.75003 9.19002L10.22 5.72002C10.3607 5.57956 10.5513 5.50068 10.75 5.50068C10.9488 5.50068 11.1394 5.57956 11.28 5.72002V5.72002Z" fill="currentColor"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.834 0.33003C7.18561 0.116977 7.58887 0.0043335 8 0.0043335C8.41112 0.0043335 8.81439 0.116977 9.166 0.33003L14.416 3.51203C14.7468 3.71249 15.0204 3.99487 15.2103 4.33189C15.4002 4.66891 15.4999 5.0492 15.5 5.43603V10.564C15.4999 10.9509 15.4002 11.3311 15.2103 11.6682C15.0204 12.0052 14.7468 12.2876 14.416 12.488L9.166 15.67C8.81439 15.8831 8.41112 15.9957 8 15.9957C7.58887 15.9957 7.18561 15.8831 6.834 15.67L1.584 12.488C1.25316 12.2876 0.979595 12.0052 0.789714 11.6682C0.599832 11.3311 0.500048 10.9509 0.499996 10.564V5.43603C0.500048 5.0492 0.599832 4.66891 0.789714 4.33189C0.979595 3.99487 1.25316 3.71249 1.584 3.51203L6.834 0.33003ZM8.389 1.61303C8.27172 1.54188 8.13717 1.50426 8 1.50426C7.86282 1.50426 7.72828 1.54188 7.611 1.61303L2.361 4.79403C2.25068 4.86095 2.1595 4.9552 2.09626 5.06766C2.03302 5.18013 1.99986 5.307 2 5.43603V10.564C1.99986 10.6931 2.03302 10.8199 2.09626 10.9324C2.1595 11.0449 2.25068 11.1391 2.361 11.206L7.611 14.387C7.72828 14.4582 7.86282 14.4958 8 14.4958C8.13717 14.4958 8.27172 14.4582 8.389 14.387L13.639 11.206C13.7493 11.1391 13.8405 11.0449 13.9037 10.9324C13.967 10.8199 14.0001 10.6931 14 10.564V5.43603C14.0001 5.307 13.967 5.18013 13.9037 5.06766C13.8405 4.9552 13.7493 4.86095 13.639 4.79403L8.389 1.61303V1.61303Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2 KiB |
31
website/components/plugin-badge/index.tsx
Normal file
31
website/components/plugin-badge/index.tsx
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import React from 'react'
|
||||
import Badge, { BadgeTheme } from '../badge'
|
||||
import svgRibbonIcon from './ribbon-icon.svg?include'
|
||||
import svgCheckIcon from './check-icon.svg?include'
|
||||
|
||||
type PluginLabelType = 'official' | 'community' | 'hcp_packer_ready'
|
||||
|
||||
const badgeTypes = {
|
||||
official: {
|
||||
label: 'Official',
|
||||
theme: 'gold',
|
||||
iconSvg: svgRibbonIcon,
|
||||
},
|
||||
community: {
|
||||
label: 'Community',
|
||||
theme: 'gray',
|
||||
iconSvg: false,
|
||||
},
|
||||
hcp_packer_ready: {
|
||||
label: 'HCP Packer Ready',
|
||||
theme: 'blue',
|
||||
iconSvg: svgCheckIcon,
|
||||
},
|
||||
}
|
||||
|
||||
function PluginBadge({ type }: { type: PluginLabelType }): React.ReactElement {
|
||||
const { label, theme, iconSvg } = badgeTypes[type]
|
||||
return <Badge label={label} theme={theme as BadgeTheme} iconSvg={iconSvg} />
|
||||
}
|
||||
|
||||
export default PluginBadge
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.4347 9.00402C12.5253 8.85068 12.6647 8.72602 12.976 8.42402C13.284 8.12402 13.4047 7.68802 13.292 7.27868C13.1787 6.86868 13.122 6.69202 13.122 6.51535C13.122 6.33868 13.178 6.16202 13.292 5.75068C13.3471 5.5491 13.3469 5.33638 13.2913 5.13493C13.2357 4.93349 13.1267 4.75076 12.976 4.60602C12.6647 4.30335 12.5253 4.17868 12.434 4.02468C12.3447 3.87202 12.3027 3.69135 12.1893 3.28268C12.1318 3.07957 12.0217 2.8952 11.8703 2.7481C11.7189 2.60101 11.5314 2.49636 11.3267 2.44468C10.902 2.33402 10.7167 2.29335 10.5587 2.20468C10.402 2.11535 10.272 1.97935 9.96534 1.68068C9.81164 1.53281 9.62251 1.42695 9.4161 1.37324C9.2097 1.31954 8.99295 1.31981 8.78667 1.37402C8.36267 1.48402 8.18134 1.53935 7.99934 1.53868C7.81734 1.53868 7.63601 1.48402 7.21334 1.37402C7.00716 1.31999 6.79056 1.31982 6.58429 1.37352C6.37803 1.42721 6.18901 1.53298 6.03534 1.68068C5.72534 1.98202 5.59534 2.11802 5.43801 2.20602C5.28001 2.29468 5.09467 2.33468 4.67334 2.44468C4.46871 2.49648 4.28129 2.60117 4.12988 2.74825C3.97847 2.89533 3.86839 3.07964 3.81067 3.28268C3.69734 3.69335 3.65534 3.87402 3.56534 4.02602C3.47467 4.17935 3.33534 4.30335 3.02401 4.60602C2.87327 4.75076 2.76436 4.93349 2.70875 5.13493C2.65313 5.33638 2.65288 5.5491 2.70801 5.75068C2.82201 6.16335 2.87867 6.34002 2.87801 6.51735C2.87801 6.69335 2.82134 6.86935 2.70801 7.27868C2.59534 7.68735 2.71601 8.12402 3.02401 8.42335C3.33467 8.72535 3.47467 8.85068 3.56534 9.00468C3.65534 9.15735 3.69734 9.33802 3.81067 9.74668C3.92334 10.156 4.25201 10.4753 4.67334 10.5847C5.26934 10.74 5.33334 11 5.33334 11.3333V14.6667L8.00001 13.192L10.6667 14.6667V11.3333C10.6667 11.002 10.73 10.74 11.3267 10.5853C11.5313 10.5336 11.7188 10.4289 11.8702 10.2819C12.0216 10.1348 12.1317 9.95043 12.1893 9.74735C12.3027 9.33668 12.3447 9.15602 12.4347 9.00402V9.00402ZM6.00001 6.66668C6.00001 6.13625 6.21072 5.62754 6.58579 5.25247C6.96087 4.8774 7.46957 4.66668 8.00001 4.66668C8.53044 4.66668 9.03915 4.8774 9.41422 5.25247C9.78929 5.62754 10 6.13625 10 6.66668C10 7.19712 9.78929 7.70582 9.41422 8.0809C9.03915 8.45597 8.53044 8.66668 8.00001 8.66668C7.46957 8.66668 6.96087 8.45597 6.58579 8.0809C6.21072 7.70582 6.00001 7.19712 6.00001 6.66668Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.4347 9.00402C12.5253 8.85068 12.6647 8.72602 12.976 8.42402C13.284 8.12402 13.4047 7.68802 13.292 7.27868C13.1787 6.86868 13.122 6.69202 13.122 6.51535C13.122 6.33868 13.178 6.16202 13.292 5.75068C13.3471 5.5491 13.3469 5.33638 13.2913 5.13493C13.2357 4.93349 13.1267 4.75076 12.976 4.60602C12.6647 4.30335 12.5253 4.17868 12.434 4.02468C12.3447 3.87202 12.3027 3.69135 12.1893 3.28268C12.1318 3.07957 12.0217 2.8952 11.8703 2.7481C11.7189 2.60101 11.5314 2.49636 11.3267 2.44468C10.902 2.33402 10.7167 2.29335 10.5587 2.20468C10.402 2.11535 10.272 1.97935 9.96534 1.68068C9.81164 1.53281 9.62251 1.42695 9.4161 1.37324C9.2097 1.31954 8.99295 1.31981 8.78667 1.37402C8.36267 1.48402 8.18134 1.53935 7.99934 1.53868C7.81734 1.53868 7.63601 1.48402 7.21334 1.37402C7.00716 1.31999 6.79056 1.31982 6.58429 1.37352C6.37803 1.42721 6.18901 1.53298 6.03534 1.68068C5.72534 1.98202 5.59534 2.11802 5.43801 2.20602C5.28001 2.29468 5.09467 2.33468 4.67334 2.44468C4.46871 2.49648 4.28129 2.60117 4.12988 2.74825C3.97847 2.89533 3.86839 3.07964 3.81067 3.28268C3.69734 3.69335 3.65534 3.87402 3.56534 4.02602C3.47467 4.17935 3.33534 4.30335 3.02401 4.60602C2.87327 4.75076 2.76436 4.93349 2.70875 5.13493C2.65313 5.33638 2.65288 5.5491 2.70801 5.75068C2.82201 6.16335 2.87867 6.34002 2.87801 6.51735C2.87801 6.69335 2.82134 6.86935 2.70801 7.27868C2.59534 7.68735 2.71601 8.12402 3.02401 8.42335C3.33467 8.72535 3.47467 8.85068 3.56534 9.00468C3.65534 9.15735 3.69734 9.33802 3.81067 9.74668C3.92334 10.156 4.25201 10.4753 4.67334 10.5847C5.26934 10.74 5.33334 11 5.33334 11.3333V14.6667L8.00001 13.192L10.6667 14.6667V11.3333C10.6667 11.002 10.73 10.74 11.3267 10.5853C11.5313 10.5336 11.7188 10.4289 11.8702 10.2819C12.0216 10.1348 12.1317 9.95043 12.1893 9.74735C12.3027 9.33668 12.3447 9.15602 12.4347 9.00402V9.00402ZM6.00001 6.66668C6.00001 6.13625 6.21072 5.62754 6.58579 5.25247C6.96087 4.8774 7.46957 4.66668 8.00001 4.66668C8.53044 4.66668 9.03915 4.8774 9.41422 5.25247C9.78929 5.62754 10 6.13625 10 6.66668C10 7.19712 9.78929 7.70582 9.41422 8.0809C9.03915 8.45597 8.53044 8.66668 8.00001 8.66668C7.46957 8.66668 6.96087 8.45597 6.58579 8.0809C6.21072 7.70582 6.00001 7.19712 6.00001 6.66668Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
|
@ -1,22 +0,0 @@
|
|||
import React from 'react'
|
||||
import InlineSvg from '@hashicorp/react-inline-svg'
|
||||
import svgRibbonIcon from './ribbon-icon.svg?include'
|
||||
import s from './style.module.css'
|
||||
|
||||
const tierNames = {
|
||||
official: 'Official',
|
||||
community: 'Community',
|
||||
}
|
||||
|
||||
function PluginTierLabel({ tier }) {
|
||||
return (
|
||||
<div className={s.root} data-tier={tier}>
|
||||
{tier === 'official' ? (
|
||||
<InlineSvg className={s.icon} src={svgRibbonIcon} />
|
||||
) : null}
|
||||
<span className={s.text}>{tierNames[tier]}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default PluginTierLabel
|
||||
|
|
@ -38,7 +38,7 @@ async function generateStaticProps({
|
|||
currentPath,
|
||||
})
|
||||
const navNode = getNodeFromPath(currentPath, navData, localContentDir)
|
||||
const { filePath, remoteFile, pluginTier } = navNode
|
||||
const { filePath, remoteFile, pluginData } = navNode
|
||||
// Fetch the MDX file content
|
||||
const mdxString = remoteFile
|
||||
? remoteFile.fileString
|
||||
|
|
@ -52,10 +52,23 @@ async function generateStaticProps({
|
|||
// For plugin pages, prefix the MDX content with a
|
||||
// label that reflects the plugin tier
|
||||
// (current options are "Official" or "Community")
|
||||
// and display whether the plugin is "HCP Packer Ready".
|
||||
// Also add a badge to show the latest version
|
||||
function mdxContentHook(mdxContent) {
|
||||
if (pluginTier) {
|
||||
const tierMdx = `<br/><PluginTierLabel tier="${pluginTier}" />\n\n`
|
||||
mdxContent = tierMdx + mdxContent
|
||||
const badgesMdx = []
|
||||
// Add a badge for the plugin tier
|
||||
if (pluginData?.tier) {
|
||||
badgesMdx.push(`<PluginBadge type="${pluginData.tier}" />`)
|
||||
}
|
||||
// Add a badge if the plugin is "HCP Packer Ready"
|
||||
if (pluginData?.isHcpPackerReady) {
|
||||
badgesMdx.push(`<PluginBadge type="hcp_packer_ready" />`)
|
||||
}
|
||||
// If we have badges to add, inject them into the MDX
|
||||
if (badgesMdx.length > 0) {
|
||||
const badgeChildrenMdx = badgesMdx.join('')
|
||||
const badgesHeaderMdx = `<BadgesHeader>${badgeChildrenMdx}</BadgesHeader>`
|
||||
mdxContent = badgesHeaderMdx + '\n\n' + mdxContent
|
||||
}
|
||||
return mdxContent
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,9 +139,16 @@ async function resolvePluginEntryDocs(pluginConfigEntry, currentPath) {
|
|||
repo,
|
||||
version,
|
||||
pluginTier,
|
||||
isHcpPackerReady = false,
|
||||
sourceBranch = 'main',
|
||||
zipFile = '',
|
||||
} = pluginConfigEntry
|
||||
// Determine the pluginTier, which can be set manually,
|
||||
// or will be automatically set based on repo ownership
|
||||
const pluginOwner = repo.split('/')[0]
|
||||
const parsedPluginTier =
|
||||
pluginTier || (pluginOwner === 'hashicorp' ? 'official' : 'community')
|
||||
// Fetch the MDX files for the plugin entry
|
||||
var docsMdxFiles
|
||||
if (zipFile !== '') {
|
||||
docsMdxFiles = await fetchDevPluginDocs(zipFile)
|
||||
|
|
@ -153,7 +160,8 @@ async function resolvePluginEntryDocs(pluginConfigEntry, currentPath) {
|
|||
// - filePath is the path to the source file in the source repo
|
||||
// - fileString is a string representing the file source
|
||||
// - sourceUrl is a link to the original file in the source repo
|
||||
// We also add a pluginTier attribute
|
||||
// We also add pluginData, which is used to add badges
|
||||
// such as the plugin's tier when rendering the page.
|
||||
const navNodes = docsMdxFiles.map((mdxFile) => {
|
||||
const { filePath, fileString } = mdxFile
|
||||
// Process into a NavLeaf, with a remoteFile attribute
|
||||
|
|
@ -170,16 +178,15 @@ async function resolvePluginEntryDocs(pluginConfigEntry, currentPath) {
|
|||
const title = nav_title || sidebar_title || basename
|
||||
// construct sourceUrl (used for "Edit this page" link)
|
||||
const sourceUrl = `https://github.com/${repo}/blob/${sourceBranch}/${filePath}`
|
||||
// determine pluginTier
|
||||
const pluginOwner = repo.split('/')[0]
|
||||
const parsedPluginTier =
|
||||
pluginTier || (pluginOwner === 'hashicorp' ? 'official' : 'community')
|
||||
// Construct and return a NavLeafRemote node
|
||||
return {
|
||||
title,
|
||||
path: urlPath,
|
||||
remoteFile: { filePath, fileString, sourceUrl },
|
||||
pluginTier: parsedPluginTier,
|
||||
pluginData: {
|
||||
tier: parsedPluginTier,
|
||||
isHcpPackerReady,
|
||||
},
|
||||
}
|
||||
})
|
||||
//
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ description: |
|
|||
page_title: File - Builders
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# File Builder
|
||||
|
||||
Type: `file`
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ description: |
|
|||
page_title: Null - Builders
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Null Builder
|
||||
|
||||
Type: `null`
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ description: |
|
|||
page_title: HCP Packer Image - Data Sources
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
<PluginBadge type="hcp_packer_ready" />
|
||||
</BadgesHeader>
|
||||
|
||||
# HCP Packer Image Data Source
|
||||
|
||||
Type: `hcp-packer-image`
|
||||
|
|
@ -38,7 +43,6 @@ data source to retrieve an image ID using a channel. You provide the channel
|
|||
name to the iteration data source, then use the iteration source in the image
|
||||
data source, then use the image data source inside your source block.
|
||||
|
||||
|
||||
```hcl
|
||||
# Retrieves information about the HCP Packer "iteration"; an "iteration" can be
|
||||
# thought of as all the metadata created by a single call of `packer build`.
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ description: |
|
|||
page_title: HCP Packer Iteration - Data Sources
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
<PluginBadge type="hcp_packer_ready" />
|
||||
</BadgesHeader>
|
||||
|
||||
# HCP Packer Iteration Data Source
|
||||
|
||||
Type: `hcp-packer-iteration`
|
||||
|
|
@ -36,7 +41,6 @@ data source to retrieve an image ID using a channel. You provide the channel
|
|||
name to the iteration data source, then use the iteration source inside the
|
||||
image data source, then use the image data source inside your source block.
|
||||
|
||||
|
||||
```hcl
|
||||
# Retrieves information about the HCP Packer "iteration"; an "iteration" can be
|
||||
# thought of as all the metadata created by a single call of `packer build`.
|
||||
|
|
|
|||
|
|
@ -1,42 +1,45 @@
|
|||
---
|
||||
description: |
|
||||
Data sources used to data from the HCP Packer registry.
|
||||
Data sources used to data from the HCP Packer registry.
|
||||
page_title: HCP - Data sources
|
||||
sidebar_title: Overview
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# HCP Packer Registry Data sources
|
||||
|
||||
The HCP Packer registry bridges the gap between image factories and image
|
||||
deployments, allowing development and security teams to work together to create,
|
||||
The HCP Packer registry bridges the gap between image factories and image
|
||||
deployments, allowing development and security teams to work together to create,
|
||||
manage, and consume golden images in a centralized way.
|
||||
|
||||
The HCP Packer registry stores metadata about your images, including when they
|
||||
were created, where the image exists in the cloud, and what (if any) git commit
|
||||
is associated with your image build. You can use the registry to track
|
||||
information about the golden images your Packer builds produce, clearly
|
||||
designate which images are appropriate for test and production environments,
|
||||
and query for the right golden images to use in both Packer and Terraform
|
||||
The HCP Packer registry stores metadata about your images, including when they
|
||||
were created, where the image exists in the cloud, and what (if any) git commit
|
||||
is associated with your image build. You can use the registry to track
|
||||
information about the golden images your Packer builds produce, clearly
|
||||
designate which images are appropriate for test and production environments,
|
||||
and query for the right golden images to use in both Packer and Terraform
|
||||
configurations.
|
||||
|
||||
HCP Packer is under active development, and we are currently offering a public
|
||||
beta version to collect feedback and continue improving the product. We
|
||||
HCP Packer is under active development, and we are currently offering a public
|
||||
beta version to collect feedback and continue improving the product. We
|
||||
encourage you to try HCP Packer and submit your feedback.
|
||||
|
||||
Packer has two data sources that work together to retrieve information from the
|
||||
HCP Packer registry:
|
||||
|
||||
* [hcp-packer-iteration](/docs/datasources/hcp/hcp-packer-iteration) -
|
||||
retrieves information about an iteration in HCP Packer registry
|
||||
* [hcp-packer-image](/docs/datasources/hcp/hcp-packer-image) - retrieves
|
||||
information about a specific image created in the HCP Packer registry
|
||||
- [hcp-packer-iteration](/docs/datasources/hcp/hcp-packer-iteration) -
|
||||
retrieves information about an iteration in HCP Packer registry
|
||||
- [hcp-packer-image](/docs/datasources/hcp/hcp-packer-image) - retrieves
|
||||
information about a specific image created in the HCP Packer registry
|
||||
|
||||
These data sources are intended to be used together to determine source images
|
||||
for pipelined Packer builds.
|
||||
for pipelined Packer builds.
|
||||
|
||||
## How to use this plugin
|
||||
|
||||
This plugin comes bundled with the Packer core, so you do not need to install
|
||||
This plugin comes bundled with the Packer core, so you do not need to install
|
||||
it separately. Please install Packer v1.7.7 or above to use the latest version
|
||||
of the HCP Packer registry datasources.
|
||||
of the HCP Packer registry datasources.
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ description: |
|
|||
page_title: Packer Image Iteration - Data Sources
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
<PluginBadge type="hcp_packer_ready" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Packer Image Iteration Data Source
|
||||
|
||||
Type: `packer-image-iteration`
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@ build.
|
|||
|
||||
Packer plugins are published and maintained by a variety of sources, including HashiCorp, and the Packer community. The Packer website uses tiers and badges to denote the source of a provider. Additionally, namespaces are used to help users identify the organization or publisher responsible for the integration, as shown in the table below.
|
||||
|
||||
| Tier | Description | Namespace |
|
||||
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
|
||||
| <PluginTierLabel tier="official" /> | Official plugins are owned and maintained by HashiCorp. | hashicorp |
|
||||
| <PluginTierLabel tier="community" /> | Community providers are published by individual maintainers, groups of maintainers, or other members of the Packer community. | Third-party organization or maintainer's individual account |
|
||||
| Tier | Description | Namespace |
|
||||
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
|
||||
| <PluginBadge type="official" /> | Official plugins are owned and maintained by HashiCorp. | hashicorp |
|
||||
| <PluginBadge type="community" /> | Community providers are published by individual maintainers, groups of maintainers, or other members of the Packer community. | Third-party organization or maintainer's individual account |
|
||||
|
||||
## Installing Plugins
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ description: >
|
|||
page_title: Artifice - Post-Processors
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Artifice Post-Processor
|
||||
|
||||
Type: `artifice`
|
||||
|
|
|
|||
|
|
@ -9,6 +9,10 @@ description: >
|
|||
page_title: Checksum - Post-Processors
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Checksum Post-Processor
|
||||
|
||||
Type: `checksum`
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ description: |
|
|||
page_title: Compress - Post-Processors
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Compress Post-Processor
|
||||
|
||||
Type: `compress`
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ description: >
|
|||
page_title: Manifest - Post-Processors
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Manifest Post-Processor
|
||||
|
||||
Type: `manifest`
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ description: |
|
|||
page_title: Local Shell - Post-Processors
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Local Shell Post Processor
|
||||
|
||||
Type: `shell-local`
|
||||
|
|
|
|||
|
|
@ -9,6 +9,10 @@ description: >
|
|||
page_title: breakpoint - Provisioners
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Breakpoint Provisioner
|
||||
|
||||
Type: `breakpoint`
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ description: |
|
|||
page_title: File - Provisioners
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# File Provisioner
|
||||
|
||||
Type: `file`
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ description: |
|
|||
page_title: PowerShell - Provisioners
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# PowerShell Provisioner
|
||||
|
||||
Type: `powershell`
|
||||
|
|
@ -81,7 +85,7 @@ provisioner "powershell" {
|
|||
running on AWS, Azure, Google Compute, or OpenStack and would like to access
|
||||
the autogenerated password that Packer uses to connect to the instance via
|
||||
WinRM, you can use the `build` template engine to inject it using
|
||||
```{{ build `Password` }}```. In HCL templates, you can do the same thing by
|
||||
`` {{ build `Password` }} ``. In HCL templates, you can do the same thing by
|
||||
accessing the `build` variables For example:
|
||||
|
||||
<Tabs>
|
||||
|
|
@ -139,7 +143,7 @@ provisioner "powershell" {
|
|||
running on AWS, Azure, Google Compute, or OpenStack and would like to access
|
||||
the autogenerated password that Packer uses to connect to the instance via
|
||||
WinRM, you can use the `build` template engine to inject it using
|
||||
```{{ build `Password` }}```. In HCL templates, you can do the same thing by
|
||||
`` {{ build `Password` }} ``. In HCL templates, you can do the same thing by
|
||||
accessing the `build` variables For example:
|
||||
|
||||
<Tabs>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ description: |
|
|||
page_title: Shell (Local) - Provisioners
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Local Shell Provisioner
|
||||
|
||||
Type: `shell-local`
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ description: |
|
|||
page_title: Shell - Provisioners
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Shell Provisioner
|
||||
|
||||
Type: `shell`
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ description: |
|
|||
page_title: Windows Restart - Provisioners
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Windows Restart Provisioner
|
||||
|
||||
Type: `windows-restart`
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ description: |
|
|||
page_title: Windows Shell - Provisioners
|
||||
---
|
||||
|
||||
<BadgesHeader>
|
||||
<PluginBadge type="official" />
|
||||
</BadgesHeader>
|
||||
|
||||
# Windows Shell Provisioner
|
||||
|
||||
Type: `windows-shell`
|
||||
|
|
|
|||
|
|
@ -89,7 +89,8 @@
|
|||
"title": "HashiCups",
|
||||
"path": "hashicups",
|
||||
"repo": "hashicorp/packer-plugin-hashicups",
|
||||
"version": "latest"
|
||||
"version": "latest",
|
||||
"isHcpPackerReady": false
|
||||
},
|
||||
{
|
||||
"title": "hcloud",
|
||||
|
|
|
|||
37
website/package-lock.json
generated
37
website/package-lock.json
generated
|
|
@ -32,6 +32,7 @@
|
|||
"@hashicorp/react-text-split-with-image": "^4.2.5",
|
||||
"@hashicorp/react-vertical-text-block-list": "^7.0.0",
|
||||
"adm-zip": "^0.5.5",
|
||||
"classnames": "^2.3.1",
|
||||
"gray-matter": "^4.0.2",
|
||||
"next": "^11.1.3",
|
||||
"next-mdx-remote": "3.0.1",
|
||||
|
|
@ -2865,13 +2866,9 @@
|
|||
"version": "11.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-11.1.3.tgz",
|
||||
"integrity": "sha512-TwP4krjhs+uU9pesDYCShEXZrLSbJr78p12e7XnLBBaNf20SgWLlVmQUT9gX9KbWan5V0sUbJfmcS8MRNHgYuA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"cpu": ["arm64"],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"os": ["darwin"],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
|
|
@ -2880,13 +2877,9 @@
|
|||
"version": "11.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-11.1.3.tgz",
|
||||
"integrity": "sha512-ZSWmkg/PxccHFNUSeBdrfaH8KwSkoeUtewXKvuYYt7Ph0yRsbqSyNIvhUezDua96lApiXXq6EL2d1THfeWomvw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"cpu": ["x64"],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"os": ["darwin"],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
|
|
@ -2895,13 +2888,9 @@
|
|||
"version": "11.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-11.1.3.tgz",
|
||||
"integrity": "sha512-PrTBN0iZudAuj4jSbtXcdBdmfpaDCPIneG4Oms4zcs93KwMgLhivYW082Mvlgx9QVEiRm7+RkFpIVtG/i7JitA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"cpu": ["x64"],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"os": ["linux"],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
|
|
@ -2910,13 +2899,9 @@
|
|||
"version": "11.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-11.1.3.tgz",
|
||||
"integrity": "sha512-mRwbscVjRoHk+tDY7XbkT5d9FCwujFIQJpGp0XNb1i5OHCSDO8WW/C9cLEWS4LxKRbIZlTLYg1MTXqLQkvva8w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"cpu": ["x64"],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"os": ["win32"],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
|
|
@ -8395,9 +8380,7 @@
|
|||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"os": ["darwin"],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
"@hashicorp/react-text-split-with-image": "^4.2.5",
|
||||
"@hashicorp/react-vertical-text-block-list": "^7.0.0",
|
||||
"adm-zip": "^0.5.5",
|
||||
"classnames": "^2.3.1",
|
||||
"gray-matter": "^4.0.2",
|
||||
"next": "^11.1.3",
|
||||
"next-mdx-remote": "3.0.1",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { productName, productSlug } from 'data/metadata'
|
||||
import DocsPage from '@hashicorp/react-docs-page'
|
||||
import PluginTierLabel from 'components/plugin-tier-label'
|
||||
import Badge from 'components/badge'
|
||||
import BadgesHeader from 'components/badges-header'
|
||||
import PluginBadge from 'components/plugin-badge'
|
||||
import DevAlert from 'components/dev-alert'
|
||||
import Checklist from 'components/checklist'
|
||||
// Imports below are only used server-side
|
||||
|
|
@ -10,7 +12,7 @@ import {
|
|||
} from 'components/remote-plugin-docs/server'
|
||||
|
||||
// Configure the docs path and remote plugin docs loading
|
||||
const additionalComponents = { PluginTierLabel, Checklist }
|
||||
const additionalComponents = { Badge, BadgesHeader, PluginBadge, Checklist }
|
||||
const baseRoute = 'docs'
|
||||
const localContentDir = 'content/docs'
|
||||
const mainBranch = 'master'
|
||||
|
|
|
|||
Loading…
Reference in a new issue