Browse Source

Add proposal parameters, update delete CF step, update caddy config

Anuj Bansal 3 years ago
parent
commit
b5e0e03404

+ 7 - 3
.github/workflows/deploy-playground.yml

@@ -27,6 +27,9 @@ on:
         description: 'Optionally skip running newChainSetup script (true or false)'
         required: true
         default: 'false'
+      proposalParameters:
+        description: 'Proposal Parameters (refer to runtime/src/proposals_configuration/sample_proposal_parameters.json for sample)'
+        required: false
       # TODO: customDomain instead of ip_address.nip.io
       # customDomain:
       #   description: 'DNS hostname to use for deployment'
@@ -88,7 +91,8 @@ jobs:
           options: |
             --extra-vars "git_repo=${{ github.event.inputs.gitRepo }} \
                           branch_name=${{ github.event.inputs.branchName }} \
-                          skip_chain_setup=${{ github.event.inputs.skipChainSetup }}"
+                          skip_chain_setup=${{ github.event.inputs.skipChainSetup }} \
+                          proposal_parameters=${{ github.event.inputs.proposalParameters }}"
 
       - name: Save the endpoints file as an artifact
         uses: actions/upload-artifact@v2
@@ -97,8 +101,8 @@ jobs:
           path: devops/aws/endpoints.json
 
       - name: Delete CloudFormation Stack if any step failed
-        # Skip if stack already existed
-        if: failure() && steps.stack_exists.outcome != 'failure'
+        # Skip only if stack already existed or all steps passed successfully
+        if: ( failure() || cancelled() ) && steps.stack_exists.outcome != 'failure'
         run: |
           echo "Deleting ${{ env.STACK_NAME }} stack"
           aws cloudformation delete-stack --stack-name ${{ env.STACK_NAME }}

+ 3 - 0
devops/aws/deploy-playground-playbook.yml

@@ -55,6 +55,8 @@
       command: yarn build:node:docker
       args:
         chdir: '{{ remote_code_path }}'
+      environment:
+        ALL_PROPOSALS_PARAMETERS_JSON: '{{ proposal_parameters }}'
       async: 3600
       poll: 0
       register: node_build_result
@@ -119,6 +121,7 @@
           indexer: https://{{ nip_domain }}/query-node/indexer/graphql
           member_faucet: https://{{ nip_domain }}/member-faucet/register
           orion: https://{{ nip_domain }}/orion/graphql
+          config: https://{{ nip_domain }}/network/config.json
       run_once: yes
 
     - name: Print endpoints

+ 1 - 1
devops/aws/templates/Playground-Caddyfile.j2

@@ -48,7 +48,7 @@ wss://{{ nip_domain }}/query-node/server* {
     reverse_proxy localhost:3002
 }
 
-{{ nip_domain }}/config.json {
+{{ nip_domain }}/network/config.json {
     root * /home/ubuntu
     rewrite * /config.json
     file_server