From 445a40e873bd68f50ad8877ed07c25f7e4d0a650 Mon Sep 17 00:00:00 2001 From: robcxyz Date: Tue, 22 Feb 2022 23:49:03 -0800 Subject: [PATCH] chore: add initial tackle demo --- .gitignore | 2 ++ releases.yaml | 4 ++++ tackle.yaml | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 releases.yaml create mode 100644 tackle.yaml diff --git a/.gitignore b/.gitignore index 19c9362..e0bd104 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ .terraform.lock.hcl +deployments/* + # Terraform and terragrunt *.tfstate* *.tfstate.backup diff --git a/releases.yaml b/releases.yaml new file mode 100644 index 0000000..edd069b --- /dev/null +++ b/releases.yaml @@ -0,0 +1,4 @@ +polkadot: + - polkadot_client_url: "https://github.com/paritytech/polkadot/releases/download/v0.9.12/polkadot" + polkadot_client_hash: "4a06a043e8fec42e09384a7ebab4331d138101ee55846af356e08d38982d767a" + diff --git a/tackle.yaml b/tackle.yaml new file mode 100644 index 0000000..8669147 --- /dev/null +++ b/tackle.yaml @@ -0,0 +1,66 @@ +# CLI that generates a module for deployment +action: + ->: select + choices: + - Create a new deployment: deploy + - Upgrade an existing deployment: upgrade + +deploy->: + if: action == 'deploy' + + intro_>: | + confirm You will now be prompted for options to setup a new node. If you make a mistake, + you can either start over or edit the produced files directly. + + deployment_name->: input "What do you want to call your deployment?" --default my-deployment + output_path_>: input "Where do you want to generate the deployment?" --default "./deployments/{{deployment_name}}" + + # Check to replace + check_output_path->: isdir "{{output_path}}" + replace_>: + if: check_output_path + check->: confirm "The output path {{output_path}} exists. Do you want to replace it?" + print->: print Exiting --if "not check" + exit: + ->: exit 0 + if: not check + + public_key_path->: input "Enter the path to a public ssh key" --default "~/.ssh/id_rsa.pub" + public_key_exists->: isfile "{{public_key_path}}" + public_key: + ->: file "{{public_key_path}}" + if: public_key_exists + else: Could not find key in {{public_key_path}} - Fix this manually. + + node_purpose: + ->: select + choices: + - Validator node: validator + - API node: api + + chain: + ->: select + choices: + - polkadot + - kusama + + releases_>: yaml releases.yaml + current release: + ->: var {{releases[chain][0]}} + merge: true + module_version: v0.1.0 + + validator_options->: + if: node_purpose == 'validator' + merge: true + consul_enabled: false + hardening_enabled: true + mount_volumes: false + skip_health_check: true + + # d->: debug + generate->: generate templates/ "{{output_path}}/" + +upgrade->: + if: action == 'upgrade' + warning->: print Not implemented yet... This is just a demo.