From d0b990bfddb1de9ac798081aeace1da4e9643118 Mon Sep 17 00:00:00 2001 From: Greg Szabo Date: Sat, 8 Jul 2017 02:29:25 +0000 Subject: [PATCH] Moved Tendermint-specific terraform to devops repo --- devops/README.md | 19 --------- devops/slacknotification.py | 41 ------------------- .../cluster/networking.tf | 31 -------------- .../terraform-tendermint/networking-output.tf | 4 -- 4 files changed, 95 deletions(-) delete mode 100644 devops/README.md delete mode 100644 devops/slacknotification.py delete mode 100644 devops/terraform-tendermint/cluster/networking.tf delete mode 100644 devops/terraform-tendermint/networking-output.tf diff --git a/devops/README.md b/devops/README.md deleted file mode 100644 index 046241fdf..000000000 --- a/devops/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# DevOps tools - -This folder contains tools that are used for automated testnet deployments at Tendermint. These are tools specialized for the Tendermint infrastructure. However there might be some added value for people that want to set up similar networks. Use them at your own risk. - -## slacknotification.py - -A small script that can send Slack messages. - -Requirements: slackclient python library - -Install slackclient by running as root: -``` -pip install slackclient -``` - -## terraform-tendermint/ - -A few extensions to the terraform-digitalocean and terraform-aws configurations. This folder is not a complete Terraform configuration in itself, merely a few files that can be copied over to the other Terraform folders. It contains extensions specific to the Tendermint infrastructure, such as DNS configuration for testnet nodes. - diff --git a/devops/slacknotification.py b/devops/slacknotification.py deleted file mode 100644 index ee5987e23..000000000 --- a/devops/slacknotification.py +++ /dev/null @@ -1,41 +0,0 @@ -import os -from slackclient import SlackClient -import argparse - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description="Slack notification script") - parser.add_argument('--channel','-c', required=True, help="Slack channel.") - parser.add_argument('--message','-m', required=True, help="The message to send.") - parser.add_argument('--username', required=False, help="Username used on Slack") - parser.add_argument('--api_token', required=False, help="Slack API token. Can be set in SLACK_API_TOKEN environment variable too.") - parser.add_argument('--icon_emoji','-i', required=False, help="Icon for the message.") - args = parser.parse_args() - - username = args.username - api_token=args.api_token - if api_token is None: - api_token=os.getenv("SLACK_API_TOKEN") - message = args.message - channel = args.channel - icon_emoji = args.icon_emoji - - slack_client = SlackClient(api_token) - apitest = slack_client.api_call("api.test") - if not apitest['ok']: - raise ValueError("api.test error: {0}".format(apitest['error'])) - - authtest = slack_client.api_call("auth.test") - if not authtest['ok']: - raise ValueError("auth.test error: {0}".format(authtest['error'])) - - if username is None: - username = authtest['user'] - - if icon_emoji is None: - result = slack_client.api_call("chat.postMessage", channel=channel, text=message, username=username, icon_emoji=icon_emoji) - else: - result = slack_client.api_call("chat.postMessage", channel=channel, text=message, username=username) - - if not result['ok']: - raise ValueError("Message error: {0}".format(result['error'])) - diff --git a/devops/terraform-tendermint/cluster/networking.tf b/devops/terraform-tendermint/cluster/networking.tf deleted file mode 100644 index cf7dc9cb6..000000000 --- a/devops/terraform-tendermint/cluster/networking.tf +++ /dev/null @@ -1,31 +0,0 @@ -#resource "digitalocean_floating_ip" "cluster" { -# droplet_id = "${element(digitalocean_droplet.cluster.*.id,count.index)}" -# region = "${element(digitalocean_droplet.cluster.*.region,count.index)}" -# count = "${var.servers}" -#} - -provider "aws" { -} - -data "aws_route53_zone" "cluster" { - name = "testnets.interblock.io." -} - -resource "aws_route53_record" "cluster-node" { - zone_id = "${data.aws_route53_zone.cluster.zone_id}" - name = "${var.name}-node${count.index}" - type = "A" - ttl = "300" - records = ["${element(digitalocean_droplet.cluster.*.ipv4_address,count.index)}"] - count = "${var.servers}" -} - -resource "aws_route53_record" "cluster-regions" { - zone_id = "${data.aws_route53_zone.cluster.zone_id}" - name = "${var.name}-${element(digitalocean_droplet.cluster.*.region,count.index)}" - type = "CNAME" - ttl = "300" - records = ["${element(aws_route53_record.cluster-node.*.name,count.index)}.${data.aws_route53_zone.cluster.name}"] - count = "${var.servers}" -} - diff --git a/devops/terraform-tendermint/networking-output.tf b/devops/terraform-tendermint/networking-output.tf deleted file mode 100644 index 66964a30b..000000000 --- a/devops/terraform-tendermint/networking-output.tf +++ /dev/null @@ -1,4 +0,0 @@ -#output "floating_ips" { -# value = "${module.cluster.floating_ips}" -#} -