Skip to content

Commit dca1f71

Browse files
authored
Merge branch 'main' into lane-wetmore/single-item-recovery
2 parents 3db6479 + caf1f65 commit dca1f71

File tree

9 files changed

+29
-13
lines changed

9 files changed

+29
-13
lines changed

content/terraform/v1.13.x/docs/language/stacks/deploy/conditions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ deployment_auto_approve "no_changes" {
5252

5353
</CodeBlockConfig>
5454

55-
The `condition` argument in the `deployment_auto_approve` block has access to the `context` of the current deployment run. To learn more about `context`, refer to the [`deployment_auto_approve` reference](/terraform/language/block/stack/deploy/deployment_auto_approve#deployment-plan-context).
55+
The `condition` argument in the `deployment_auto_approve` block has access to the `context` of the current deployment run. To learn more about `context`, refer to the [`deployment_auto_approve` reference](/terraform/language/block/stack/tfdeploy/deployment_auto_approve#deployment-plan-context).
5656

5757
After defining your auto-approval rule, add that rule to your deployment group using the `auto_approve_checks` argument. In the following example, the `staging_group` deployment group enforces the `no_changes` rule:
5858

content/terraform/v1.13.x/docs/language/stacks/deploy/config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ deployment "web" {
216216

217217
Now, whenever the `web` deployment generates a deployment run that does not destroy resources, HCP Terraform automatically approves that run.
218218

219-
If you don't assign a deployment to a group, Terraform automatically creates a default deployment group for that deployment. To learn more about defining deployment groups, refer to the [`deployment_group` reference](/terraform/language/block/stack/deploy/deployment_group). To learn more about setting up deployment group orchestration rules, refer to [Set conditions for deployment runs](/terraform/language/stacks/deploy/conditions).
219+
If you don't assign a deployment to a group, Terraform automatically creates a default deployment group for that deployment. To learn more about defining deployment groups, refer to the [`deployment_group` reference](/terraform/language/block/stack/tfdeploy/deployment_group). To learn more about setting up deployment group orchestration rules, refer to [Set conditions for deployment runs](/terraform/language/stacks/deploy/conditions).
220220

221221
## Next steps
222222

content/terraform/v1.14.x (beta)/docs/language/stacks/deploy/conditions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ deployment_auto_approve "no_changes" {
5252

5353
</CodeBlockConfig>
5454

55-
The `condition` argument in the `deployment_auto_approve` block has access to the `context` of the current deployment run. To learn more about `context`, refer to the [`deployment_auto_approve` reference](/terraform/language/block/stack/deploy/deployment_auto_approve#deployment-plan-context).
55+
The `condition` argument in the `deployment_auto_approve` block has access to the `context` of the current deployment run. To learn more about `context`, refer to the [`deployment_auto_approve` reference](/terraform/language/block/stack/tfdeploy/deployment_auto_approve#deployment-plan-context).
5656

5757
After defining your auto-approval rule, add that rule to your deployment group using the `auto_approve_checks` argument. In the following example, the `staging_group` deployment group enforces the `no_changes` rule:
5858

content/terraform/v1.14.x (beta)/docs/language/stacks/deploy/config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ deployment "web" {
216216

217217
Now, whenever the `web` deployment generates a deployment run that does not destroy resources, HCP Terraform automatically approves that run.
218218

219-
If you don't assign a deployment to a group, Terraform automatically creates a default deployment group for that deployment. To learn more about defining deployment groups, refer to the [`deployment_group` reference](/terraform/language/block/stack/deploy/deployment_group). To learn more about setting up deployment group orchestration rules, refer to [Set conditions for deployment runs](/terraform/language/stacks/deploy/conditions).
219+
If you don't assign a deployment to a group, Terraform automatically creates a default deployment group for that deployment. To learn more about defining deployment groups, refer to the [`deployment_group` reference](/terraform/language/block/stack/tfdeploy/deployment_group). To learn more about setting up deployment group orchestration rules, refer to [Set conditions for deployment runs](/terraform/language/stacks/deploy/conditions).
220220

221221
## Next steps
222222

scripts/prebuild/mdx-transforms/build-mdx-transforms-file.mjs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import path from 'node:path'
1010
import remark from 'remark'
1111
import remarkMdx from 'remark-mdx'
1212
import grayMatter from 'gray-matter'
13+
import semver from 'semver'
1314

1415
import { paragraphCustomAlertsPlugin } from './paragraph-custom-alert/paragraph-custom-alert.mjs'
1516
import { rewriteInternalLinksPlugin } from './add-version-to-internal-links/add-version-to-internal-links.mjs'
@@ -37,14 +38,29 @@ export async function buildFileMdxTransforms(filePath) {
3738

3839
const relativePath = path.relative(targetDir, filePath)
3940
const [repoSlug, version, contentDir] = relativePath.split('/')
41+
/**
42+
* handles version and content dir for versionless docs
43+
* these values are index based
44+
* if versionless, version becomes the content dir
45+
* which will cause an error when trying resolve partials
46+
*/
47+
const verifiedVersion = PRODUCT_CONFIG[repoSlug].versionedDocs ? version : ''
48+
const verifiedContentDir = semver.valid(semver.coerce(version))
49+
? contentDir
50+
: version
4051
const partialsDir = path.join(
4152
targetDir,
4253
repoSlug,
43-
version,
44-
contentDir,
54+
verifiedVersion,
55+
verifiedContentDir,
4556
'partials',
4657
)
47-
const redirectsDir = path.join('/server/', targetDir, repoSlug, version)
58+
const redirectsDir = path.join(
59+
'/server/',
60+
targetDir,
61+
repoSlug,
62+
verifiedVersion,
63+
)
4864
const outPath = path.join(outputDir, relativePath)
4965

5066
const entry = {

scripts/prebuild/mdx-transforms/build-mdx-transforms-file.test.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ An exact location within a [schema](/plugin/framework/schemas)`
3232

3333
beforeEach(() => {
3434
vol.fromJSON({
35-
'/content/terraform/v1.19.x/test.mdx': mdxContent,
36-
'/public/content/terraform/v1.19.x/test.mdx': transformedMdxContent,
35+
'content/terraform/v1.19.x/test.mdx': mdxContent,
36+
'public/content/terraform/v1.19.x/test.mdx': transformedMdxContent,
3737
'app/api/versionMetadata.json': JSON.stringify(versionMetadata),
38-
'/content/terraform/v1.19.x/partials': {},
38+
'content/terraform/v1.19.x/partials': {},
3939
})
4040
})
4141

42-
const transformedOutPath = '/public/content/terraform/v1.19.x/test.mdx'
42+
const transformedOutPath = 'public/content/terraform/v1.19.x/test.mdx'
4343

4444
test('test buildfileMdxTransforms', async () => {
45-
await buildFileMdxTransforms('/content/terraform/v1.19.x/test.mdx')
45+
await buildFileMdxTransforms('content/terraform/v1.19.x/test.mdx')
4646
const transformedContent = fs.readFileSync(transformedOutPath, 'utf8')
4747
expect(transformedContent).toContain(transformedMdxContent)
4848
})
@@ -54,7 +54,7 @@ test('test applyFileMdxTransforms', async () => {
5454
},
5555
})
5656
const entry = {
57-
filePath: '/content/terraform/v1.19.x/test.mdx',
57+
filePath: 'content/terraform/v1.19.x/test.mdx',
5858
partialsDir: '../../partials',
5959
outPath: transformedOutPath,
6060
}
-285 Bytes
Binary file not shown.
-115 Bytes
Binary file not shown.
-116 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)