Skip to content

Commit

Permalink
Tidy up a few points of feedback - thanks @rberlind
Browse files Browse the repository at this point in the history
  • Loading branch information
DRuggeri committed Aug 9, 2018
1 parent f53b814 commit 1e54fcb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test.log
terraform.tfstate
terraform.tfstate.backup
crash.log
examples/terrform*
examples/terraform*
**/github_api_token
**/release_info.md
scripts/terraform-provider-restapi*
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Have a look at the [examples directory](examples) for some use cases
- `insecure` (boolean, optional): When using https, this disables TLS verification of the host.
- `username` (string, optional): When set, will use this username for BASIC auth to the API.
- `password` (string, optional): When set, will use this password for BASIC auth to the API.
- `headers` (hash of strings, optional): A map of header names and values to set on all outbound requests. This is useful if you want to use a script via the 'external' provider or provide a pre-approved token. If `username` and `password` are set and Authorization is one of the headers defined here, the BASIC auth credentials take precedence.
- `headers` (hash of strings, optional): A map of header names and values to set on all outbound requests. This is useful if you want to use a script via the 'external' provider or provide a pre-approved token or change Content-Type from `application/json`. If `username` and `password` are set and Authorization is one of the headers defined here, the BASIC auth credentials take precedence.
- `timeout` (integer, optional): When set, will cause requests taking longer than this time (in seconds) to be aborted. Default is `0` which means no timeout is set.
- `id_attribute` (string, optional): When set, this key will be used to operate on REST objects. For example, if the ID is set to 'name', changes to the API object will be to `http://foo.com/bar/VALUE_OF_NAME`.
- `copy_keys` (array of strings, optional): When set, any `PUT` to the API for an object will copy these keys from the data the provider has gathered about the object. This is useful if internal API information must also be provided with updates, such as the revision of the object.
Expand Down Expand Up @@ -59,4 +59,4 @@ This provider also exports the following parameters:
## Installation
There are two standard methods of installing this provider detailed [in Terraform's documentation](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins). You can place the file in the directory of your .tf file in `terraform.d/plugins/{OS}_{ARCH}/` or place it in your home directory at `~/.terraform.d/plugins/{OS}_{ARCH}/`

The released binaries are named `terraform-provider-restapi-vX.Y.Z-{OS}-{ARCH}` so you know which binary to install. Be sure to rename the binary you use during installation to just `terraform-provider-restapi-vX.Y.Z`.
The released binaries are named `terraform-provider-restapi_vX.Y.Z-{OS}-{ARCH}` so you know which binary to install. You *may* need to rename the binary you use during installation to just `terraform-provider-restapi_vX.Y.Z`.
2 changes: 1 addition & 1 deletion restapi/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Provider() terraform.ResourceProvider {
Type: schema.TypeMap,
Elem: schema.TypeString,
Optional: true,
Description: "A map of header names and values to set on all outbound requests. This is useful if you want to use a script via the 'external' provider or provide a pre-approved token. If `username` and `password` are set and Authorization is one of the headers defined here, the BASIC auth credentials take precedence.",
Description: "A map of header names and values to set on all outbound requests. This is useful if you want to use a script via the 'external' provider or provide a pre-approved token or change Content-Type from `application/json`. If `username` and `password` are set and Authorization is one of the headers defined here, the BASIC auth credentials take precedence.",
},
"timeout": &schema.Schema{
Type: schema.TypeInt,
Expand Down
17 changes: 7 additions & 10 deletions scripts/create-github-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,13 @@ if [[ ! -f release_info.md ]];then
fi

release_info=$(cat release_info.md)
set +e
read -r -d '' RELEASE_JSON <<EOF
{
"tag_name": "$tag",
"name": "$tag",
"body": "$release_info",
"draft": $draft
}
EOF
set -e
JSON_STRING=$(jq --arg notes "$release_info"
RELEASE_JSON=$(jq -n \
--arg tag "$tag" \
--arg name "$tag" \
--arg body "$release_info" \
'{ "tag_name": $tag, "name": $name, "body": $body, "draft": '$draft'}'
)
# Send the data
response=$(curl -sH "$AUTH" "$GH_REPO/releases" -X POST -d "$RELEASE_JSON")
Expand Down
4 changes: 2 additions & 2 deletions scripts/do_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [[ -z "$github_api_token" || -z "$owner" || -z "$repo" || -z "$tag" ]];then
exit 1
fi

if [[ "$tag" != "v*" ]];then
if [[ "$tag" != v* ]];then
tag="v$tag"
fi

Expand All @@ -44,7 +44,7 @@ for GOOS in darwin linux windows;do
for GOARCH in "386" amd64;do
export GOOS GOARCH

TF_OUT_FILE="terraform-provider-restapi-$tag-$GOOS-$GOARCH"
TF_OUT_FILE="terraform-provider-restapi_$tag-$GOOS-$GOARCH"
echo " $TF_OUT_FILE"
go build -o "$TF_OUT_FILE" ../
ARTIFACTS+=("$TF_OUT_FILE")
Expand Down

0 comments on commit 1e54fcb

Please sign in to comment.