Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
qboileau committed Sep 18, 2024
0 parents commit 613cd33
Show file tree
Hide file tree
Showing 79 changed files with 8,410 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CONDUKTOR_CONSOLE_IMAGE=conduktor/conduktor-console:1.27.0
CONDUKTOR_CONSOLE_CORTEX_IMAGE=conduktor/conduktor-console-cortex:1.27.0
CDK_BASE_URL=http://localhost:8080
CDK_ADMIN_EMAIL=[email protected]
CDK_ADMIN_PASSWORD=test
CDK_DEBUG=false
TF_LOG_PROVIDER_CONDUKTOR=INFO
8 changes: 8 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

echo "Run fmt"
make go-fmt

echo
echo "Run linters"
make go-lint
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @conduktor/engineering
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# See GitHub's documentation for more information on this file:
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
67 changes: 67 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"

version-resolver:
major:
labels:
- "major"
minor:
labels:
- "minor"
patch:
labels:
- "patch"
default: minor

categories:
- title: "Features"
label: "enhancement"
- title: "Bug Fixes"
label: "bug"
- title: "Module updates"
label: "module-upgrade"
- title: "Dependency updates"
label: "dependencies"

exclude-labels:
- "skip"

autolabeler:
- label: "module-upgrade"
title:
- '/\[Bump\].*\[version\]/'
branch:
- "/update_.+/"
- label: "bug"
title:
- '/.*\[fix\].*/'
- label: "patch"
title:
- '/.*\[fix\].*/'
- label: "enhancement"
title:
- '/.*\[feat\].*/'
- label: "minor"
title:
- '/.*\[feat\].*/'
- label: "skip"
title:
- '/.*\[skip\].*/'
- label: "major"
title:
- '/.*\[breaking\].*/'

replacers:
- search: '/\[feat\]/g'
replace: ""
- search: '/\[fix\]/g'
replace: ""
- search: '/\[skip\]/g'
replace: ""
- search: '/\[breaking\]/g'
replace: ""

template: |
# What's Changed
$CHANGES
17 changes: 17 additions & 0 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release Drafter

on:
push:
branches:
- main

pull_request:
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Terraform Provider release workflow.
name: Release

# This GitHub action creates a release when a tag that matches the pattern
# "v*" (e.g. v0.1.0) is created.
on:
push:
tags:
- "v*"

# Releases need permissions to read and write the repository contents.
# GitHub considers creating releases and uploading assets as writing contents.
permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
id: import_gpg
with:
gpg_private_key: ${{ secrets.CONDUKTOR_BOT_GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
args: release --clean
env:
# GitHub sets the GITHUB_TOKEN secret automatically.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
117 changes: 117 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Terraform Provider testing workflow.
name: Tests

# This GitHub action runs your tests for each pull request and push.
# Optionally, you can turn it on using a schedule for regular testing.
on:
pull_request:
paths-ignore:
- "README.md"
push:
branches:
- main
paths-ignore:
- "README.md"

# Testing only needs permissions to read the repository contents.
permissions:
contents: read

jobs:
# Ensure project builds before running testing matrix
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true
- run: go mod download
- run: go build -v .
- name: Run linters
uses: golangci/golangci-lint-action@v6
with:
version: latest

generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true
- uses: hashicorp/[email protected]
with:
terraform_version: "1.9.5"
terraform_wrapper: false
- run: go generate ./...
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
# Run acceptance tests in a matrix with Terraform CLI versions
test:
name: Terraform Provider Acceptance Tests
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
# list whatever Terraform versions here you would like to support
terraform:
- version: "1.0.*"
name: "TF-1.0"
- version: "1.9.*"
name: "TF-1.9"
console:
- "1.25.0"
- "1.26.0"
- "1.27.0"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true
- uses: hashicorp/[email protected]
with:
terraform_version: ${{ matrix.terraform.version }}
terraform_wrapper: false
- run: go mod download
- run: make pull_test_assets
timeout-minutes: 10
- name: Set License if not dependabot
run: |
if [ "${{ github.actor }}" != "dependabot[bot]" ]; then
echo "CDK_LICENSE=${{ secrets.TEST_LICENSE }}" >> "$GITHUB_ENV"
fi
- name: Run acceptance tests
env:
TF_ACC: "1"
TESTARGS: "-cover ./internal/provider/"
CONDUKTOR_CONSOLE_IMAGE: conduktor/conduktor-console:${{ matrix.console }}
CONDUKTOR_CONSOLE_CORTEX_IMAGE: conduktor/conduktor-console-cortex:${{ matrix.console }}
CDK_BASE_URL: http://localhost:8080
CDK_ADMIN_EMAIL: [email protected]
CDK_ADMIN_PASSWORD: test
TF_LOG_PROVIDER_CONDUKTOR: DEBUG
timeout-minutes: 15
run: |
# empty env to avoid any conflict with the current env
echo "" > .env
make testacc
- uses: actions/upload-artifact@v4
if: always()
with:
name: api-logs-CDK-${{ matrix.console }}-${{ matrix.terraform.name }}
path: ./logs/
if-no-files-found: error
retention-days: 1
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
*.dll
*.exe
.DS_Store
example.tf
terraform.tfplan
terraform.tfstate
bin/
dist/
modules-dev/
/pkg/
website/.vagrant
website/.bundle
website/build
website/node_modules
.vagrant/
*.backup
./*.tfstate
.terraform/
*.log
*.bak
*~
.*.swp
.idea
*.iml
*.test
*.iml
.envrc
logs/*

website/vendor

# Test exclusions
!command/test-fixtures/**/*.tfstate
!command/test-fixtures/**/.terraform/

# Keep windows files with windows line endings
*.winfile eol=crlf

# ingore binary build
terraform-provider-conduktor
27 changes: 27 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Visit https://golangci-lint.run/ for usage documentation
# and information on other useful linters
issues:
max-per-linter: 0
max-same-issues: 0

linters:
disable-all: true
enable:
- durationcheck
- errcheck
- copyloopvar
- forcetypeassert
- godot
- gofmt
- gosimple
- ineffassign
- makezero
- misspell
- nilerr
- predeclared
- staticcheck
- tenv
- unconvert
- unparam
- unused
- govet
Loading

0 comments on commit 613cd33

Please sign in to comment.