Skip to content

Commit

Permalink
update ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
pmenglund committed Apr 6, 2024
1 parent d2ed882 commit 8aaf718
Show file tree
Hide file tree
Showing 38 changed files with 189 additions and 56 deletions.
29 changes: 12 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,36 @@ workflows:
jobs:
validate:
docker:
- image: cimg/go:1.20
- image: cimg/go:1.21
steps:
- checkout
- run:
name: Install python
command: sudo apt update && sudo apt install python3 python3-pip
- run:
name: Install terraform
command: wget -q -O terraform.zip https://releases.hashicorp.com/terraform/1.3.2/terraform_1.3.2_linux_amd64.zip && unzip -d $HOME/bin terraform.zip
command: wget -q -O terraform.zip https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_linux_amd64.zip && unzip -d $HOME/bin terraform.zip
- run:
name: Install tfplugindocs
command: go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
- run:
name: Install pre-commit
command: pip install pre-commit
- run:
name: Run pre-commit
command: pre-commit run --all-files
- run:
name: Install tfplugindocs
command: wget -q -O tfplugindocs.zip https://github.com/hashicorp/terraform-plugin-docs/releases/download/v0.14.1/tfplugindocs_0.14.1_linux_amd64.zip && unzip -n tfplugindocs.zip tfplugindocs -d $HOME/bin
- run:
name: Generate documentation
command: tfplugindocs generate
- run:
name: Check if there are uncommitted document changes
command: git diff --exit-code ./docs || echo "must run tfplugindocs before committing"
- run:
name: 'TODO: add unit tests'
command: 'echo "TODO: add unit tests"'
release:
docker:
- image: cimg/go:1.20
- image: cimg/go:1.21
steps:
- checkout
- run:
name: "Import GPG Key and Test Signing"
command: |
echo GPG_TTY=$(tty)
export GPG_TTY=$(tty)
echo "$GPG_PRIVATE_KEY" | base64 -d > key.pem
echo "$PASSPHRASE" | gpg --batch --import ./key.pem
rm key.pem
Expand All @@ -71,24 +65,25 @@ jobs:
name: "Publish Release on GitHub"
no_output_timeout: 30m
command: |
export GPG_TTY=$(tty)
curl -sL https://git.io/goreleaser | bash
test:
docker:
- image: cimg/go:1.20
- image: cimg/go:1.21
steps:
- checkout
- run:
name: Terraform Unit Tests
command: go test -v ./rockset/*
command: go test -v ./...
acceptance:
docker:
- image: cimg/go:1.20
- image: cimg/go:1.21
steps:
- checkout
- run:
name: Terraform Acceptance Tests
no_output_timeout: 40m
command: go test -race -cover -coverprofile=$HOME/cover.out -timeout 40m -v ./rockset/*
command: go test -race -cover -coverprofile=$HOME/cover.out -timeout 40m -v ./...
environment:
TF_ACC: true
- run:
Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@ repos:
pass_filenames: false
additional_dependencies: []
minimum_pre_commit_version: 2.9.2
- id: docs
name: "tfplugindocs"
entry: "tfplugindocs"
args: ["generate", "--provider-name", "rockset"]
language: system
'types_or': [go]
pass_filenames: false
always_run: true
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ Running acceptance tests creates real resources. Some acceptance tests may use f

To run all tests:
```
TF_ACC=true go test -timeout 40m ./rockset/*
TF_ACC=true go test -timeout 40m ./...
```

To run all tests with debug output:
```
TF_ACC=true go test -timeout 40m -v ./rockset/*
TF_ACC=true go test -timeout 40m -v ./...
```

To run a specific test:
```
TF_ACC=true go test -timeout 40m -v ./rockset/* -run TestAccS3Collection_Basic
TF_ACC=true go test -timeout 40m -v ./... -run TestAccS3Collection_Basic
```

You may want to run tests with local changes in a dependency, such as in the [Rockset Go Client](https://github.com/rockset/rockset-go-client). (For example, you may be adding a field in both the Rockset Go client and the Terraform Provider) Use the `replace` keyword in the `go.mod` file to use the local version of the dependency instead.
Expand Down Expand Up @@ -157,7 +157,12 @@ If the above is all done correctly you are now able to run `terraform init`.
It will see the provider in the folder and treat it as if it's already downloaded.

## Release Steps

To create a new release

- Merge branch to master
- On master branch create new tag: `git tag v{version_number}`
- Push tag: `git push origin v{version_number}`
Pushing the tag should trigger circle ci to create a draft release and build all necesary assets. Then you can navigate to github and publish the release.

Pushing the tag triggers circle ci to create a draft release and build all necessary assets.
Then you can navigate to [github](https://github.com/rockset/terraform-provider-rockset/releases) and publish the release.
2 changes: 1 addition & 1 deletion docs/data-sources/account.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_account Data Source - terraform-provider-rockset"
page_title: "rockset_account Data Source - rockset"
subcategory: ""
description: |-
Gets information about the Rockset deployment for the specified api server.
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/collection_source.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_collection_source Data Source - terraform-provider-rockset"
page_title: "rockset_collection_source Data Source - rockset"
subcategory: ""
description: |-
Rockset collection source data source
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/query_lambda.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_query_lambda Data Source - terraform-provider-rockset"
page_title: "rockset_query_lambda Data Source - rockset"
subcategory: ""
description: |-
Gets information about a query lambda. The tag defaults to latest.
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/query_lambda_tag.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_query_lambda_tag Data Source - terraform-provider-rockset"
page_title: "rockset_query_lambda_tag Data Source - rockset"
subcategory: ""
description: |-
Deprecated. Use rockset_query_lambda instead and specify the tag.
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/user.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_user Data Source - terraform-provider-rockset"
page_title: "rockset_user Data Source - rockset"
subcategory: ""
description: |-
This data source can be used to fetch information about a specific user.
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/virtual_instance.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_virtual_instance Data Source - terraform-provider-rockset"
page_title: "rockset_virtual_instance Data Source - rockset"
subcategory: ""
description: |-
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/workspace.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_workspace Data Source - terraform-provider-rockset"
page_title: "rockset_workspace Data Source - rockset"
subcategory: ""
description: |-
Gets information about a workspace.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/alias.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_alias Resource - terraform-provider-rockset"
page_title: "rockset_alias Resource - rockset"
subcategory: ""
description: |-
Manages an alias for a set of collections.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/api_key.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_api_key Resource - terraform-provider-rockset"
page_title: "rockset_api_key Resource - rockset"
subcategory: ""
description: |-
Manage a Rockset Api Key.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/autoscaling_policy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_autoscaling_policy Resource - terraform-provider-rockset"
page_title: "rockset_autoscaling_policy Resource - rockset"
subcategory: ""
description: |-
Manages the auto-scaling policy for the main Virtual Instance.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/collection.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_collection Resource - terraform-provider-rockset"
page_title: "rockset_collection Resource - rockset"
subcategory: ""
description: |-
Manages a basic collection with no sources. Usually used for the write api.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/collection_mount.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_collection_mount Resource - terraform-provider-rockset"
page_title: "rockset_collection_mount Resource - rockset"
subcategory: ""
description: |-
Manages a collection mount.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/dynamodb_collection.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_dynamodb_collection Resource - terraform-provider-rockset"
page_title: "rockset_dynamodb_collection Resource - rockset"
subcategory: ""
description: |-
Manages a collection with an DynamoDB source attached.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/dynamodb_integration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_dynamodb_integration Resource - terraform-provider-rockset"
page_title: "rockset_dynamodb_integration Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset DynamoDB Integration.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/gcs_collection.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_gcs_collection Resource - terraform-provider-rockset"
page_title: "rockset_gcs_collection Resource - rockset"
subcategory: ""
description: |-
Manages a collection with an GCS source attached.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/gcs_integration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_gcs_integration Resource - terraform-provider-rockset"
page_title: "rockset_gcs_integration Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset GCS Integration.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/kafka_collection.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_kafka_collection Resource - terraform-provider-rockset"
page_title: "rockset_kafka_collection Resource - rockset"
subcategory: ""
description: |-
Manages a collection created from a Kafka source. The use_v3 field must match the integration which the collection is created from.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/kafka_integration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_kafka_integration Resource - terraform-provider-rockset"
page_title: "rockset_kafka_integration Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset Kafka Integration.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/kinesis_collection.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_kinesis_collection Resource - terraform-provider-rockset"
page_title: "rockset_kinesis_collection Resource - rockset"
subcategory: ""
description: |-
Manages a collection with an Kinesis source attached.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/kinesis_integration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_kinesis_integration Resource - terraform-provider-rockset"
page_title: "rockset_kinesis_integration Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset Kinesis Integration.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/mongodb_collection.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_mongodb_collection Resource - terraform-provider-rockset"
page_title: "rockset_mongodb_collection Resource - rockset"
subcategory: ""
description: |-
Manages a collection with an MongoDB source attached.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/mongodb_integration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_mongodb_integration Resource - terraform-provider-rockset"
page_title: "rockset_mongodb_integration Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset MongoDB Integration.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/query_lambda.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_query_lambda Resource - terraform-provider-rockset"
page_title: "rockset_query_lambda Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset Query Lambda.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/query_lambda_tag.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_query_lambda_tag Resource - terraform-provider-rockset"
page_title: "rockset_query_lambda_tag Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset Query Lambda Tag.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/role.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_role Resource - terraform-provider-rockset"
page_title: "rockset_role Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset Role https://rockset.com/docs/iam/.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/s3_collection.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_s3_collection Resource - terraform-provider-rockset"
page_title: "rockset_s3_collection Resource - rockset"
subcategory: ""
description: |-
Manages a collection with on or more S3 sources attached. Uses an S3 integration to access the S3 bucket. If no integration is provided, only data in public buckets are accessible.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/s3_integration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_s3_integration Resource - terraform-provider-rockset"
page_title: "rockset_s3_integration Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset S3 Integration.
Expand Down
37 changes: 37 additions & 0 deletions docs/resources/scheduled_lambda.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_scheduled_lambda Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset scheduled lambda, a query lambda that is automatically executed on a schedule.
---

# rockset_scheduled_lambda (Resource)

Manages a Rockset scheduled lambda, a query lambda that is automatically executed on a schedule.



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

### Required

- `apikey` (String, Sensitive) The apikey to use when triggering execution of the associated query lambda.
- `cron_string` (String) The UNIX-formatted cron string for this scheduled query lambda.
- `query_lambda_name` (String) The name of the QL to use for scheduled execution.
- `workspace` (String) Workspace name.

### Optional

- `tag` (String) The QL tag to use for scheduled execution.
- `total_times_to_execute` (Number) The number of times to execute this scheduled query lambda. Once this scheduled query lambda has been executed this many times, it will no longer be executed.
- `version` (String) The version of the QL to use for scheduled execution.
- `webhook_auth_header` (String, Sensitive) The value to use as the authorization header when hitting the webhook.
- `webhook_payload` (String) The payload that should be sent to the webhook. JSON format.
- `webhook_url` (String) The URL of the webhook that should be triggered after this scheduled query lambda completes.

### Read-Only

- `id` (String) The ID of this resource.
- `rrn` (String) RRN of this Scheduled Lambda.
2 changes: 1 addition & 1 deletion docs/resources/user.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_user Resource - terraform-provider-rockset"
page_title: "rockset_user Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset User.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/view.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rockset_view Resource - terraform-provider-rockset"
page_title: "rockset_view Resource - rockset"
subcategory: ""
description: |-
Manages a Rockset view.
Expand Down
Loading

0 comments on commit 8aaf718

Please sign in to comment.