chore(autotest): start kafka and pulsar
This commit is contained in:
parent
5c39e0eca5
commit
4f5c7347a2
|
@ -126,13 +126,250 @@ jobs:
|
||||||
# aws ec2 start-instances --instance-ids i-0c5dccd394ed9be18
|
# aws ec2 start-instances --instance-ids i-0c5dccd394ed9be18
|
||||||
# aws ec2 start-instances --instance-ids i-04c1c50b3e4952266
|
# aws ec2 start-instances --instance-ids i-04c1c50b3e4952266
|
||||||
#
|
#
|
||||||
terraform_mysql:
|
# terraform_mysql:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
#
|
||||||
|
# outputs:
|
||||||
|
# mysql_ip: ${{ steps.mysql_ip.outputs.mysql_ip }}
|
||||||
|
# mysql_url: ${{ steps.mysql_url.outputs.mysql_url }}
|
||||||
|
# steps:
|
||||||
|
# - name: Checkout tf-test-automation
|
||||||
|
# uses: actions/checkout@v2
|
||||||
|
# with:
|
||||||
|
# repository: emqx/tf-test-automation
|
||||||
|
# ref: emqx-broker
|
||||||
|
# path: tf-test-automation
|
||||||
|
# - name: Setup Terraform
|
||||||
|
# uses: hashicorp/setup-terraform@v1.3.2
|
||||||
|
# with:
|
||||||
|
# terraform_wrapper: false
|
||||||
|
# - name: Terraform Init tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/mysql
|
||||||
|
# id: init1
|
||||||
|
# run: |
|
||||||
|
# terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
||||||
|
# - name: Terraform Validate tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/mysql
|
||||||
|
# id: validate1
|
||||||
|
# run: terraform validate -no-color
|
||||||
|
# - name: Terraform Apply tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/mysql
|
||||||
|
# id: mysql_url
|
||||||
|
# run: |
|
||||||
|
# terraform apply -auto-approve -var="db_password=public123" -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
||||||
|
# echo "::set-output name=mysql_url::$(terraform output endpoint)"
|
||||||
|
# - name: Rename and upload mysql tfstate
|
||||||
|
# working-directory: ./tf-test-automation/services/mysql
|
||||||
|
# run: |
|
||||||
|
# mv ./terraform.tfstate ./mysql.tfstate
|
||||||
|
# - uses: actions/upload-artifact@v2
|
||||||
|
# if: always()
|
||||||
|
# with:
|
||||||
|
# name: tfstate
|
||||||
|
# path: ./tf-test-automation/services/mysql/mysql.tfstate
|
||||||
|
# - name: Show mysql url
|
||||||
|
# id: mysql_ip
|
||||||
|
# run: |
|
||||||
|
# ip=`echo "${{ steps.mysql_url.outputs.mysql_url }}"|awk -F ':' '{print $1}'`
|
||||||
|
# echo "::set-output name=mysql_ip::$ip"
|
||||||
|
# - name: Show mysql ip
|
||||||
|
# run: |
|
||||||
|
# echo ${{ steps.mysql_url.outputs.mysql_url }}
|
||||||
|
# echo ${{ steps.mysql_ip.outputs.mysql_ip }}
|
||||||
|
##
|
||||||
|
# terraform_redis:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
#
|
||||||
|
# outputs:
|
||||||
|
# redis_ip: ${{ steps.redis_ip.outputs.redis_ip }}
|
||||||
|
# steps:
|
||||||
|
# - name: Checkout tf-test-automation
|
||||||
|
# uses: actions/checkout@v2
|
||||||
|
# with:
|
||||||
|
# repository: emqx/tf-test-automation
|
||||||
|
# ref: emqx-broker
|
||||||
|
# path: tf-test-automation
|
||||||
|
# - name: Setup Terraform
|
||||||
|
# uses: hashicorp/setup-terraform@v1.3.2
|
||||||
|
# with:
|
||||||
|
# terraform_wrapper: false
|
||||||
|
# - name: Terraform Init tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/redis
|
||||||
|
# id: init
|
||||||
|
# run: |
|
||||||
|
# terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
||||||
|
# - name: Terraform Validate tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/redis
|
||||||
|
# id: validate
|
||||||
|
# run: terraform validate -no-color
|
||||||
|
# - name: Terraform Apply tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/redis
|
||||||
|
# id: redis_ip
|
||||||
|
# run: |
|
||||||
|
# terraform apply -auto-approve -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}" -var="private_key=${{ secrets.CI_SSH_PRIVATE_KEY }}"
|
||||||
|
# echo "::set-output name=redis_ip::$(terraform output redis_private_ips)"
|
||||||
|
# - name: Rename and upload redis server tfstate
|
||||||
|
# working-directory: ./tf-test-automation/services/redis
|
||||||
|
# run: |
|
||||||
|
# mv ./terraform.tfstate ./redis.tfstate
|
||||||
|
# - uses: actions/upload-artifact@v2
|
||||||
|
# if: always()
|
||||||
|
# with:
|
||||||
|
# name: tfstate
|
||||||
|
# path: ./tf-test-automation/services/redis/redis.tfstate
|
||||||
|
# - name: Show redis ip
|
||||||
|
# run: |
|
||||||
|
# echo ${{ steps.redis_ip.outputs.redis_ip }}
|
||||||
|
#
|
||||||
|
# terraform_pgsql:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
#
|
||||||
|
# outputs:
|
||||||
|
# pgsql_url: ${{ steps.pgsql_url.outputs.pgsql_url }}
|
||||||
|
# pgsql_ip: ${{ steps.pgsql_ip.outputs.pgsql_ip }}
|
||||||
|
# steps:
|
||||||
|
# - name: Checkout tf-test-automation
|
||||||
|
# uses: actions/checkout@v2
|
||||||
|
# with:
|
||||||
|
# repository: emqx/tf-test-automation
|
||||||
|
# ref: emqx-broker
|
||||||
|
# path: tf-test-automation
|
||||||
|
# - name: Setup Terraform
|
||||||
|
# uses: hashicorp/setup-terraform@v1.3.2
|
||||||
|
# with:
|
||||||
|
# terraform_wrapper: false
|
||||||
|
# - name: Terraform Init tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/pgsql
|
||||||
|
# id: init
|
||||||
|
# run: |
|
||||||
|
# terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
||||||
|
# - name: Terraform Validate tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/pgsql
|
||||||
|
# id: validate
|
||||||
|
# run: terraform validate -no-color
|
||||||
|
# - name: Terraform Apply tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/pgsql
|
||||||
|
# id: pgsql_url
|
||||||
|
# run: |
|
||||||
|
# terraform apply -auto-approve -var="db_password=public123" -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
||||||
|
# echo "::set-output name=pgsql_url::$(terraform output endpoint)"
|
||||||
|
# - name: Rename and upload pgsql server tfstate
|
||||||
|
# working-directory: ./tf-test-automation/services/pgsql
|
||||||
|
# run: |
|
||||||
|
# mv ./terraform.tfstate ./pgsql.tfstate
|
||||||
|
# - uses: actions/upload-artifact@v2
|
||||||
|
# if: always()
|
||||||
|
# with:
|
||||||
|
# name: tfstate
|
||||||
|
# path: ./tf-test-automation/services/pgsql/pgsql.tfstate
|
||||||
|
# - name: Show pgsql url
|
||||||
|
# id: pgsql_ip
|
||||||
|
# run: |
|
||||||
|
# ip=`echo "${{ steps.pgsql_url.outputs.pgsql_url }}"|awk -F ':' '{print $1}'`
|
||||||
|
# echo "::set-output name=pgsql_ip::$ip"
|
||||||
|
# - name: Show pgsql ip
|
||||||
|
# run: |
|
||||||
|
# echo ${{ steps.pgsql_url.outputs.pgsql_url }}
|
||||||
|
# echo ${{ steps.pgsql_ip.outputs.pgsql_ip }}
|
||||||
|
#
|
||||||
|
# terraform_mongo:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
#
|
||||||
|
# outputs:
|
||||||
|
# mongo_ip: ${{ steps.mongo_ip.outputs.mongo_ip }}
|
||||||
|
# steps:
|
||||||
|
# - name: Checkout tf-test-automation
|
||||||
|
# uses: actions/checkout@v2
|
||||||
|
# with:
|
||||||
|
# repository: emqx/tf-test-automation
|
||||||
|
# ref: emqx-broker
|
||||||
|
# path: tf-test-automation
|
||||||
|
# - name: Setup Terraform
|
||||||
|
# uses: hashicorp/setup-terraform@v1.3.2
|
||||||
|
# with:
|
||||||
|
# terraform_wrapper: false
|
||||||
|
# - name: Terraform Init tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/mongodb
|
||||||
|
# id: init
|
||||||
|
# run: |
|
||||||
|
# terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
||||||
|
# - name: Terraform Validate tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/mongodb
|
||||||
|
# id: validate
|
||||||
|
# run: terraform validate -no-color
|
||||||
|
# - name: Terraform Apply tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/mongodb
|
||||||
|
# id: mongo_ip
|
||||||
|
# run: |
|
||||||
|
# terraform apply -auto-approve -var="db_password=public123" -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}" -var="private_key=${{ secrets.CI_SSH_PRIVATE_KEY }}"
|
||||||
|
# echo "::set-output name=mongo_ip::$(terraform output mongo_private_ips)"
|
||||||
|
# - name: Rename and upload mongo server tfstate
|
||||||
|
# working-directory: ./tf-test-automation/services/mongodb
|
||||||
|
# run: |
|
||||||
|
# mv ./terraform.tfstate ./mongo.tfstate
|
||||||
|
# - uses: actions/upload-artifact@v2
|
||||||
|
# if: always()
|
||||||
|
# with:
|
||||||
|
# name: tfstate
|
||||||
|
# path: ./tf-test-automation/services/mongodb/mongo.tfstate
|
||||||
|
# - name: Show mongo ip
|
||||||
|
# run: |
|
||||||
|
# echo ${{ steps.mongo_ip.outputs.mongo_ip }}
|
||||||
|
#
|
||||||
|
# terraform_webhook:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
#
|
||||||
|
# outputs:
|
||||||
|
# webhook_ip: ${{ steps.webhook_ip.outputs.webhook_ip }}
|
||||||
|
# steps:
|
||||||
|
# - name: Checkout tf-test-automation
|
||||||
|
# uses: actions/checkout@v2
|
||||||
|
# with:
|
||||||
|
# repository: emqx/tf-test-automation
|
||||||
|
# ref: emqx-broker
|
||||||
|
# path: tf-test-automation
|
||||||
|
# - name: Setup Terraform
|
||||||
|
# uses: hashicorp/setup-terraform@v1.3.2
|
||||||
|
# with:
|
||||||
|
# terraform_wrapper: false
|
||||||
|
# - name: Terraform Init tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/webhook
|
||||||
|
# id: init
|
||||||
|
# run: |
|
||||||
|
# terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
||||||
|
# - name: Terraform Validate tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/webhook
|
||||||
|
# id: validate
|
||||||
|
# run: terraform validate -no-color
|
||||||
|
# - name: Terraform Apply tf-test-automation
|
||||||
|
# working-directory: ./tf-test-automation/services/webhook
|
||||||
|
# id: webhook_ip
|
||||||
|
# run: |
|
||||||
|
# terraform apply -auto-approve -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}" -var="private_key=${{ secrets.CI_SSH_PRIVATE_KEY }}"
|
||||||
|
# echo "::set-output name=webhook_ip::$(terraform output webhook_private_ips)"
|
||||||
|
# - name: Rename and upload webhook server tfstate
|
||||||
|
# working-directory: ./tf-test-automation/services/webhook
|
||||||
|
# run: |
|
||||||
|
# mv ./terraform.tfstate ./webhook.tfstate
|
||||||
|
# - uses: actions/upload-artifact@v2
|
||||||
|
# if: always()
|
||||||
|
# with:
|
||||||
|
# name: tfstate
|
||||||
|
# path: ./tf-test-automation/services/webhook/webhook.tfstate
|
||||||
|
# - name: Show webhook ip
|
||||||
|
# run: |
|
||||||
|
# echo ${{ steps.webhook_ip.outputs.webhook_ip }}
|
||||||
|
|
||||||
|
terraform_kafka:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
mysql_ip: ${{ steps.mysql_ip.outputs.mysql_ip }}
|
zk_ip: ${{ steps.zk_ip.outputs.zk_ip }}
|
||||||
mysql_url: ${{ steps.mysql_url.outputs.mysql_url }}
|
kafka_ip: ${{ steps.kafka_ip.outputs.kafka_ip }}
|
||||||
|
kafka_bootstrap: ${{ steps.zk_ip.outputs.kafka_bootstrap }}
|
||||||
|
kafka_cli_ip: ${{ steps.kafka_cli_ip.outputs.kafka_cli_ip }}
|
||||||
steps:
|
steps:
|
||||||
|
# install kafka cluster
|
||||||
- name: Checkout tf-test-automation
|
- name: Checkout tf-test-automation
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
@ -144,44 +381,79 @@ jobs:
|
||||||
with:
|
with:
|
||||||
terraform_wrapper: false
|
terraform_wrapper: false
|
||||||
- name: Terraform Init tf-test-automation
|
- name: Terraform Init tf-test-automation
|
||||||
working-directory: ./tf-test-automation/services/mysql
|
working-directory: ./tf-test-automation/services/kafka
|
||||||
id: init1
|
id: init1
|
||||||
run: |
|
run: |
|
||||||
terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
||||||
- name: Terraform Validate tf-test-automation
|
- name: Terraform Validate tf-test-automation
|
||||||
working-directory: ./tf-test-automation/services/mysql
|
working-directory: ./tf-test-automation/services/kafka
|
||||||
id: validate1
|
id: validate1
|
||||||
run: terraform validate -no-color
|
run: terraform validate -no-color
|
||||||
- name: Terraform Apply tf-test-automation
|
- name: Terraform Apply tf-test-automation
|
||||||
working-directory: ./tf-test-automation/services/mysql
|
working-directory: ./tf-test-automation/services/kafka
|
||||||
id: mysql_url
|
id: zk_ip
|
||||||
run: |
|
run: |
|
||||||
terraform apply -auto-approve -var="db_password=public123" -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
terraform apply -auto-approve -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
||||||
echo "::set-output name=mysql_url::$(terraform output endpoint)"
|
echo "::set-output name=zk_ip::$(terraform output zk_ip)"
|
||||||
- name: Rename and upload mysql tfstate
|
echo "::set-output name=kafka_bootstrap::$(terraform output kafka_bootstrap_brokers_tls)"
|
||||||
working-directory: ./tf-test-automation/services/mysql
|
- name: Rename and upload kafka server tfstate
|
||||||
|
working-directory: ./tf-test-automation/services/kafka
|
||||||
run: |
|
run: |
|
||||||
mv ./terraform.tfstate ./mysql.tfstate
|
mv ./terraform.tfstate ./kafka.tfstate
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: tfstate
|
name: tfstate
|
||||||
path: ./tf-test-automation/services/mysql/mysql.tfstate
|
path: ./tf-test-automation/services/kafka/kafka.tfstate
|
||||||
- name: Show mysql url
|
- name: Show kafka ip
|
||||||
id: mysql_ip
|
id: kafka_ip
|
||||||
run: |
|
run: |
|
||||||
ip=`echo "${{ steps.mysql_url.outputs.mysql_url }}"|awk -F ':' '{print $1}'`
|
ip=${{ steps.zk_ip.outputs.zk_ip }}
|
||||||
echo "::set-output name=mysql_ip::$ip"
|
echo "::set-output name=kafka_ip::${ip:4:50}"
|
||||||
- name: Show mysql ip
|
- name: Show kafka url
|
||||||
run: |
|
run: |
|
||||||
echo ${{ steps.mysql_url.outputs.mysql_url }}
|
echo ${{ steps.zk_ip.outputs.zk_ip }}
|
||||||
echo ${{ steps.mysql_ip.outputs.mysql_ip }}
|
echo ${{ steps.zk_ip.outputs.kafka_bootstrap }}
|
||||||
#
|
echo ${{ steps.kafka_ip.outputs.kafka_ip }}
|
||||||
terraform_redis:
|
# install kafka client
|
||||||
|
- name: Checkout tf-kafka-client
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: emqx/tf-kafka-client
|
||||||
|
path: tf-kafka-client
|
||||||
|
- name: Terraform Init tf-kafka-client
|
||||||
|
working-directory: ./tf-kafka-client
|
||||||
|
id: init2
|
||||||
|
run: |
|
||||||
|
terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
||||||
|
- name: Terraform Validate tf-kafka-client
|
||||||
|
working-directory: ./tf-kafka-client
|
||||||
|
id: validate2
|
||||||
|
run: terraform validate -no-color
|
||||||
|
- name: Terraform Apply tf-kafka-client
|
||||||
|
working-directory: ./tf-kafka-client
|
||||||
|
id: kafka_cli_ip
|
||||||
|
run: |
|
||||||
|
terraform apply -auto-approve -var="key_name=emqx-ci-robor" -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}" -var="zk_ip=${{ steps.zk_ip.outputs.zk_ip }}" -var="kafka_topic=testTopic1" -var="private_key=${{ secrets.CI_SSH_PRIVATE_KEY }}"
|
||||||
|
echo "::set-output name=kafka_cli_ip::$(terraform output public_ip)"
|
||||||
|
- name: Rename and upload kafka cli tfstate
|
||||||
|
working-directory: ./tf-kafka-client
|
||||||
|
run: |
|
||||||
|
mv terraform.tfstate kafka-cli.tfstate
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: tfstate
|
||||||
|
path: ./tf-kafka-client/kafka-cli.tfstate
|
||||||
|
- name: Show kafka cli ip
|
||||||
|
run: |
|
||||||
|
echo ${{ steps.kafka_cli_ip.outputs.kafka_cli_ip }}
|
||||||
|
|
||||||
|
terraform_pulsar:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
redis_ip: ${{ steps.redis_ip.outputs.redis_ip }}
|
pulsar_ip: ${{ steps.pulsar_ip.outputs.pulsar_ip }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout tf-test-automation
|
- name: Checkout tf-test-automation
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -194,171 +466,32 @@ jobs:
|
||||||
with:
|
with:
|
||||||
terraform_wrapper: false
|
terraform_wrapper: false
|
||||||
- name: Terraform Init tf-test-automation
|
- name: Terraform Init tf-test-automation
|
||||||
working-directory: ./tf-test-automation/services/redis
|
working-directory: ./tf-test-automation/services/pulsar
|
||||||
id: init
|
id: init
|
||||||
run: |
|
run: |
|
||||||
terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
||||||
- name: Terraform Validate tf-test-automation
|
- name: Terraform Validate tf-test-automation
|
||||||
working-directory: ./tf-test-automation/services/redis
|
working-directory: ./tf-test-automation/services/pulsar
|
||||||
id: validate
|
id: validate
|
||||||
run: terraform validate -no-color
|
run: terraform validate -no-color
|
||||||
- name: Terraform Apply tf-test-automation
|
- name: Terraform Apply tf-test-automation
|
||||||
working-directory: ./tf-test-automation/services/redis
|
working-directory: ./tf-test-automation/services/pulsar
|
||||||
id: redis_ip
|
id: pulsar_ip
|
||||||
run: |
|
run: |
|
||||||
terraform apply -auto-approve -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}" -var="private_key=${{ secrets.CI_SSH_PRIVATE_KEY }}"
|
terraform apply -auto-approve -var="key_name=emqx-ci-robor" -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}" -var="private_key=${{ secrets.CI_SSH_PRIVATE_KEY }}"
|
||||||
echo "::set-output name=redis_ip::$(terraform output redis_private_ips)"
|
echo "::set-output name=pulsar_ip::$(terraform output pulsar_private_ips)"
|
||||||
- name: Rename and upload redis server tfstate
|
- name: Rename and upload pulsar server tfstate
|
||||||
working-directory: ./tf-test-automation/services/redis
|
working-directory: ./tf-test-automation/services/pulsar
|
||||||
run: |
|
run: |
|
||||||
mv ./terraform.tfstate ./redis.tfstate
|
mv ./terraform.tfstate ./pulsar.tfstate
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: tfstate
|
name: tfstate
|
||||||
path: ./tf-test-automation/services/redis/redis.tfstate
|
path: ./tf-test-automation/services/pulsar/pulsar.tfstate
|
||||||
- name: Show redis ip
|
- name: Show pulsar ip
|
||||||
run: |
|
run: |
|
||||||
echo ${{ steps.redis_ip.outputs.redis_ip }}
|
echo ${{ steps.pulsar_ip.outputs.pulsar_ip }}
|
||||||
|
|
||||||
terraform_pgsql:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
pgsql_url: ${{ steps.pgsql_url.outputs.pgsql_url }}
|
|
||||||
pgsql_ip: ${{ steps.pgsql_ip.outputs.pgsql_ip }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout tf-test-automation
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
repository: emqx/tf-test-automation
|
|
||||||
ref: emqx-broker
|
|
||||||
path: tf-test-automation
|
|
||||||
- name: Setup Terraform
|
|
||||||
uses: hashicorp/setup-terraform@v1.3.2
|
|
||||||
with:
|
|
||||||
terraform_wrapper: false
|
|
||||||
- name: Terraform Init tf-test-automation
|
|
||||||
working-directory: ./tf-test-automation/services/pgsql
|
|
||||||
id: init
|
|
||||||
run: |
|
|
||||||
terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
|
||||||
- name: Terraform Validate tf-test-automation
|
|
||||||
working-directory: ./tf-test-automation/services/pgsql
|
|
||||||
id: validate
|
|
||||||
run: terraform validate -no-color
|
|
||||||
- name: Terraform Apply tf-test-automation
|
|
||||||
working-directory: ./tf-test-automation/services/pgsql
|
|
||||||
id: pgsql_url
|
|
||||||
run: |
|
|
||||||
terraform apply -auto-approve -var="db_password=public123" -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
|
||||||
echo "::set-output name=pgsql_url::$(terraform output endpoint)"
|
|
||||||
- name: Rename and upload pgsql server tfstate
|
|
||||||
working-directory: ./tf-test-automation/services/pgsql
|
|
||||||
run: |
|
|
||||||
mv ./terraform.tfstate ./pgsql.tfstate
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: tfstate
|
|
||||||
path: ./tf-test-automation/services/pgsql/pgsql.tfstate
|
|
||||||
- name: Show pgsql url
|
|
||||||
id: pgsql_ip
|
|
||||||
run: |
|
|
||||||
ip=`echo "${{ steps.pgsql_url.outputs.pgsql_url }}"|awk -F ':' '{print $1}'`
|
|
||||||
echo "::set-output name=pgsql_ip::$ip"
|
|
||||||
- name: Show pgsql ip
|
|
||||||
run: |
|
|
||||||
echo ${{ steps.pgsql_url.outputs.pgsql_url }}
|
|
||||||
echo ${{ steps.pgsql_ip.outputs.pgsql_ip }}
|
|
||||||
|
|
||||||
terraform_mongo:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
mongo_ip: ${{ steps.mongo_ip.outputs.mongo_ip }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout tf-test-automation
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
repository: emqx/tf-test-automation
|
|
||||||
ref: emqx-broker
|
|
||||||
path: tf-test-automation
|
|
||||||
- name: Setup Terraform
|
|
||||||
uses: hashicorp/setup-terraform@v1.3.2
|
|
||||||
with:
|
|
||||||
terraform_wrapper: false
|
|
||||||
- name: Terraform Init tf-test-automation
|
|
||||||
working-directory: ./tf-test-automation/services/mongodb
|
|
||||||
id: init
|
|
||||||
run: |
|
|
||||||
terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
|
||||||
- name: Terraform Validate tf-test-automation
|
|
||||||
working-directory: ./tf-test-automation/services/mongodb
|
|
||||||
id: validate
|
|
||||||
run: terraform validate -no-color
|
|
||||||
- name: Terraform Apply tf-test-automation
|
|
||||||
working-directory: ./tf-test-automation/services/mongodb
|
|
||||||
id: mongo_ip
|
|
||||||
run: |
|
|
||||||
terraform apply -auto-approve -var="db_password=public123" -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}" -var="private_key=${{ secrets.CI_SSH_PRIVATE_KEY }}"
|
|
||||||
echo "::set-output name=mongo_ip::$(terraform output mongo_private_ips)"
|
|
||||||
- name: Rename and upload mongo server tfstate
|
|
||||||
working-directory: ./tf-test-automation/services/mongodb
|
|
||||||
run: |
|
|
||||||
mv ./terraform.tfstate ./mongo.tfstate
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: tfstate
|
|
||||||
path: ./tf-test-automation/services/mongodb/mongo.tfstate
|
|
||||||
- name: Show mongo ip
|
|
||||||
run: |
|
|
||||||
echo ${{ steps.mongo_ip.outputs.mongo_ip }}
|
|
||||||
|
|
||||||
terraform_webhook:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
webhook_ip: ${{ steps.webhook_ip.outputs.webhook_ip }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout tf-test-automation
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
repository: emqx/tf-test-automation
|
|
||||||
ref: emqx-broker
|
|
||||||
path: tf-test-automation
|
|
||||||
- name: Setup Terraform
|
|
||||||
uses: hashicorp/setup-terraform@v1.3.2
|
|
||||||
with:
|
|
||||||
terraform_wrapper: false
|
|
||||||
- name: Terraform Init tf-test-automation
|
|
||||||
working-directory: ./tf-test-automation/services/webhook
|
|
||||||
id: init
|
|
||||||
run: |
|
|
||||||
terraform init --backend-config="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" --backend-config="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}"
|
|
||||||
- name: Terraform Validate tf-test-automation
|
|
||||||
working-directory: ./tf-test-automation/services/webhook
|
|
||||||
id: validate
|
|
||||||
run: terraform validate -no-color
|
|
||||||
- name: Terraform Apply tf-test-automation
|
|
||||||
working-directory: ./tf-test-automation/services/webhook
|
|
||||||
id: webhook_ip
|
|
||||||
run: |
|
|
||||||
terraform apply -auto-approve -var="access_key=${{ secrets.AWS_ACCESS_KEY_ID_FOR_PERFORMANCE_TESTING }}" -var="secret_key=${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_PERFORMANCE_TESTING }}" -var="private_key=${{ secrets.CI_SSH_PRIVATE_KEY }}"
|
|
||||||
echo "::set-output name=webhook_ip::$(terraform output webhook_private_ips)"
|
|
||||||
- name: Rename and upload webhook server tfstate
|
|
||||||
working-directory: ./tf-test-automation/services/webhook
|
|
||||||
run: |
|
|
||||||
mv ./terraform.tfstate ./webhook.tfstate
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: tfstate
|
|
||||||
path: ./tf-test-automation/services/webhook/webhook.tfstate
|
|
||||||
- name: Show webhook ip
|
|
||||||
run: |
|
|
||||||
echo ${{ steps.webhook_ip.outputs.webhook_ip }}
|
|
||||||
|
|
||||||
# master_control:
|
# master_control:
|
||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
|
|
Loading…
Reference in New Issue