Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
Axton Grams committed Sep 29, 2022
0 parents commit 205e1d3
Show file tree
Hide file tree
Showing 68 changed files with 230,748 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code of Conduct

HashiCorp Community Guidelines apply to you when interacting with the community here on GitHub and contributing code.

Please read the full text at https://www.hashicorp.com/community-guidelines
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

### Terraform Version
Run `terraform -v` to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

### Affected Resource(s)
Please list the resources as a list, for example:
- opc_instance
- opc_storage_volume

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

### Terraform Configuration Files
```hcl
# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.
```

### Debug Output
Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

### Panic Output
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the `crash.log`.

### Expected Behavior
What should have happened?

### Actual Behavior
What actually happened?

### Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
1. `terraform apply`

### Important Factoids
Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

### References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
- GH-1234
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See GitHub's docs for more information on this file:
# https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"

# Maintain dependencies for Go modules
- package-ecosystem: "gomod"
directory: "/"
schedule:
# Check for updates to Go modules every weekday
interval: "daily"
189 changes: 189 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: Tests
on:
pull_request:
paths-ignore:
- 'README.md'
push:
paths-ignore:
- 'README.md'
jobs:
# ensure the code builds...
build:
name: Build
runs-on: [ self-hosted ]
timeout-minutes: 5
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
id: go
env:
GOPATH: /home/ec2-user/actions-runner/work/go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Debug
run: |
pwd
echo HOME ${HOME}
echo GITHUB_WORKSPACE ${GITHUB_WORKSPACE}
echo GOPATH ${GOPATH}
echo GOROOT ${GOROOT}
env:
GOPATH: /home/ec2-user/actions-runner/work/go
- name: Get dependencies
run: |
go mod download
env:
GOPATH: /home/ec2-user/actions-runner/work/go
- name: Build
run: |
go build -v .
env:
GOPATH: /home/ec2-user/actions-runner/work/go
HOME: /home/ec2-user/actions-runner/_work/terraform-provider-wiz
lint:
name: go-lint
runs-on: [ self-hosted ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
env:
GOPATH: /home/ec2-user/actions-runner/work/go
- name: check
uses: danhunsaker/[email protected]
with:
run: lint
token: ${{ secrets.GITHUB_TOKEN }}
env:
GOPATH: /home/ec2-user/actions-runner/work/go
fmt:
name: go-fmt
runs-on: [ self-hosted ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
env:
GOPATH: /home/ec2-user/actions-runner/work/go
- name: check
uses: danhunsaker/[email protected]
with:
run: fmt
token: ${{ secrets.GITHUB_TOKEN }}
env:
GOPATH: /home/ec2-user/actions-runner/work/go
imports:
name: go-imports
runs-on: [ self-hosted ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
env:
GOPATH: /home/ec2-user/actions-runner/work/go
- name: check
uses: danhunsaker/[email protected]
with:
run: imports
token: ${{ secrets.GITHUB_TOKEN }}
env:
GOPATH: /home/ec2-user/actions-runner/work/go

generate:
runs-on: [ self-hosted ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
env:
GOPATH: /home/ec2-user/actions-runner/work/go
- uses: hashicorp/setup-terraform@v1
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- name: Setup Nodejs
uses: actions/setup-node@v1
- run: go generate ./...
env:
GOPATH: /home/ec2-user/actions-runner/work/go
HOME: /home/ec2-user/actions-runner/_work/terraform-provider-wiz
- name: git diff
run: |
#git diff --compact-summary --exit-code || \
git diff --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
test:
name: Matrix Test
needs: build
runs-on: [ self-hosted ]
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
# list whatever Terraform versions here you would like to support
terraform:
- '0.13.*'
- '0.14.*'
- '0.15.*'
- '1.0.*'
- '1.1.*'
- '1.2.*'
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
id: go
env:
GOPATH: /home/ec2-user/actions-runner/work/go
- name: Setup Nodejs
uses: actions/setup-node@v1
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v1
with:
terraform_version: ${{ matrix.terraform }}
#terraform_wrapper: false
- name: Terraform Format
id: fmt
run: terraform fmt -check
- name: Get dependencies
run: |
go mod download
env:
GOPATH: /home/ec2-user/actions-runner/work/go
- name: TF acceptance tests
timeout-minutes: 10
env:
GOPATH: /home/ec2-user/actions-runner/work/go
TF_ACC: "1"
HOME: /home/ec2-user/actions-runner/_work/terraform-provider-wiz
TF_VAR_WIZ_URL: ${{ secrets.WIZ_URL }}
TF_VAR_WIZ_AUTH_CLIENT_ID: ${{ secrets.WIZ_AUTH_CLIENT_ID }}
TF_VAR_WIZ_AUTH_CLIENT_SECRET: ${{ secrets.WIZ_AUTH_CLIENT_SECRET }}
TF_VAR_PROXY: ${{ secrets.PROXY }}
TF_VAR_PROXY_SERVER: ${{ secrets.PROXY_SERVER }}
TF_VAR_CA_CHAIN: ${{ secrets.CA_CHAIN }}
WIZ_URL: ${{ secrets.WIZ_URL }}
WIZ_AUTH_CLIENT_ID: ${{ secrets.WIZ_AUTH_CLIENT_ID }}
WIZ_AUTH_CLIENT_SECRET: ${{ secrets.WIZ_AUTH_CLIENT_SECRET }}
PROXY: ${{ secrets.PROXY }}
PROXY_SERVER: ${{ secrets.PROXY_SERVER }}
CA_CHAIN: ${{ secrets.CA_CHAIN }}
CGO_ENABLED: 0
run: |
go test -v -cover ./internal/provider/
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
/vendor

terraform-provider-wiz
60 changes: 60 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
before:
hooks:
# this is just an example and not a requirement for provider building/publishing
- go mod tidy
builds:
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
extra_files:
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
signs:
- artifacts: checksum
args:
# if you are using this in a GitHub action or some other automated pipeline, you
# need to pass the batch flag to indicate its not interactive.
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"
release:
extra_files:
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
changelog:
skip: true
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.4.0
hooks:
- id: go-fmt
- id: go-vet
- id: go-lint # This is deprecated/frozen per https://github.com/golang/lint
- id: go-imports
# - id: go-cyclo
# args: [-over=30]
- id: validate-toml
- id: go-unit-tests
- id: go-build
- id: go-mod-tidy
- id: go-mod-vendor
30 changes: 30 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
TEST?=$$(go list ./...)
GOFMT_FILES?=$$(find . -name '*.go')
PKG_NAME=http

default: testacc

build:
go install

test:
go test -i $(TEST) || exit 1
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m

vet:
@echo "go vet ."
@go vet $$(go list ./...) ; if [ $$? -eq 1 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi

fmt:
gofmt -w $(GOFMT_FILES)

.PHONY: build test testacc vet fmt
Loading

0 comments on commit 205e1d3

Please sign in to comment.