Skip to content

Commit b748e91

Browse files
authored
docs: Update documentation (#132)
Updates the documentation formats and adds automatic checks to validate in each PR
1 parent ae298a8 commit b748e91

File tree

55 files changed

+1002
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1002
-385
lines changed

.github/workflows/ci-master.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- master
77

8+
env:
9+
GO_VERSION: "^1.17"
10+
811
jobs:
912
build-multiarch:
1013
name: Build
@@ -43,10 +46,7 @@ jobs:
4346
- name: Set up Go
4447
uses: actions/setup-go@v2
4548
with:
46-
go-version: ^1.15
47-
48-
- name: Workaround Go 1.16 issue with go.sum dependencies
49-
run: go env -w GOFLAGS=-mod=mod
49+
go-version: ${{ env.GO_VERSION }}
5050

5151
- name: Build project
5252
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o terraform-provider-sysdig
@@ -62,7 +62,7 @@ jobs:
6262
- name: Set up Go
6363
uses: actions/setup-go@v2
6464
with:
65-
go-version: ^1.15
65+
go-version: ${{ env.GO_VERSION }}
6666

6767
- name: Cache modules
6868
uses: actions/cache@v1
@@ -72,9 +72,6 @@ jobs:
7272
restore-keys: |
7373
${{ runner.os }}-go-
7474
75-
- name: Workaround Go 1.16 issue with go.sum dependencies
76-
run: go env -w GOFLAGS=-mod=mod
77-
7875
- name: Get dependencies
7976
run: |
8077
go get -u -v github.com/onsi/ginkgo/ginkgo
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Terraform Provider Docs
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
env:
9+
TERRAFORM_VERSION: "0.14.8"
10+
GO_VERSION: "^1.17"
11+
12+
jobs:
13+
go_build:
14+
name: go build
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/cache@v2
19+
continue-on-error: true
20+
id: cache-terraform-plugin-dir
21+
timeout-minutes: 2
22+
with:
23+
path: terraform-plugin-dir
24+
key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('sysdig/**') }}
25+
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
26+
uses: actions/setup-go@v2
27+
with:
28+
go-version: ${{ env.GO_VERSION }}
29+
# See also: https://github.com/actions/setup-go/issues/54
30+
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
31+
name: go env
32+
run: |
33+
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
34+
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
35+
uses: actions/cache@v2
36+
with:
37+
path: ${{ env.GOCACHE }}
38+
key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('sysdig/**') }}
39+
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
40+
uses: actions/cache@v2
41+
with:
42+
path: ~/go/pkg/mod
43+
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
44+
- if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure'
45+
name: go build
46+
run: go build -o terraform-plugin-dir/registry.terraform.io/sysdiglabs/sysdig/99.99.99/$(go env GOOS)_$(go env GOARCH)/terraform-provider-sysdig .
47+
48+
terraform_providers_schema:
49+
name: terraform providers schema
50+
needs: [ go_build ]
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v2
54+
- uses: actions/cache@v2
55+
continue-on-error: true
56+
id: cache-terraform-providers-schema
57+
timeout-minutes: 2
58+
with:
59+
path: terraform-providers-schema
60+
key: ${{ runner.os }}-terraform-providers-schema-${{ hashFiles('go.sum') }}-${{ hashFiles('sysdig/**') }}
61+
- if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure'
62+
uses: actions/cache@v2
63+
timeout-minutes: 2
64+
with:
65+
path: terraform-plugin-dir
66+
key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('sysdig/**') }}
67+
- if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure'
68+
uses: hashicorp/setup-terraform@v1
69+
with:
70+
terraform_version: ${{ env.TERRAFORM_VERSION }}
71+
terraform_wrapper: false
72+
- if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure'
73+
name: terraform init
74+
run: |
75+
# We need a file to initialize the provider
76+
cat <<EOF > main.tf
77+
terraform {
78+
required_providers { sysdig = { source = "sysdiglabs/sysdig" } }
79+
}
80+
EOF
81+
terraform init -plugin-dir terraform-plugin-dir
82+
- if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure'
83+
name: terraform providers schema
84+
run: |
85+
mkdir terraform-providers-schema
86+
terraform providers schema -json > terraform-providers-schema/schema.json
87+
88+
tfproviderdocs:
89+
needs: [ terraform_providers_schema ]
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v2
93+
- uses: actions/setup-go@v2
94+
with:
95+
go-version: ${{ env.GO_VERSION }}
96+
- uses: actions/cache@v2
97+
continue-on-error: true
98+
timeout-minutes: 2
99+
with:
100+
path: ~/go/pkg/mod
101+
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
102+
- run: cd /tmp && go install github.com/bflad/tfproviderdocs@latest
103+
- uses: actions/cache@v2
104+
timeout-minutes: 2
105+
with:
106+
path: terraform-providers-schema
107+
key: ${{ runner.os }}-terraform-providers-schema-${{ hashFiles('go.sum') }}-${{ hashFiles('sysdig/**') }}
108+
- name: tfproviderdocs check
109+
run: |
110+
tfproviderdocs check \
111+
-allowed-resource-subcategories-file website/allowed-subcategories.txt \
112+
-enable-contents-check \
113+
-provider-source registry.terraform.io/sysdiglabs/sysdig \
114+
-providers-schema-json terraform-providers-schema/schema.json \
115+
-require-resource-subcategory

.github/workflows/ci-pull-request.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- master
77

8+
env:
9+
GO_VERSION: "^1.17"
10+
811
jobs:
912
build-multiarch:
1013
name: Build
@@ -43,10 +46,7 @@ jobs:
4346
- name: Set up Go
4447
uses: actions/setup-go@v2
4548
with:
46-
go-version: ^1.15
47-
48-
- name: Workaround Go 1.16 issue with go.sum dependencies
49-
run: go env -w GOFLAGS=-mod=mod
49+
go-version: ${{ env.GO_VERSION }}
5050

5151
- name: Build project
5252
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o terraform-provider-sysdig
@@ -62,7 +62,7 @@ jobs:
6262
- name: Set up Go
6363
uses: actions/setup-go@v2
6464
with:
65-
go-version: ^1.15
65+
go-version: ${{ env.GO_VERSION }}
6666

6767
- name: Cache modules
6868
uses: actions/cache@v1
@@ -72,9 +72,6 @@ jobs:
7272
restore-keys: |
7373
${{ runner.os }}-go-
7474
75-
- name: Workaround Go 1.16 issue with go.sum dependencies
76-
run: go env -w GOFLAGS=-mod=mod
77-
7875
- name: Get dependencies
7976
run: |
8077
go get -u -v github.com/onsi/ginkgo/ginkgo

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ on:
1414
push:
1515
tags:
1616
- 'v*'
17+
18+
env:
19+
GO_VERSION: "^1.17"
20+
1721
jobs:
1822
goreleaser:
1923
runs-on: ubuntu-latest
@@ -25,7 +29,7 @@ jobs:
2529
- name: Set up Go
2630
uses: actions/setup-go@v2
2731
with:
28-
go-version: ^1.15
32+
go-version: ${{ env.GO_VERSION }}
2933
- name: Import GPG key
3034
id: import_gpg
3135
uses: paultyng/ghaction-import-gpg@v2.1.0

go.mod

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,45 @@ module github.com/draios/terraform-provider-sysdig
33
go 1.15
44

55
require (
6-
cloud.google.com/go v0.76.0 // indirect
76
cloud.google.com/go/storage v1.13.0 // indirect
7+
github.com/Jeffail/gabs/v2 v2.6.1 // indirect
88
github.com/agext/levenshtein v1.2.3 // indirect
99
github.com/apparentlymart/go-cidr v1.1.0 // indirect
10-
github.com/aws/aws-sdk-go v1.37.10
10+
github.com/aws/aws-sdk-go v1.40.57
11+
github.com/containerd/stargz-snapshotter/estargz v0.9.0 // indirect
12+
github.com/docker/cli v20.10.9+incompatible // indirect
13+
github.com/docker/docker v20.10.9+incompatible // indirect
14+
github.com/docker/docker-credential-helpers v0.6.4 // indirect
1115
github.com/falcosecurity/kilt/pkg v0.0.0-20210817131636-d0ea1236e9cf // indirect
1216
github.com/falcosecurity/kilt/runtimes/cloudformation v0.0.0-20210817131636-d0ea1236e9cf
13-
github.com/fatih/color v1.12.0 // indirect
17+
github.com/fatih/color v1.13.0 // indirect
18+
github.com/google/go-containerregistry v0.6.0 // indirect
1419
github.com/hashicorp/errwrap v1.1.0 // indirect
1520
github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637
16-
github.com/hashicorp/go-hclog v0.16.2 // indirect
21+
github.com/hashicorp/go-hclog v1.0.0 // indirect
1722
github.com/hashicorp/go-multierror v1.1.1 // indirect
18-
github.com/hashicorp/go-plugin v1.4.2 // indirect
23+
github.com/hashicorp/go-plugin v1.4.3 // indirect
1924
github.com/hashicorp/go-retryablehttp v0.7.0
2025
github.com/hashicorp/go-uuid v1.0.2 // indirect
21-
github.com/hashicorp/hcl/v2 v2.10.0 // indirect
22-
github.com/hashicorp/terraform-plugin-go v0.3.1 // indirect
23-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0
24-
github.com/hashicorp/yamux v0.0.0-20210707203944-259a57b3608c // indirect
26+
github.com/hashicorp/hcl/v2 v2.10.1 // indirect
27+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.8.0
28+
github.com/hashicorp/yamux v0.0.0-20210826001029-26ff87cf9493 // indirect
2529
github.com/jmespath/go-jmespath v0.4.0
2630
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
27-
github.com/klauspost/compress v1.11.7 // indirect
28-
github.com/mattn/go-isatty v0.0.13 // indirect
31+
github.com/mattn/go-colorable v0.1.11 // indirect
2932
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
3033
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
31-
github.com/mitchellh/mapstructure v1.4.1 // indirect
34+
github.com/mitchellh/mapstructure v1.4.2 // indirect
3235
github.com/oklog/run v1.1.0 // indirect
33-
github.com/spf13/cast v1.3.1
36+
github.com/pierrec/lz4 v2.0.5+incompatible // indirect
37+
github.com/rs/zerolog v1.25.0 // indirect
38+
github.com/spf13/cast v1.4.1
3439
github.com/ulikunitz/xz v0.5.10 // indirect
35-
github.com/zclconf/go-cty v1.9.0 // indirect
36-
go.opencensus.io v0.22.6 // indirect
37-
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
38-
golang.org/x/oauth2 v0.0.0-20210210192628-66670185b0cd // indirect
39-
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
40-
google.golang.org/api v0.40.0 // indirect
41-
google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a // indirect
40+
github.com/zclconf/go-cty v1.9.1 // indirect
41+
golang.org/x/net v0.0.0-20211007125505-59d4e928ea9d // indirect
42+
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac // indirect
43+
golang.org/x/text v0.3.7 // indirect
44+
google.golang.org/api v0.47.0 // indirect
45+
google.golang.org/genproto v0.0.0-20211005153810-c76a74d43a8e // indirect
46+
google.golang.org/grpc v1.41.0 // indirect
4247
)

0 commit comments

Comments
 (0)