-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Goreleaser + installer + readme update + fixes
- Loading branch information
Bishwa Shrestha
committed
Dec 2, 2019
1 parent
cb97407
commit c71eb0b
Showing
11 changed files
with
134 additions
and
174 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 |
---|---|---|
|
@@ -10,3 +10,5 @@ | |
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
/dist |
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,28 @@ | ||
# This is an example goreleaser.yaml file with some sane defaults. | ||
# Make sure to check the documentation at http://goreleaser.com | ||
before: | ||
hooks: | ||
# you may remove this if you don't use vgo | ||
- go mod tidy | ||
# you may remove this if you don't need go generate | ||
- go generate ./... | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' |
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,2 +1,37 @@ | ||
# terraform-provider-rdsdataservice | ||
Manage Postgres db resources using the AWS Data API - Heavily inspired by terraform-provider-postgresql | ||
Manage Postgres db resources using the AWS Data API - Heavily inspired by [terraform-provider-postgresql] (https://github.com/terraform-providers/terraform-provider-postgresql) | ||
|
||
## Requirements ## | ||
Terraform 0.12+ | ||
Go 1.13 (to build the provider plugin) | ||
|
||
## Install ## | ||
|
||
You will need to install the binary as a [terraform third party plugin](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins). Terraform will then pick up the binary from the local filesystem when you run `terraform init`. | ||
|
||
```sh | ||
curl -s https://raw.githubusercontent.com/awsiv/terraform-provider-rdsdataservice/master/install.sh | bash | ||
``` | ||
|
||
## Usage ## | ||
|
||
```terraform | ||
provider "rdsdataservice" { | ||
version = "1.0.0" | ||
region = var.aws_region | ||
profile = var.aws_profile | ||
} | ||
resource "rdsdataservice_postgres_database" "test" { | ||
name = "test" | ||
resource_arn = var.db_arn | ||
secret_arn = var.secret_arn | ||
owner = "postgres" | ||
} | ||
resource "rdsdataservice_postgres_role" "test" { | ||
name = "test" | ||
resource_arn = var.db_arn | ||
secret_arn = var.secret_arn | ||
login = 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
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,46 @@ | ||
arch=$(uname -m) | ||
case $arch in | ||
x86_64) | ||
ARCH=amd64 | ||
;; | ||
i386) | ||
ARCH=386 | ||
;; | ||
*) | ||
echo "no build for this architecture: $arch" | ||
exit 1 | ||
esac | ||
|
||
kernel=$(uname -s) | ||
if [ $kernel != "Darwin" ] && [ $kernel != "Linux" ]; then | ||
echo "no build for this kernel: $kernel" | ||
exit 1 | ||
fi | ||
|
||
kernel_lower=$(echo $kernel | tr "[:upper:]" "[:lower:]") | ||
terraform_plugins="$HOME/.terraform.d/plugins/${kernel_lower}_$ARCH/" | ||
|
||
# IFS= preserve newlines | ||
IFS= manifest=$(curl -s https://api.github.com/repos/awsiv/terraform-provider-rdsdataservice/releases/latest) | ||
|
||
url=$(echo $manifest \ | ||
| grep "browser_download_url.*${kernel}_${arch}" \ | ||
| cut -d '"' -f 4 \ | ||
) | ||
version=$(echo $manifest \ | ||
| grep tag_name \ | ||
| cut -d '"' -f 4 \ | ||
) | ||
|
||
if [ -z ${url} ]; then | ||
echo "no build for this kernel/arch: ${kernel}_${arch}" | ||
exit 1 | ||
fi | ||
|
||
dest_file="terraform-provider-rdsdataservice_$version" | ||
curl $url -L -o $dest_file | ||
chmod +x $dest_file | ||
|
||
mkdir -p $terraform_plugins | ||
mv $dest_file $terraform_plugins/ | ||
|
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,4 @@ | ||
version=v1.0.0 | ||
git tag -a $version -m $version | ||
git push origin $version | ||
goreleaser release --rm-dist |
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