Skip to content

.github/workflows/verify-registry-release.yml #1

.github/workflows/verify-registry-release.yml

.github/workflows/verify-registry-release.yml #1

# Launched manually to test new relesse from registry
on:
workflow_dispatch:
inputs:
release_version:
description: 'The version of the release in the Terraform registry (expecting semver format)'
required: true
default: '0.1.0-rc.1'
public_release:
type: boolean
description: 'Check if this is a public release (from registry.terraform.io). Private release is from app.terraform.io'
required: true
default: false
jobs:
build:
name: Verify registry release
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- name: Check out code
uses: actions/checkout@v4
- 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 --name=solace \
--mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard
while ! curl -s localhost:8080 | grep aurelia ; do sleep 1 ; done
- name: Set up Terraform latest - public
if: ${{ github.event.inputs.public_release != 'false' }}
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: true
- name: Set up Terraform latest - private, with token
if: ${{ github.event.inputs.public_release == 'false' }}
uses: hashicorp/setup-terraform@v3
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
terraform_wrapper: true
- name: Setup token and patch provider for private release
run: |
pushd ci/broker_vpn_q
if [ "${{ github.event.inputs.public_release }}" == "false" ] ; then
echo Internal release
sed -i "[email protected]/[email protected]/SolaceDev@g" testconfig.tf
else
echo Public release
fi
sed -i '/source = "/a \ \ \ \ \ \ version = "${{ github.event.inputs.release_version }}"' testconfig.tf
cat testconfig.tf
popd
- name: Run init
run: |
pushd ci/broker_vpn_q
terraform init
$(find .terraform/ | grep terraform-provider) version | grep ${{ github.event.inputs.release_version }}
popd
- name: Test basic provider
run: |
pushd ci/broker_vpn_q
terraform plan
sleep 1
terraform apply -auto-approve
sleep 1
terraform destroy -auto-approve
popd
- name: Test basic config generator
run: |
pushd ci/broker_vpn_q
SOLACEBROKER_USERNAME=admin SOLACEBROKER_PASSWORD=admin SOLACEBROKER_SKIP_API_CHECK=true $(find .terraform/ | grep terraform-provider) generate --url=http://localhost:8080 solacebroker_msg_vpn.test default messageVpn.tf
popd