Skip to content

Commit

Permalink
chore: add automated testing for documentation (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone authored Oct 5, 2020
1 parent e5f5490 commit bda3cb0
Show file tree
Hide file tree
Showing 50 changed files with 227 additions and 169 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Documentation Checks
on:
push:
branches:
- master
pull_request:
paths:
- .markdownlinkcheck.json
- .markdownlint.yml
- .github/workflows/documentation.yml
- docs/**

env:
GO_VERSION: "1.14"
GO111MODULE: on

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
config-file: '.markdownlinkcheck.json'
folder-path: 'docs'
file-extension: '.md'
markdown-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: avto-dev/markdown-lint@v1
with:
config: '.markdownlint.yml'
args: 'docs'
misspell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: go install github.com/client9/misspell/cmd/misspell
- run: misspell -error -source text docs/
21 changes: 21 additions & 0 deletions .markdownlinkcheck.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"ignorePatterns": [
{
"pattern": "^https://github.com/[^/]+/[^/]+/(issues|labels|pull)"
}
],
"replacementPatterns": [
{
"pattern": "^(/docs/(?!providers/scaleway/))",
"replacement": "https://terraform.io$1"
},
{
"pattern": "^(?!http(s)?://)(.*)\\.html(#.*)?$",
"replacement": "$2.html.markdown$3"
},
{
"pattern": "^file:///github/workspace/website/docs/guides/(.*)\\.markdown(#.*)?$",
"replacement": "file:///github/workspace/website/docs/guides/$1.md$2"
}
]
}
23 changes: 23 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Configuration for markdownlint
# https://github.com/DavidAnson/markdownlint#configuration

default: true
MD007:
indent: 4

# Disabled Rules
# https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md

MD001: false
MD004: false
MD006: false
MD010: false
MD012: false
MD013: false
MD014: false
MD022: false
MD024: false
MD034: false
MD038: false
MD040: false
MD047: false
3 changes: 1 addition & 2 deletions docs/data-sources/account_ssh_key.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_account_ssh_key"
description: |-
Get information on a Scaleway SSH key.
Expand Down Expand Up @@ -27,7 +26,7 @@ data "scaleway_account_ssh_key" "my_key" {

- `name` - The SSH key name. Only one of `name` and `ssh_key_id` should be specified.
- `ssh_key_id` - The SSH key id. Only one of `name` and `ssh_key_id` should be specified.
- `organization_id` - (Defaults to [provider](../index.html#organization_id) `organization_id`) The ID of the organization the server is associated with.
- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the server is associated with.


## Attributes Reference
Expand Down
3 changes: 1 addition & 2 deletions docs/data-sources/baremetal_offer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_baremetal_offer"
description: |-
Gets information about a baremetal offer.
Expand Down Expand Up @@ -33,7 +32,7 @@ data "scaleway_baremetal_offer" "my_offer" {

- `allow_disabled` - (Optional, default `false`) Include disabled offers.

- `zone` - (Defaults to [provider](../index.html#zone) `zone`) The [zone](../guides/regions_and_zones.html#zones) in which the offer should be created.
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the offer should be created.

## Attributes Reference

Expand Down
1 change: 0 additions & 1 deletion docs/data-sources/bootscript.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_bootscript"
description: |-
Get information on a Scaleway bootscript.
Expand Down
1 change: 0 additions & 1 deletion docs/data-sources/image.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_image"
description: |-
Get information on a Scaleway image.
Expand Down
3 changes: 1 addition & 2 deletions docs/data-sources/instance_image.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_instance_image"
description: |-
Gets information about an Instance Image.
Expand Down Expand Up @@ -33,7 +32,7 @@ data "scaleway_instance_image" "my_image" {

- `latest` - (Optional, default `true`) Use the latest image ID.

- `zone` - (Defaults to [provider](../index.html#zone) `zone`) The [zone](../guides/regions_and_zones.html#zones) in which the image exists.
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the image exists.

## Attributes Reference

Expand Down
3 changes: 1 addition & 2 deletions docs/data-sources/instance_security_group.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_instance_security_group"
description: |-
Gets information about a Security Group.
Expand Down Expand Up @@ -29,7 +28,7 @@ data "scaleway_instance_security_group" "my_key" {

- `security_group_id` - (Optional) The security group id. Only one of `name` and `security_group_id` should be specified.

- `zone` - (Defaults to [provider](../index.html#zone) `zone`) The [zone](../guides/regions_and_zones.html#zones) in which the security group exists.
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the security group exists.

## Attributes Reference

Expand Down
13 changes: 6 additions & 7 deletions docs/data-sources/instance_server.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_instance_server"
description: |-
Gets information about an Instance Server.
Expand Down Expand Up @@ -29,7 +28,7 @@ data "scaleway_instance_server" "my_key" {

- `server_id` - (Optional) The server id. Only one of `name` and `server_id` should be specified.

- `zone` - (Defaults to [provider](../index.html#zone) `zone`) The [zone](../guides/regions_and_zones.html#zones) in which the server exists.
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the server exists.

## Attributes Reference

Expand All @@ -51,8 +50,8 @@ You find all the available types on the [pricing page](https://www.scaleway.com/
- `placement_group_id` - The [placement group](https://developers.scaleway.com/en/products/instance/api/#placement-groups-d8f653) the server is attached to.

- `root_volume` - Root [volume](https://developers.scaleway.com/en/products/instance/api/#volumes-7e8a39) attached to the server on creation.
- `size_in_gb` - Size of the root volume in gigabytes.
- `delete_on_termination` - Forces deletion of the root volume on instance termination.
- `size_in_gb` - Size of the root volume in gigabytes.
- `delete_on_termination` - Forces deletion of the root volume on instance termination.

- `additional_volume_ids` - The [additional volumes](https://developers.scaleway.com/en/products/instance/api/#volumes-7e8a39)
attached to the server.
Expand All @@ -67,14 +66,14 @@ attached to the server.

- `user_data` - The user data associated with the server.

- `key` - The user data key. The `cloud-init` key is reserved, please use `cloud_init` attribute instead.
- `key` - The user data key. The `cloud-init` key is reserved, please use `cloud_init` attribute instead.

- `value` - The user data content.
- `value` - The user data content.

- `placement_group_policy_respected` - True when the placement group policy is respected.

- `root_volume`
- `volume_id` - The volume ID of the root volume of the server.
- `volume_id` - The volume ID of the root volume of the server.

- `private_ip` - The Scaleway internal IP address of the server.

Expand Down
5 changes: 2 additions & 3 deletions docs/data-sources/instance_volume.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_instance_volume"
description: |-
Gets information about an instance volume.
Expand Down Expand Up @@ -31,9 +30,9 @@ data "scaleway_instance_volume" "my_volume" {
- `volume_id` - (Optional) The volume id.
Only one of `name` and `volume_id` should be specified.

- `zone` - (Defaults to [provider](../index.html#zone) `zone`) The [zone](../guides/regions_and_zones.html#zones) in which the volume exists.
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the volume exists.

- `organization_id` - (Defaults to [provider](../index.html#organization_id) `organization_id`) The ID of the organization the server is associated with.
- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the server is associated with.

## Attributes Reference

Expand Down
5 changes: 2 additions & 3 deletions docs/data-sources/lb_ip_beta.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_lb_ip_beta"
description: |-
Gets information about a Load Balancer IP.
Expand Down Expand Up @@ -31,9 +30,9 @@ data "scaleway_lb_ip_beta" "my_ip" {
- `lb_id` - (Optional) The IP ID.
Only one of `ip_address` and `ip_id` should be specified.

- `region` - (Defaults to [provider](../index.html#region) `region`) The [region](../guides/regions_and_zones.html#zones) in which the LB IP exists.
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#zones) in which the LB IP exists.

- `organization_id` - (Defaults to [provider](../index.html#organization_id) `organization_id`) The ID of the organization the LB IP is associated with.
- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the LB IP is associated with.

## Attributes Reference

Expand Down
3 changes: 1 addition & 2 deletions docs/data-sources/marketplace_image_beta.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_marketplace_image_beta"
description: |-
Gets local image ID of an image from its label name.
Expand All @@ -25,7 +24,7 @@ to find the right `label`.
- `instance_type` - (Optional, default `DEV1-S`) The instance type the image is compatible with.
You find all the available types on the [pricing page](https://www.scaleway.com/en/pricing/).

- `zone` - (Defaults to [provider](../index.html#zone) `zone`) The [zone](../guides/regions_and_zones.html#zones) in which the image exists.
- `zone` - (Defaults to [provider](../index.md#zone) `zone`) The [zone](../guides/regions_and_zones.md#zones) in which the image exists.

## Attributes Reference

Expand Down
5 changes: 2 additions & 3 deletions docs/data-sources/registry_image_beta.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_registry_image_beta"
description: |-
Gets information about a registry image.
Expand Down Expand Up @@ -34,9 +33,9 @@ data "scaleway_registry_image_beta" "my_image" {

- `namespace_id` - (Optional) The namespace ID in which the image is.

- `region` - (Defaults to [provider](../index.html#region) `region`) The [region](../guides/regions_and_zones.html#regions) in which the image exists.
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the image exists.

- `organization_id` - (Defaults to [provider](../index.html#organization_id) `organization_id`) The ID of the organization the image is associated with.
- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the image is associated with.

## Attributes Reference

Expand Down
5 changes: 2 additions & 3 deletions docs/data-sources/registry_namespace_beta.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_registry_namespace_beta"
description: |-
Gets information about a registry namespace.
Expand Down Expand Up @@ -31,9 +30,9 @@ data "scaleway_registry_namespace_beta" "my_namespace" {
- `namespace_id` - (Optional) The namespace id.
Only one of `name` and `namespace_id` should be specified.

- `region` - (Defaults to [provider](../index.html#region) `region`) The [region](../guides/regions_and_zones.html#regions) in which the namespace exists.
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the namespace exists.

- `organization_id` - (Defaults to [provider](../index.html#organization_id) `organization_id`) The ID of the organization the namespace is associated with.
- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the namespace is associated with.

## Attributes Reference

Expand Down
1 change: 0 additions & 1 deletion docs/data-sources/security_group.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_security_group"
description: |-
Gets information about a Security Group.
Expand Down
1 change: 0 additions & 1 deletion docs/data-sources/volume.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_volume"
description: |-
Gets information about a Volume.
Expand Down
5 changes: 2 additions & 3 deletions docs/guides/migration_guide_v2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Migration Guide"
description: |-
Migrating your Scaleway provider from v1 to v2.
Expand Down Expand Up @@ -119,7 +118,7 @@ resource "scaleway_instance_ip" "test_ip" {
`scaleway_volume` was renamed to `scaleway_instance_volume`.
The former attributes can still be used on the new volume resource.

Additionally, from now on, you can also create new volumes based on other volumes or snapshots. For more information check the [new volume `scaleway_instance_volume` resource](../r/instance_volume.html).
Additionally, from now on, you can also create new volumes based on other volumes or snapshots. For more information check the [new volume `scaleway_instance_volume` resource](../resources/instance_volume.md).

#### Renamed: `scaleway_ssh_key` -> `scaleway_account_ssk_key`

Expand Down Expand Up @@ -152,4 +151,4 @@ Volumes can in version 2 only be attached on the server resource. The [above exa

The `scaleway_bucket` was moved to the `object` product in the `storage` product category.

It's behaviour remained the same, but we also added an [`acl` attribute](../r/object_bucket.html#acl). This attribute takes canned ACLs.
It's behaviour remained the same, but we also added an [`acl` attribute](../resources/object_bucket.md#acl). This attribute takes canned ACLs.
7 changes: 3 additions & 4 deletions docs/guides/regions_and_zones.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway Zones and Regions"
description: |-
Scaleway resources can be created in availability zones and regions.
Expand All @@ -23,10 +22,10 @@ In order to deploy highly available application, a region can be splitted in man
List of availability zones by regions:

- France - Paris (`fr-par`)
- `fr-par-1`
- `fr-par-2`
- `fr-par-1`
- `fr-par-2`
- The Netherlands - Amsterdam (`nl-ams`)
- `nl-ams-1`
- `nl-ams-1`

## Resource IDs

Expand Down
7 changes: 3 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Provider: Scaleway"
description: |-
The Scaleway provider is used to manage Scaleway resources. The provider needs to be configured with the proper credentials before it can be used.
Expand All @@ -10,7 +9,7 @@ description: |-
The Scaleway provider is used to manage Scaleway resources.
The provider needs to be configured with the proper credentials before it can be used.

**This is the documentation for the version `>= 1.11.0` of the provider. If you come from `< v1.11.0`, checkout to [migration guide](./guides/migration_guide_v2.html).**
**This is the documentation for the version `>= 1.11.0` of the provider. If you come from `< v1.11.0`, checkout to [migration guide](./guides/migration_guide_v2.md).**

Use the navigation to the left to read about the available resources.

Expand Down Expand Up @@ -149,11 +148,11 @@ in this priority order.
the `SCW_DEFAULT_ORGANIZATION_ID` [environment variable](https://github.com/scaleway/scaleway-sdk-go/blob/master/scw/README.md#environment-variables), or via a [shared configuration file](https://github.com/scaleway/scaleway-sdk-go/blob/master/scw/README.md#scaleway-config),
in this priority order.

- `region` - (Optional) The [region](./guides/regions_and_zones.html#regions) that will be used as default value for all resources. It can also be sourced from
- `region` - (Optional) The [region](./guides/regions_and_zones.md#regions) that will be used as default value for all resources. It can also be sourced from
the `SCW_DEFAULT_REGION` [environment variable](https://github.com/scaleway/scaleway-sdk-go/blob/master/scw/README.md#environment-variables), or via a [shared configuration file](https://github.com/scaleway/scaleway-sdk-go/blob/master/scw/README.md#scaleway-config),
in this priority order.

- `zone` - (Optional) The [zone](./guides/regions_and_zones.html#zones) that will be used as default value for all resources. It can also be sourced from
- `zone` - (Optional) The [zone](./guides/regions_and_zones.md#zones) that will be used as default value for all resources. It can also be sourced from
the `SCW_DEFAULT_ZONE` [environment variable](https://github.com/scaleway/scaleway-sdk-go/blob/master/scw/README.md#environment-variables), or via a [shared configuration file](https://github.com/scaleway/scaleway-sdk-go/blob/master/scw/README.md#scaleway-config),
in this priority order.

Expand Down
3 changes: 1 addition & 2 deletions docs/resources/account_ssh_key.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: "scaleway"
page_title: "Scaleway: scaleway_account_ssh_key"
description: |-
Manages Scaleway user SSH keys.
Expand All @@ -24,7 +23,7 @@ The following arguments are supported:

- `name` - (Required) The name of the SSH key.
- `public_key` - (Required) The public SSH key to be added.
- `organization_id` - (Defaults to [provider](../index.html#organization_id) `organization_id`) The ID of the organization the IP is associated with.
- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the IP is associated with.

## Attributes Reference

Expand Down
Loading

0 comments on commit bda3cb0

Please sign in to comment.