Skip to content

Commit

Permalink
chore: parameterise acceptance pactflow URL (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows authored Mar 16, 2023
1 parent 38d559e commit cef1368
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
PACT_BROKER_TOKEN: "${{ secrets.PACTFLOW_PACT_BROKER_TOKEN }}"
PACT_BROKER_BASE_URL: "${{ secrets.PACTFLOW_PACT_BROKER_BASE_URL }}"
ACCEPTANCE_PACT_BROKER_TOKEN: "${{ secrets.ACCEPTANCE_PACT_BROKER_TOKEN }}"
ACCEPTANCE_PACT_BROKER_BASE_URL: "${{ secrets.ACCEPTANCE_PACT_BROKER_BASE_URL }}"
- uses: actions/upload-artifact@v3
if: failure()
with:
Expand Down
9 changes: 9 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Developer Docs

## Build Environment

* `ACCEPTANCE_PACT_BROKER_BASE_URL` - PactFlow acount FQDN to test the Terraform Acceptance suite against
* `ACCEPTANCE_PACT_BROKER_TOKEN` - PactFlow account API token to test the Terraform Acceptance suite against
* `GPG_PRIVATE_KEY` - GPG Key Registered with Terraform to sign and publish artifacts with
* `PACTFLOW_PACT_BROKER_BASE_URL` - PactFlow account FQDN to publish the pact files to (pacts are not currently verified)
* `PACTFLOW_PACT_BROKER_TOKEN` - PactFlow account API Token to publish the pact files to
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PACT_CLI="docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKE

export TF_VAR_build_number=$(GITHUB_RUN_ID)
export TF_VAR_api_token=$(ACCEPTANCE_PACT_BROKER_TOKEN)
export TF_VAR_broker_base_url=$(ACCEPTANCE_PACT_BROKER_BASE_URL)

ci:: clean docker deps pact-go vet bin test pact publish acceptance-test

Expand Down
6 changes: 5 additions & 1 deletion acceptance/pactflow/pactflow.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ terraform {
### Provider configuration

provider "pact" {
host = "https://tf-acceptance.pactflow.io"
host = var.broker_base_url
access_token = var.api_token
# host = "http://localhost:9292"
}

variable "broker_base_url" {
type = string
}

variable "api_token" {
type = string
}
Expand Down

0 comments on commit cef1368

Please sign in to comment.