-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from invidian/improvements
Improvements
- Loading branch information
Showing
10 changed files
with
552 additions
and
150 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,9 @@ | ||
## 0.2.0 (June 15, 2019) | ||
|
||
* Add Terraform 0.12 compatibility | ||
* Restructure code to standard layout | ||
* Add Makefile to document common tasks | ||
|
||
## 0.1.0 (April 12, 2019) | ||
|
||
* Initial release |
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,50 @@ | ||
# Go parameters | ||
GOCMD=go | ||
GOBUILD=$(GOCMD) build | ||
GOCLEAN=$(GOCMD) clean | ||
GOTEST=$(GOCMD) test | ||
GOGET=$(GOCMD) get | ||
GOMOD=$(GOCMD) mod | ||
|
||
# Terraform parameters | ||
PROVIDER_NAME=terraform-provider-gpg | ||
PROVIDER_VERSION=`git describe --tags --always | cut -d"-" -f1` | ||
PROTOCOL_VERSION=x4 | ||
BINARY_NAME=$(PROVIDER_NAME)_$(PROVIDER_VERSION)_$(PROTOCOL_VERSION) | ||
|
||
# Output parameters | ||
OUTPUT_DIRECTORY=`pwd` | ||
OUTPUT_FILE=$(OUTPUT_DIRECTORY)/$(BINARY_NAME) | ||
|
||
# Build parameters | ||
CGO_ENABLED=0 | ||
LD_FLAGS="-extldflags '-static'" | ||
|
||
all: test build lint | ||
|
||
test: | ||
$(GOTEST) -v ./... | ||
|
||
build: | ||
CGO_ENABLED=$(CGO_ENABLED) $(GOBUILD) -o $(OUTPUT_FILE) -v -buildmode=exe -ldflags $(LD_FLAGS) | ||
|
||
lint: | ||
which golangci-lint 2>&1 >/dev/null && golangci-lint run || echo "'golangci-lint' binary not found, skipping linting." | ||
|
||
clean: | ||
$(GOCLEAN) | ||
rm -f $(OUTPUT_FILE) || true | ||
rm -f $(OUTPUT_FILE).sig || true | ||
|
||
update: | ||
$(GOGET) -u | ||
$(GOMOD) tidy | ||
|
||
# TODO Add GitHub integration | ||
release: all pack sign | ||
|
||
pack: | ||
which upx 2>&1 >/dev/null && upx --brute $(OUTPUT_FILE) || echo "'upx' binary not found, skipping packing." | ||
|
||
sign: | ||
gpg --output $(OUTPUT_FILE).sig --detach-sig $(OUTPUT_FILE) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package gpg | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform/helper/schema" | ||
"github.com/hashicorp/terraform/terraform" | ||
) | ||
|
||
var testProviders map[string]terraform.ResourceProvider | ||
|
||
func init() { | ||
testProviders = map[string]terraform.ResourceProvider{ | ||
"gpg": Provider(), | ||
} | ||
} | ||
|
||
func TestProvider(t *testing.T) { | ||
if err := Provider().(*schema.Provider).InternalValidate(); err != nil { | ||
t.Fatalf("err: %s", err) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
resource_gpg_encrypted_message.go → gpg/resource_gpg_encrypted_message.go
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,4 +1,4 @@ | ||
package main | ||
package gpg | ||
|
||
import ( | ||
"bytes" | ||
|
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 @@ | ||
package gpg |
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 was deleted.
Oops, something went wrong.