-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: make a clean open-source version
- Loading branch information
0 parents
commit 3dbdec1
Showing
61 changed files
with
4,788 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 @@ | ||
* @Vitesco-Technologies/kubernetes |
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,13 @@ | ||
--- | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: gomod | ||
directory: / | ||
schedule: | ||
interval: daily | ||
|
||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: daily |
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,25 @@ | ||
name: golang | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
golang: | ||
runs-on: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: go test | ||
run: go test -v ./... | ||
|
||
- name: go build | ||
run: go build . |
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,22 @@ | ||
name: golangci-lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
golangci-lint: | ||
runs-on: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 |
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,39 @@ | ||
name: golang | ||
|
||
# TODO: define new release method. Terraform Registry? | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
golang: | ||
runs-on: [self-hosted,cloudplatforms] | ||
# TODO: github.com | ||
# runs-on: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
|
||
# - name: Import GPG key | ||
# uses: crazy-max/ghaction-import-gpg@v6 | ||
# id: import_gpg | ||
# with: | ||
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
# passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Run goreleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,59 @@ | ||
terraform-provider-qip | ||
terraform-provider-qip.exe | ||
.env* | ||
|
||
### Go ### | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
__debug* | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
### GoReleaser ### | ||
/dist/ | ||
|
||
### Terraform ### | ||
# Local .terraform directories | ||
**/.terraform/* | ||
|
||
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
|
||
# Crash log files | ||
crash.log | ||
|
||
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most | ||
# .tfvars files are managed as part of configuration and so should be included in | ||
# version control. | ||
# | ||
# example.tfvars | ||
|
||
# Ignore override files as they are usually used to override resources locally and so | ||
# are not checked in | ||
override.tf | ||
override.tf.json | ||
*_override.tf | ||
*_override.tf.json | ||
|
||
# Include override files you do wish to add to version control using negated pattern | ||
# !example_override.tf | ||
|
||
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan | ||
# example: *tfplan* | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/go,terraform | ||
|
||
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc | ||
terraform | ||
.terraform* |
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,99 @@ | ||
--- | ||
# https://golangci-lint.run/usage/configuration/ | ||
run: | ||
timeout: 5m | ||
|
||
linters: | ||
disable: | ||
- noctx # Needs to be added later | ||
- contextcheck # Needs to be added later | ||
- exhaustivestruct | ||
- exhaustruct | ||
- varnamelen | ||
- gochecknoinits | ||
- gochecknoglobals | ||
|
||
presets: | ||
- bugs | ||
- comment | ||
# - complexity | ||
- error | ||
- format | ||
- import | ||
- metalinter | ||
- module | ||
- performance | ||
- style | ||
- test | ||
- unused | ||
|
||
linters-settings: | ||
gci: | ||
sections: | ||
- standard | ||
- default | ||
- prefix(github.com/Vitesco-Technologies/terraform-provider-qip) | ||
paralleltest: | ||
ignore-missing: true | ||
testpackage: | ||
allow-packages: | ||
- provider | ||
- main | ||
lll: | ||
line-length: 140 | ||
depguard: | ||
rules: | ||
main: | ||
files: | ||
- "$all" | ||
- "!$test" | ||
- "!**/pkg/utils/**.go" | ||
- "!**/pkg/qip/test/*.go" | ||
allow: | ||
- "$gostd" | ||
- github.com/Vitesco-Technologies/terraform-provider-qip | ||
- github.com/hashicorp/terraform-plugin-sdk/v2 | ||
- github.com/hashicorp/terraform-plugin-log/tflog | ||
- github.com/hashicorp/go-cty/cty | ||
deny: | ||
- pkg: reflect | ||
desc: Please don't use reflect package | ||
utils: | ||
files: | ||
- "**/pkg/utils/**.go" | ||
allow: | ||
- "$gostd" | ||
- github.com/iancoleman/orderedmap | ||
deny: | ||
- pkg: reflect | ||
desc: Please don't use reflect package | ||
test: | ||
files: | ||
- "$test" | ||
- "**/pkg/qip/test/*.go" | ||
allow: | ||
- $gostd | ||
- github.com/Vitesco-Technologies/terraform-provider-qip | ||
- github.com/hashicorp/terraform-plugin-sdk/v2 | ||
- github.com/stretchr/testify | ||
- github.com/jarcoal/httpmock | ||
deny: | ||
- pkg: reflect | ||
desc: Please don't use reflect package | ||
goheader: | ||
template: |- | ||
Copyright {{ YEAR }} Vitesco Technologies Group AG | ||
SPDX-License-Identifier: Apache-2.0 | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
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,46 @@ | ||
# Visit https://goreleaser.com for documentation on how to customize this | ||
# behavior. | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' | ||
goos: | ||
- windows | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- '386' | ||
- 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: | ||
# - "--batch" | ||
# - "--local-user" | ||
# - "{{ .Env.GPG_FINGERPRINT }}" | ||
# - "--output" | ||
# - "${signature}" | ||
# - "--detach-sign" | ||
# - "${artifact}" | ||
# release: | ||
# extra_files: | ||
# - glob: 'signkey.asc' | ||
# - glob: 'terraform-registry-manifest.json' | ||
# name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' |
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,25 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
exclude: ^docs/ | ||
- id: end-of-file-fixer | ||
exclude: ^docs/ | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
|
||
- repo: https://github.com/golangci/golangci-lint | ||
rev: v1.54.2 | ||
hooks: | ||
- id: golangci-lint | ||
|
||
- repo: local | ||
hooks: | ||
- id: go-generate | ||
name: go generate | ||
language: system | ||
entry: go generate ./... | ||
pass_filenames: false |
Oops, something went wrong.