Skip to content

Commit

Permalink
Release v1.1.0 (#78)
Browse files Browse the repository at this point in the history
* GH action updates
* Added clarification about importing resources. Fixes issue #76
* More clarifications on provider config, fixes issue #77
* Updated http proxy documentation
  • Loading branch information
bczoma authored Oct 18, 2024
1 parent 329b006 commit 35ac594
Show file tree
Hide file tree
Showing 69 changed files with 683 additions and 248 deletions.
158 changes: 158 additions & 0 deletions .github/workflows/broker-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: Test Provider triggered by a broker build
# Branch naming convention assumes dev branches start with "dev" then semver release name,
# internal QA release candidate branches start with "v" then semver release name.
# broker builds are triggered by Jenkins from a broker release branch with an example pattern of 10.9.1

on:
push:
branches-ignore:
- dev*
- v*
- main

jobs:
build:
name: Build & test provider from broker build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"

- name: Check out code
uses: actions/checkout@v4

- name: Checkout generator
uses: actions/checkout@v4
with:
repository: SolaceDev/broker-terraform-code-generator
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
path: broker-terraform-code-generator
ref: "main"

- name: Build and install generator
run: |
pushd broker-terraform-code-generator
go mod tidy
go install .
ls ~/go/bin
popd
- name: Generate provider code
run: |
SWAGGER_SPEC_NAME=`ls ci/swagger_spec`
echo "Generating code using spec $SWAGGER_SPEC_NAME"
BASE=`pwd`
pushd internal/broker/generated
rm ./*
SEMP_V2_SWAGGER_CONFIG_EXTENDED_JSON="$BASE/ci/swagger_spec/$SWAGGER_SPEC_NAME" ~/go/bin/broker-terraform-code-generator software-provider all
popd
- name: Check changed files
uses: tj-actions/verify-changed-files@v17
id: check-changed-files
with:
files: |
!broker-terraform-code-generator
!version.go
- name: Run step only when no change detected
if: steps.check-changed-files.outputs.files_changed == 'false'
run: |
echo "No changes detected, skipping further steps"
- name: List changed files - from now on all tests are run only if there were changes
if: steps.check-changed-files.outputs.files_changed == 'true'
run: |
echo "Changed files: ${{ steps.check-changed-files.outputs.changed_files }}"
echo ******** Excluding MarkdownDescription:
git diff -I MarkdownDescription
echo ******** Including MarkdownDescription:
git diff
- name: Set up Terraform latest
if: steps.check-changed-files.outputs.files_changed == 'true'
uses: hashicorp/setup-terraform@v2
with:
terraform_wrapper: false

- name: Setup Test broker
if: steps.check-changed-files.outputs.files_changed == 'true'
run: |
mkdir -p $HOME/solace; chmod 777 $HOME/solace
docker run -d -p 8080:8080 -p 55555:55555 --shm-size=1g --env username_admin_globalaccesslevel=admin --env username_admin_password=admin --env system_scaling_maxkafkabridgecount="10" --name=solace \
--mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:latest
while ! curl -s localhost:8080 | grep aurelia ; do sleep 1 ; done
- name: Run acceptance test
if: steps.check-changed-files.outputs.files_changed == 'true'
run: |
make vet
make testacc
- name: Use local provider
if: steps.check-changed-files.outputs.files_changed == 'true'
run: |
echo "
provider_installation {
dev_overrides {
\"registry.terraform.io/solaceproducts/solacebroker\" = \"${HOME}/go/bin\"
}
direct {}
}" > ~/.terraformrc
- name: Build provider
if: steps.check-changed-files.outputs.files_changed == 'true'
run: |
make test-coverage
make install
ls ~/go/bin
terraform-provider-solacebroker -h
- name: Run provider test - create custom messageVPN with large config
if: steps.check-changed-files.outputs.files_changed == 'true'
run: |
pushd ci/broker_vpn_test
# Create
terraform plan
terraform apply -auto-approve
sleep 1
popd
- name: Run generate test - generate complete large config file for custom messageVPN file
if: steps.check-changed-files.outputs.files_changed == 'true'
run: |
SOLACEBROKER_REGISTRY_OVERRIDE=registry.terraform.io/solaceproducts/solacebroker SOLACEBROKER_USERNAME=admin SOLACEBROKER_PASSWORD=admin terraform-provider-solacebroker generate --url=http://localhost:8080 solacebroker_msg_vpn.test test messageVpn.tf
cat messageVpn.tf
- name: Run provider test - delete large config
if: steps.check-changed-files.outputs.files_changed == 'true'
run: |
pushd ci/broker_vpn_test
terraform plan
terraform destroy -auto-approve
sleep 1
popd
- name: Test state upgrade
if: steps.check-changed-files.outputs.files_changed == 'true'
run: |
pushd ci/state_upgrade
bash -c "terraform plan &> results.out" || echo "Expecting terraform plan to fail"
cat results.out | grep "Found deprecated state key 'deprecated_att"
cp terraform.tfstate terraform.tfstate.bak
sed -i '/deprecated_att/d' terraform.tfstate # remove deprecated non-null attributes from state
terraform plan | grep "3 to add"
terraform apply -auto-approve | grep "Apply complete"
# GH actions fails on following commands, need to investigate. Passes locally.
# diff terraform.tfstate terraform.tfstate.bak > diff.out
# ls -l
# cat diff.out
# grep "> \"schema_version\": 0," diff.out | wc -l | grep 3 # verify schema has been upgraded
# grep "> \"deprecated1\": null," diff.out # verify deprecated has been removed
# grep "> \"deprecated2\": null," diff.out # verify deprecated has been removed
# grep "< \"clear_percent\": 20," diff.out # verify string has been converted to number
# grep "< \"egress_enabled\": true," diff.out # verify string has been converted to bool
# terraform destroy -auto-approve
popd
8 changes: 4 additions & 4 deletions .github/workflows/cli-test-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Check out code
uses: actions/checkout@v4
Expand All @@ -22,7 +22,7 @@ jobs:
run: |
mkdir -p $HOME/solace; chmod 777 $HOME/solace
docker run -d -p 8080:8080 -p 55555:55555 --shm-size=1g --env username_admin_globalaccesslevel=admin --env username_admin_password=admin --env system_scaling_maxkafkabridgecount="10" --name=solace \
--mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:"10.8.1.126"
--env system_scaling_maxconnectioncount="1000" --mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:"10.9.1.115"
while ! curl -s localhost:8080 | grep aurelia ; do sleep 1 ; done
- name: Use local provider
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
- name: Create custom messageVPN with large config
run: |
pushd ci/broker_vpn_test
pushd ci/bigtest
# Create
terraform plan
terraform apply -auto-approve
Expand All @@ -132,7 +132,7 @@ jobs:
run: |
SOLACEBROKER_REGISTRY_OVERRIDE=registry.terraform.io/solaceproducts/solacebroker SOLACEBROKER_USERNAME=admin SOLACEBROKER_PASSWORD=admin terraform-provider-solacebroker generate --url=http://localhost:8080 solacebroker_msg_vpn.test test messageVpn.tf
cat messageVpn.tf
# also confirm comment is generated when ancillary object is refereced
# also confirm comment is generated when ancillary object is referenced
cat messageVpn.tf | grep depends_on
- name: Generate some resources( only msg_vpn_queue) for custom messageVPN file
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/core-pipeline-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ name: Build Terraform Provider in Development phase

on:
push:
branches-ignore:
- main
branches:
- dev*
- v*

jobs:
build:
Expand All @@ -15,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Check out code
uses: actions/checkout@v4
Expand Down Expand Up @@ -72,7 +73,7 @@ jobs:
fi
- name: Check changed files
uses: tj-actions/verify-changed-files@v17
uses: tj-actions/verify-changed-files@v20
id: check-changed-files
with:
files: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/core-pipeline-main-branch-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Check out code
uses: actions/checkout@v4
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/daily-sanity-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Daily sanity main
# Uses solace/solace-pubsub-standard:edge image

on:
schedule:
- cron: "0 5 * * *"

jobs:
build:
name: Daily test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"

- name: Check out code
uses: actions/checkout@v4
with:
ref: main

- name: Setup test broker
run: |
mkdir -p $HOME/solace; chmod 777 $HOME/solace
docker run -d -p 8080:8080 -p 55555:55555 --shm-size=1g --env username_admin_globalaccesslevel=admin --env username_admin_password=admin --env system_scaling_maxkafkabridgecount="10" --name=solace \
--mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:edge
while ! curl -s localhost:8080 | grep aurelia ; do sleep 1 ; done
- name: Set up Terraform latest - public
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: true

- name: Run provider test - create custom messageVPN with large config
run: |
pushd ci/broker_vpn_test
terraform init
$(find .terraform/ | grep terraform-provider) version
# Create
terraform plan
terraform apply -auto-approve
sleep 1
popd
- name: Run generate test - generate complete large config file for custom messageVPN file
run: |
pushd ci/broker_vpn_test
SOLACEBROKER_USERNAME=admin SOLACEBROKER_PASSWORD=admin $(find .terraform/ | grep terraform-provider) generate --url=http://localhost:8080 solacebroker_msg_vpn.test test messageVpn.tf
cat messageVpn.tf
rm messageVpn.tf
popd
- name: Run provider test - delete large config
run: |
pushd ci/broker_vpn_test
terraform plan
terraform destroy -auto-approve
sleep 1
popd
30 changes: 24 additions & 6 deletions .github/workflows/prep-internal-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
on:
workflow_dispatch:
inputs:
prev_branch_name:
description: 'Prev branch name, must start with v'
required: true
default: 'v0.1.0-rc.1'
release_branch_name:
description: 'Release branch name, must start with v'
required: true
default: 'v0.1.0-rc.1'
default: 'v0.1.0-rc.2'


jobs:
Expand All @@ -16,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Checkout the code
uses: actions/checkout@v2
Expand Down Expand Up @@ -92,12 +96,26 @@ jobs:
export WS_PROJECTNAME="${{ github.event.repository.name }}"
java -jar ci/whitesource/wss-unified-agent.jar -c ci/whitesource/whitesource-agent.config -d .
- name: Create the release branch
uses: peterjgrainger/[email protected]
- name: Create release branch starting point
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: "${{ github.event.inputs.release_branch_name }}"
run: |
git fetch
git push origin refs/remotes/origin/${{ github.event.inputs.prev_branch_name }}:refs/heads/${{ github.event.inputs.release_branch_name }}
- name: Create PR to release branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
CURRENT_BRANCH=${GITHUB_REF_NAME}
gh pr create -B ${{ github.event.inputs.release_branch_name }} --title "New release ${{ github.event.inputs.release_branch_name }}" --body 'Created by Github action'
# - name: Create the release branch
# uses: peterjgrainger/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# branch: "${{ github.event.inputs.release_branch_name }}"

# - name: Create next dev branch
# if: env.NEXT_DEV_VERSION != ''
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/provider-acceptance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Check out code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/provider-test-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Check out code
uses: actions/checkout@v4
Expand All @@ -22,7 +22,7 @@ jobs:
run: |
mkdir -p $HOME/solace; chmod 777 $HOME/solace
docker run -d -p 8080:8080 -p 55555:55555 --shm-size=1g --env username_admin_globalaccesslevel=admin --env username_admin_password=admin --env system_scaling_maxkafkabridgecount="10" --name=solace \
--env system_scaling_maxconnectioncount="1000" --mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:"10.8.1.126"
--env system_scaling_maxconnectioncount="1000" --mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:"10.9.1.115"
while ! curl -s localhost:8080 | grep aurelia ; do sleep 1 ; done
- name: Use local provider
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/verify-registry-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Check out code
uses: actions/checkout@v4
Expand All @@ -29,7 +29,7 @@ jobs:
run: |
mkdir -p $HOME/solace; chmod 777 $HOME/solace
docker run -d -p 8080:8080 -p 55555:55555 --shm-size=1g --env username_admin_globalaccesslevel=admin --env username_admin_password=admin --env system_scaling_maxkafkabridgecount="10" --name=solace \
--mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:"10.8.1.126"
--mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:"10.9.1.115"
while ! curl -s localhost:8080 | grep aurelia ; do sleep 1 ; done
- name: Set up Terraform latest - public
Expand Down
Loading

0 comments on commit 35ac594

Please sign in to comment.