-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
636 additions
and
277 deletions.
There are no files selected for viewing
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,37 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/[email protected] | ||
- | ||
name: Unshallow | ||
run: git fetch --prune --unshallow | ||
- | ||
name: Set up Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.14 | ||
- | ||
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@v2 | ||
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,40 @@ | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' | ||
goos: | ||
- freebsd | ||
- windows | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- '386' | ||
- arm | ||
- arm64 | ||
ignore: | ||
- goos: darwin | ||
goarch: '386' | ||
binary: '{{ .ProjectName }}_v{{ .Version }}' | ||
archives: | ||
- format: zip | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' | ||
checksum: | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' | ||
algorithm: sha256 | ||
signs: | ||
- artifacts: checksum | ||
args: | ||
- "--batch" | ||
- "--local-user" | ||
- "{{ .Env.GPG_FINGERPRINT }}" | ||
- "--output" | ||
- "${signature}" | ||
- "--detach-sign" | ||
- "${artifact}" | ||
changelog: | ||
skip: true |
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 |
---|---|---|
@@ -1,16 +1,3 @@ | ||
# Terraform Provider for Local Git Repository | ||
|
||
## Usage | ||
|
||
```hcl | ||
data "git_repository" "tf" { | ||
path = "${path.module}" | ||
} | ||
resource "aws_vpc" "main" { | ||
tags = { | ||
git_commit = "${data.git_repository.tf.commit_hash}" | ||
git_branch = "${data.git_repository.tf.branch}" | ||
} | ||
} | ||
``` | ||
[Available in the Terraform Registry](https://registry.terraform.io/providers/paultyng/git/latest) |
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,32 @@ | ||
--- | ||
page_title: "git_repository Data Source - terraform-provider-git" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# Data Source `git_repository` | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "git_repository" "tf" { | ||
path = "${path.module}" | ||
} | ||
``` | ||
|
||
## Schema | ||
|
||
### Optional | ||
|
||
- **id** (String, Optional) The ID of this resource. | ||
- **path** (String, Optional) Path to the .git directory | ||
|
||
### Read-only | ||
|
||
- **branch** (String, Read-only) | ||
- **commit_hash** (String, Read-only) | ||
|
||
|
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,21 @@ | ||
--- | ||
layout: "" | ||
page_title: "Provider: Git" | ||
description: |- | ||
The Git provider provides resources to interact with a local Git repository. | ||
--- | ||
|
||
# Git Provider | ||
|
||
The Git provider provides resources to interact with a local Git repository. Primarily this is useful | ||
for using your current commit hash or tag in resource labeling, etc. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "git_repository" "tf" { | ||
path = "${path.module}" | ||
} | ||
``` | ||
|
||
## Schema |
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,3 @@ | ||
data "git_repository" "tf" { | ||
path = "${path.module}" | ||
} |
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
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
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
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
File renamed without changes.
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/hashicorp/terraform/plugin" | ||
"github.com/paultyng/terraform-provider-git/provider" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin" | ||
|
||
"github.com/paultyng/terraform-provider-git/internal/provider" | ||
) | ||
|
||
func main() { | ||
plugin.Serve(&plugin.ServeOpts{ | ||
ProviderFunc: provider.Provider}) | ||
ProviderFunc: provider.New, | ||
}) | ||
} |
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,17 @@ | ||
--- | ||
layout: "" | ||
page_title: "Provider: Git" | ||
description: |- | ||
The Git provider provides resources to interact with a local Git repository. | ||
--- | ||
|
||
# Git Provider | ||
|
||
The Git provider provides resources to interact with a local Git repository. Primarily this is useful | ||
for using your current commit hash or tag in resource labeling, etc. | ||
|
||
## Example Usage | ||
|
||
{{tffile "examples/data-sources/git_repository/data-source.tf"}} | ||
|
||
{{ .SchemaMarkdown | trimspace }} |
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,7 @@ | ||
// +build tools | ||
|
||
package tools | ||
|
||
import ( | ||
_ "github.com/hashicorp/terraform-plugin-docs/cmd/tfpluginwebsite" | ||
) |