2022-11-30 23:52:03 +00:00
|
|
|
name: Continuous Deployment (Internal Testnet)
|
|
|
|
# run after every successful CI job of new commits to the master branch
|
|
|
|
on:
|
|
|
|
workflow_run:
|
2022-12-08 17:30:12 +00:00
|
|
|
workflows: [Continuous Integration (Kava Master)]
|
2022-11-30 23:52:03 +00:00
|
|
|
types:
|
|
|
|
- completed
|
2022-12-14 20:43:04 +00:00
|
|
|
push:
|
|
|
|
# run CD on any push to the development branch
|
|
|
|
branches:
|
|
|
|
- ls-internal-testnet-cd-go-live
|
2022-12-08 17:30:12 +00:00
|
|
|
|
2022-11-30 23:52:03 +00:00
|
|
|
jobs:
|
2022-12-08 17:30:12 +00:00
|
|
|
# in order:
|
|
|
|
# enter standby (prevents autoscaling group from killing node during deploy)
|
|
|
|
# stop kava
|
|
|
|
# take ebs + zfs snapshots
|
|
|
|
# download updated binary and genesis
|
|
|
|
# reset application database state (only done on internal testnet)
|
|
|
|
reset-chain-to-zero-state:
|
2022-12-08 18:35:20 +00:00
|
|
|
# only start cd pipeline if last ci run was successful
|
2022-12-12 19:12:26 +00:00
|
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
2022-12-08 17:30:12 +00:00
|
|
|
uses: ./.github/workflows/cd-reset-internal-testnet.yml
|
|
|
|
with:
|
|
|
|
aws-region: us-east-1
|
|
|
|
chain-id: demo_2221-17000
|
|
|
|
ssm-document-name: kava-demonet-node-update
|
|
|
|
playbook-name: reset-internal-testnet-playbook.yml
|
2022-12-08 18:35:20 +00:00
|
|
|
playbook-infrastructure-branch: master
|
2022-12-08 17:30:12 +00:00
|
|
|
secrets: inherit
|
|
|
|
|
|
|
|
# start kava with new binary and genesis state on api, peer and seed nodes, place nodes in service once they start and are synched to live
|
|
|
|
start-chain-api:
|
|
|
|
uses: ./.github/workflows/cd-start-chain.yml
|
|
|
|
with:
|
|
|
|
aws-region: us-east-1
|
|
|
|
chain-id: demo_2221-17000
|
|
|
|
ssm-document-name: kava-demonet-node-update
|
|
|
|
playbook-name: start-chain-api-playbook.yml
|
2022-12-08 18:35:20 +00:00
|
|
|
playbook-infrastructure-branch: master
|
2022-12-08 17:30:12 +00:00
|
|
|
secrets: inherit
|
|
|
|
needs: [reset-chain-to-zero-state]
|
|
|
|
|
|
|
|
# setup test and development accounts and balances, deploy contracts by calling the chain's api
|
|
|
|
seed-chain-state:
|
|
|
|
uses: ./.github/workflows/cd-seed-chain.yml
|
2022-12-08 18:35:20 +00:00
|
|
|
with:
|
|
|
|
chain-api-url: https://rpc.data.demonet.us-east.production.kava.io:443
|
|
|
|
chain-id: kava_2221-17000
|
|
|
|
seed-script-filename: seed-internal-testnet.sh
|
2022-12-08 17:30:12 +00:00
|
|
|
secrets: inherit
|
|
|
|
needs: [start-chain-api]
|