-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Brendan Le Glaunec <[email protected]>
- Loading branch information
Showing
83 changed files
with
13,646 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gomod | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
groups: | ||
all: | ||
patterns: | ||
- "*" | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
groups: | ||
all: | ||
patterns: | ||
- "*" | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
name: release | ||
jobs: | ||
terraform-provider-release: | ||
name: 'Terraform Provider Release' | ||
uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/community.yml@v2 | ||
secrets: | ||
gpg-private-key: '${{ secrets.GPG_PRIVATE_KEY }}' | ||
with: | ||
setup-go-version-file: 'go.mod' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
name: run tests | ||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
env: | ||
GO_VERSION: "1.21" | ||
GOLANGCI_LINT_VERSION: v1.54.2 | ||
|
||
steps: | ||
- name: Install Go | ||
if: success() | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run linter | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: ${{ env.GOLANGCI_LINT_VERSION }} | ||
args: --go ${{ env.GO_VERSION }} | ||
|
||
- name: Run tests | ||
run: go test -race ./... | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: latest | ||
args: release --clean --snapshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1 @@ | ||
# If you prefer the allow list template instead of the deny list, see community template: | ||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore | ||
# | ||
# 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/ | ||
|
||
# Go workspace file | ||
go.work | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
run: | ||
tests: false | ||
timeout: 5m | ||
|
||
linters-settings: | ||
cyclop: | ||
max-complexity: 15 | ||
skip-tests: true | ||
lll: | ||
line-length: 130 | ||
gofumpt: | ||
extra-rules: true | ||
gosec: | ||
excludes: | ||
- G101 | ||
- G402 | ||
tagliatelle: | ||
case: | ||
use-field-name: true | ||
rules: | ||
json: pascal | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- interfacer # deprecated | ||
- scopelint # deprecated | ||
- maligned # deprecated | ||
- golint # deprecated | ||
- gocyclo # duplicate of cyclop | ||
- structcheck # deprecated | ||
- ifshort # deprecated | ||
- varcheck # deprecated | ||
- deadcode # deprecated | ||
- nosnakecase # deprecated | ||
- exhaustivestruct # deprecated | ||
- depguard | ||
- dupl | ||
- exhaustive | ||
- exhaustruct | ||
- forcetypeassert | ||
- funlen | ||
- gochecknoglobals | ||
- gochecknoinits | ||
- godox | ||
- goerr113 | ||
- gomnd | ||
- gomoddirectives | ||
- ireturn | ||
- lll | ||
- nlreturn | ||
- nonamedreturns | ||
- tagliatelle | ||
- varnamelen | ||
- wrapcheck | ||
- wsl | ||
|
||
issues: | ||
exclude-use-default: false | ||
exclude: | ||
- "ST1000: at least one file in a package should have a package comment" | ||
- "package-comments: should have a package comment" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
project_name: terraform-provider-ec | ||
dist: dist | ||
|
||
env: | ||
- CGO_ENABLED=0 | ||
|
||
builds: | ||
- id: terraform-provider-ec | ||
binary: "terraform-provider-ec_{{ .Version }}" | ||
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" | ||
- goos: darwin | ||
goarch: arm | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
|
||
checksum: | ||
extra_files: | ||
- glob: 'terraform-registry-manifest.json' | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' | ||
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS" | ||
algorithm: sha256 | ||
|
||
changelog: | ||
skip: true | ||
|
||
archives: | ||
- format: zip | ||
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" | ||
|
||
release: | ||
extra_files: | ||
- glob: 'terraform-registry-manifest.json' | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' | ||
|
||
signs: | ||
- artifacts: checksum | ||
stdin: '{{ .Env.GPG_PASSWORD }}' | ||
args: | ||
- "--batch" | ||
- "--no-tty" | ||
- "--pinentry-mode" | ||
- "loopback" | ||
- "--passphrase" | ||
- '{{ .Env.GPG_PASSWORD }}' | ||
- "--local-user" | ||
- "{{ .Env.GPG_FINGERPRINT }}" | ||
- "--output" | ||
- "${signature}" | ||
- "--detach-sign" | ||
- "${artifact}" | ||
|
||
snapshot: | ||
name_template: 'dev-{{ slice .FullCommit 0 8}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#Cleanup | ||
|
||
fmt: | ||
@echo "==> Formatting source" | ||
@gofmt -s -w $(shell find . -type f -name '*.go' -not -path "./vendor/*") | ||
@echo "==> Done" | ||
.PHONY: fmt | ||
|
||
#Test | ||
|
||
test: | ||
@go test -cover -race ./... | ||
.PHONY: test | ||
|
||
#Lint | ||
|
||
lint: | ||
@golangci-lint run --config=.golangci.yml ./... | ||
.PHONY: lint | ||
|
||
#Build | ||
|
||
build: | ||
@goreleaser release --clean --snapshot | ||
.PHONY: build | ||
|
||
# Schema Generation | ||
|
||
schema-gen: | ||
@go run ./internal/cmd/schema-gen/ | ||
.PHONY: schema-gen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
# terraform-provider-ec | ||
Terraform provider for Nitrado Enterprise Console | ||
# Armada Terraform Provider | ||
|
||
Armada Terraform provider allowing to interact with Enterprise Console Armada via Terraform. | ||
|
||
## Usage | ||
|
||
See the [docs](docs/index.md) to find supported resources and data sources. | ||
|
||
## Development | ||
|
||
### Documentation Generation | ||
|
||
The documentation is generated using Go's `generate` command: | ||
|
||
```shell | ||
go generate | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package main | ||
|
||
//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate |
Oops, something went wrong.