Merge remote-tracking branch 'origin/master' into azr_implicit_requried_plugin

azr_implicit_requried_plugin_2
Adrien Delorme 5 years ago
commit 3629aeaa01

@ -64,6 +64,7 @@ require (
github.com/mitchellh/cli v1.1.0
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed
github.com/mitchellh/gox v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.4.0
github.com/mitchellh/panicwrap v1.0.0
github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784

@ -529,6 +529,7 @@ github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZX
github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4=
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI=
github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4=
github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=

@ -40,7 +40,7 @@ func TestLegacyIsotime_inputs(t *testing.T) {
},
{
cty.StringVal("Mon Jan 02, 2006"),
`^(Mon|Tues|Wed|Thu|Fri|Sat|Sun){1} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec){1} \d{2}, \d{4}$`,
`^(Mon|Tue|Wed|Thu|Fri|Sat|Sun){1} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec){1} \d{2}, \d{4}$`,
},
}

@ -126,7 +126,7 @@ if [ -n "${PACKER_DEV+x}" ]; then
fi
export CGO_ENABLED=0
set +e
${GOX:?command not found} \
-os="${XC_OS:-$ALL_XC_OS}" \
-arch="${XC_ARCH:-$ALL_XC_ARCH}" \
@ -134,7 +134,6 @@ ${GOX:?command not found} \
-ldflags "${GOLDFLAGS}" \
-output "pkg/{{.OS}}_{{.Arch}}/packer" \
.
set -e
# trim GOPATH to first element
IFS="${PATHSEP}"

@ -571,6 +571,8 @@ github.com/mitchellh/go-testing-interface
github.com/mitchellh/go-vnc
# github.com/mitchellh/go-wordwrap v1.0.0
github.com/mitchellh/go-wordwrap
# github.com/mitchellh/gox v1.0.1
## explicit
# github.com/mitchellh/iochan v1.0.0
github.com/mitchellh/iochan
# github.com/mitchellh/mapstructure v1.4.0

@ -13,7 +13,10 @@ const parseDocsZip = require('./parse-docs-zip')
// docs files were missing or invalid, with a path to resolution
async function fetchDocsFiles({ repo, tag }) {
// If there's a docs.zip asset, we'll prefer that
const docsZipUrl = `https://github.com/${repo}/releases/download/${tag}/docs.zip`
const docsZipUrl =
tag === 'latest'
? `https://github.com/${repo}/releases/latest/download/docs.zip`
: `https://github.com/${repo}/releases/download/${tag}/docs.zip`
const docsZipResponse = await fetch(docsZipUrl, { method: 'GET' })
const hasDocsZip = docsZipResponse.status === 200
// Note: early return!

@ -95,16 +95,19 @@ async function mergeRemotePlugins(remotePluginsFile, navData) {
// console.log(JSON.stringify(routesWithPlugins, null, 2))
// Also, sort the child routes so the order is alphabetical
routesWithPlugins.sort((a, b) => {
// ensure casing does not affect ordering
const aTitle = a.title.toLowerCase()
const bTitle = b.title.toLowerCase()
// (exception: "Overview" comes first)
if (a.title == 'Overview') return -1
if (b.title === 'Overview') return 1
if (aTitle === 'overview') return -1
if (bTitle === 'overview') return 1
// (exception: "Community-Supported" comes last)
if (a.title == 'Community-Supported') return 1
if (b.title === 'Community-Supported') return -1
if (aTitle === 'community-supported') return 1
if (bTitle === 'community-supported') return -1
// (exception: "Custom" comes second-last)
if (a.title == 'Custom') return 1
if (b.title === 'Custom') return -1
return a.title < b.title ? -1 : a.title > b.title ? 1 : 0
if (aTitle === 'custom') return 1
if (bTitle === 'custom') return -1
return aTitle < bTitle ? -1 : aTitle > bTitle ? 1 : 0
})
// return n
return { ...n, routes: routesWithPlugins }
@ -159,6 +162,16 @@ async function resolvePluginEntryDocs(pluginConfigEntry) {
}
})
//
navNodes.sort((a, b) => {
// ensure casing does not affect ordering
const aTitle = a.title.toLowerCase()
const bTitle = b.title.toLowerCase()
// (exception: "Overview" comes first)
if (aTitle === 'overview') return -1
if (bTitle === 'overview') return 1
return aTitle < bTitle ? -1 : aTitle > bTitle ? 1 : 0
})
//
const navNodesByComponent = navNodes.reduce((acc, navLeaf) => {
const componentType = navLeaf.remoteFile.filePath.split('/')[1]
if (!acc[componentType]) acc[componentType] = []

@ -13,15 +13,22 @@ const COMPONENT_TYPES = [
// with at least one .mdx file within it.
function validatePluginDocsFiles(filePaths) {
function isValidPath(filePath) {
// Allow the docs root folder
const isDocsRoot = filePath === 'docs/'
// Allow component folders
const isComponentRoot = COMPONENT_TYPES.reduce((acc, type) => {
return acc || filePath === `docs/${type}/`
}, false)
// Allow .mdx files in component folders
const isComponentMdx = COMPONENT_TYPES.reduce((acc, type) => {
const mdxPathRegex = new RegExp(`^docs/${type}/(.*).mdx$`)
return acc || mdxPathRegex.test(filePath)
}, false)
const isValidPath = isDocsRoot || isComponentRoot || isComponentMdx
// Allow docs/README.md files
const isDocsReadme = filePath == 'docs/README.md'
// Combine all allowed types
const isValidPath =
isDocsRoot || isComponentRoot || isComponentMdx || isDocsReadme
return isValidPath
}
const invalidPaths = filePaths.filter((f) => !isValidPath(f))

@ -42,7 +42,7 @@
probably don't need it. This will also be read from the AWS_SESSION_TOKEN
environmental variable.
- `vault_aws_engine` (VaultAWSEngineOptions) - Get credentials from Hashicorp Vault's aws secrets engine. You must
- `vault_aws_engine` (VaultAWSEngineOptions) - Get credentials from HashiCorp Vault's aws secrets engine. You must
already have created a role to use. For more information about
generating credentials via the Vault engine, see the [Vault
docs.](https://www.vaultproject.io/api/secret/aws#generate-credentials)

@ -3,6 +3,6 @@
"title": "Docker",
"path": "docker",
"repo": "hashicorp/packer-plugin-docker",
"version": "v0.0.4"
"version": "latest"
}
]

Loading…
Cancel
Save