Skip to content

Commit

Permalink
Upgrade to latest provider schema SDK (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo authored Dec 31, 2022
1 parent eb94269 commit 2d7e9ce
Show file tree
Hide file tree
Showing 2,558 changed files with 673 additions and 810,180 deletions.
3 changes: 0 additions & 3 deletions .github/lock.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/reaction.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Release'

on:
push:
tags:
- 'v*'
jobs:
goreleaser:
runs-on: 'ubuntu-latest'

steps:
- uses: 'actions/checkout@v3'
with:
fetch-depth: 0

- uses: 'actions/setup-go@v3'
with:
go-version: '1.18'

- id: import_gpg
uses: 'crazy-max/ghaction-import-gpg@v5.2.0'
with:
gpg_private_key: '${{ secrets.GPG_PRIVATE_KEY }}'
passphrase: '${{ secrets.GPG_PASSPHRASE }}'

- uses: 'goreleaser/goreleaser-action@v3'
with:
version: 'latest'
args: 'release --rm-dist'
env:
GPG_FINGERPRINT: '${{ steps.import_gpg.outputs.fingerprint }}'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Test'

on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
workflow_dispatch:

concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
test:
runs-on: 'ubuntu-latest'

steps:
- uses: 'actions/checkout@v3'

- uses: 'actions/setup-go@v3'
with:
go-version: '1.18'

- run: 'go mod download'

- run: 'make test-acc'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ build/
dist/

examples/**/.ssh
examples/**/*.txt
65 changes: 38 additions & 27 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,60 @@
before:
hooks:
- go mod tidy
- 'go mod tidy'

builds:
- env:
- CGO_ENABLED=0
- 'CGO_ENABLED=0'
- 'GO111MODULE=on'
- 'GOPROXY=https://proxy.golang.org,direct'
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
- '-a'
- '-trimpath'
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
- '-s'
- '-w'
- '-X=main.Version={{ .Version }}'
- '-X=main.Commit={{ .Commit }}'
- '-extldflags=-static'
goos:
- freebsd
- windows
- linux
- darwin
- 'freebsd'
- 'windows'
- 'linux'
- 'darwin'
goarch:
- amd64
- '386'
- arm
- arm64
- 'amd64'
- 'arm'
- 'arm64'
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'

archives:
- format: zip
- format: 'zip'
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'

checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
algorithm: 'sha256'

signs:
- artifacts: checksum
- artifacts: 'checksum'
args:
# if you are using this is a GitHub action or some other automated pipeline, you
# need to pass the batch flag to indicate its not interactive.
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"
release:
# Visit your project's GitHub Releases page to publish this release.
draft: true
- '--batch'
- '--local-user'
- '{{ .Env.GPG_FINGERPRINT }}'
- '--output'
- '${signature}'
- '--detach-sign'
- '${artifact}'

changelog:
skip: true
use: 'github'
sort: 'asc'

release:
draft: false
mode: 'replace'
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

43 changes: 6 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,47 +1,16 @@
NAME=terraform-provider-filesystem
GOOSES = darwin linux windows
GOARCHES = amd64

export GO111MODULE = on
export GOFLAGS = -mod=vendor

deps:
@go get -mod=" -u -t ./...
@go mod tidy
@go mod vendor
.PHONY: deps

dev:
@go install ./...
.PHONY: dev

build:
@rm -rf build/
@for GOOS in ${GOOSES}; do \
for GOARCH in ${GOARCHES}; do \
echo "Building $${GOOS}/$${GOARCH}" ; \
GOOS=$${GOOS} GOARCH=$${GOARCH} go build \
-a \
-ldflags "-s -w -extldflags 'static'" \
-installsuffix cgo \
-tags netgo \
-o build/$${GOOS}_$${GOARCH}/${NAME} \
. ; \
done ; \
done
.PHONY: build

compress:
@for dir in $$(find build/* -type d); do \
f=$$(basename $$dir) ; \
tar -C build -czf build/$$f.tgz $$f ; \
done
.PHONY: compress
generate:
@rm -rf docs/
@go generate ./...
.PHONY: generate

test:
@go test -short -parallel=40 ./...
@go test -count=1 -shuffle=on -short ./...
.PHONY: test

test-acc:
@go test -parallel=40 -count=1 ./...
@TF_ACC=1 go test -count=1 -shuffle=on -race ./...
.PHONY: test-acc
34 changes: 0 additions & 34 deletions cloudbuild.yaml

This file was deleted.

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

# filesystem Provider



## Example Usage

```terraform
provider "filesystem" {}
```

<!-- schema generated by tfplugindocs -->
## Schema
57 changes: 57 additions & 0 deletions docs/resources/file_reader.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "filesystem_file_reader Resource - terraform-provider-filesystem"
subcategory: ""
description: |-
Reads a file on disk as a resource.
---

# filesystem_file_reader (Resource)

Reads a file on disk as a resource.

## Example Usage

```terraform
// Assume that "file.txt" does not exist at the start of the run. Perhaps
// there's another resource that creates the file as part of the Terraform run.
// As such, `${file("...")}` would not work as it resolves at the start of the
// run.
resource "null_resource" "pretend" {
provisioner "local-exec" {
command = "echo 'hello' > ${path.module}/file.txt"
}
}
resource "filesystem_file_reader" "read" {
path = "${path.module}/file.txt"
depends_on = ["null_resource.pretend"]
}
output "contents" {
value = filesystem_file_reader.read.contents
}
```

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

### Required

- `path` (String) Path to read the file on disk

### Optional

- `root` (String) Path to the root of the module

### Read-Only

- `contents` (String, Sensitive) Raw file contents
- `id` (String) The ID of this resource.
- `mode` (String) File mode bits
- `name` (String) Basename of the file
- `size` (Number) Size of the file in bytes


Loading

0 comments on commit 2d7e9ce

Please sign in to comment.