Skip to content

Commit

Permalink
Merge pull request #3 from labd/feat/namespace
Browse files Browse the repository at this point in the history
Feat/namespace
  • Loading branch information
demeyerthom authored Jul 22, 2024
2 parents 986946e + c1f17d3 commit dfe2634
Show file tree
Hide file tree
Showing 34 changed files with 41,469 additions and 760 deletions.
3 changes: 3 additions & 0 deletions .changes/unreleased/Added-20240722-160719.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Added
body: Added namespace resource
time: 2024-07-22T16:07:19.572818707+02:00
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: release
on:
workflow_dispatch:

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true

- name: Import GPG key
id: import_gpg
uses: paultyng/[email protected]
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.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 }}
41 changes: 0 additions & 41 deletions .github/workflows/release.yml

This file was deleted.

28 changes: 4 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,13 @@
# you can turn it on using a cron schedule for regular testing.
#
name: Tests
on:
pull_request:
paths-ignore:
- 'README.md'
push:
paths-ignore:
- 'README.md'
on: [push]

jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- 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)
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -59,12 +39,12 @@ jobs:
pull-requests: write
actions: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Prepare release
uses: labd/changie-release-action@v0.2.0
uses: labd/changie-release-action@v0.3.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
release-workflow: 'release.yaml'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ website/vendor

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

local
11 changes: 11 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
version: '3'

tasks:
dependencies:
cmds:
- go install github.com/bufbuild/buf/cmd/[email protected]
- go install google.golang.org/protobuf/cmd/[email protected]
- go install connectrpc.com/connect/cmd/[email protected]

format:
cmds:
- go fmt ./...
- terraform fmt -recursive ./examples

test:
cmds:
Expand All @@ -22,3 +29,7 @@ tasks:
cmds:
- go test -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... ./...
- go tool cover -func=coverage.txt

generate/sdk:
cmds:
- buf generate --path proto/wg/cosmo/common --path proto/wg/cosmo/platform --path proto/wg/cosmo/notifications --path proto/wg/cosmo/node
21 changes: 21 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: v2
managed:
enabled: true
disable:
- file_option: go_package
module: buf.build/googleapis/googleapis
override:
- file_option: go_package_prefix
value: github.com/labd/terraform-provider-wundergraph/sdk
plugins:
- local: protoc-gen-connect-go
out: sdk
opt: paths=source_relative
- local: protoc-gen-go
out: sdk
opt: paths=source_relative
inputs:
- git_repo: https://github.com/wundergraph/cosmo


# https://github.com/wundergraph/cosmo/blob/main/proto/wg/cosmo/platform/v1/platform.proto
30 changes: 0 additions & 30 deletions docs/data-sources/scaffolding_example.md

This file was deleted.

14 changes: 9 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "scaffolding-framework Provider"
page_title: "wundergraph Provider"
subcategory: ""
description: |-
---

# scaffolding-framework Provider
# wundergraph Provider



## Example Usage

```terraform
provider "scaffolding" {
# example configuration here
provider "wundergraph" {
api_key = "<your-api-key>"
# The URL of the WunderGraph API. Default to https://cosmo-cp.wundergraph.com
# api_url = "https://cosmo-cp.wundergraph.com"
}
```

Expand All @@ -23,4 +26,5 @@ provider "scaffolding" {

### Optional

- `endpoint` (String) Example provider attribute
- `api_key` (String) The API key for the provider.
- `api_url` (String) The API URL for the provider.
30 changes: 30 additions & 0 deletions docs/resources/namespace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "wundergraph_namespace Resource - terraform-provider-wundergraph"
subcategory: ""
description: |-
Namespace resource example.
---

# wundergraph_namespace (Resource)

Namespace resource example.

## Example Usage

```terraform
resource "wundergraph_namespace" "my-namespace" {
name = "my-namespace"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The name of the namespace.

### Read-Only

- `id` (String) Example identifier
31 changes: 0 additions & 31 deletions docs/resources/scaffolding_example.md

This file was deleted.

3 changes: 0 additions & 3 deletions examples/data-sources/scaffolding_example/data-source.tf

This file was deleted.

7 changes: 5 additions & 2 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
provider "scaffolding" {
# example configuration here
provider "wundergraph" {
api_key = "<your-api-key>"

# The URL of the WunderGraph API. Default to https://cosmo-cp.wundergraph.com
# api_url = "https://cosmo-cp.wundergraph.com"
}
3 changes: 0 additions & 3 deletions examples/resources/scaffolding_example/resource.tf

This file was deleted.

3 changes: 3 additions & 0 deletions examples/resources/wundergraph_namespace/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "wundergraph_namespace" "my-namespace" {
name = "my-namespace"
}
Loading

0 comments on commit dfe2634

Please sign in to comment.