From 3f62704924dd609d833e7d35b25eeebe4987bd18 Mon Sep 17 00:00:00 2001 From: Erik Osterman Date: Mon, 29 Jun 2020 07:49:15 -0700 Subject: [PATCH] Migrate to ChatOps --- .github/workflows/chatops.yml | 37 ++++++++ .github/workflows/slash-command-dispatch.yml | 20 ----- README.md | 2 +- README.yaml | 88 +++++++------------- codefresh/test.yml | 74 ---------------- 5 files changed, 69 insertions(+), 152 deletions(-) create mode 100644 .github/workflows/chatops.yml delete mode 100644 .github/workflows/slash-command-dispatch.yml delete mode 100644 codefresh/test.yml diff --git a/.github/workflows/chatops.yml b/.github/workflows/chatops.yml new file mode 100644 index 0000000..a6bb11b --- /dev/null +++ b/.github/workflows/chatops.yml @@ -0,0 +1,37 @@ +name: chatops +on: + issue_comment: + types: [created] + +jobs: + default: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: "Handle common commands" + uses: cloudposse/actions/github/slash-command-dispatch@0.15.0 + with: + token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} + reaction-token: ${{ secrets.GITHUB_TOKEN }} + repository: cloudposse/actions + commands: rebuild-readme, terraform-fmt + permission: none + issue-type: pull-request + + test: + runs-on: ubuntu-latest + steps: + - name: "Checkout commit" + uses: actions/checkout@v2 + - name: "Run tests" + uses: cloudposse/actions/github/slash-command-dispatch@0.15.0 + with: + token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} + reaction-token: ${{ secrets.GITHUB_TOKEN }} + repository: cloudposse/actions + commands: test + permission: none + issue-type: pull-request + reactions: false + + diff --git a/.github/workflows/slash-command-dispatch.yml b/.github/workflows/slash-command-dispatch.yml deleted file mode 100644 index 2b30f33..0000000 --- a/.github/workflows/slash-command-dispatch.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Slash Command Dispatch -on: - issue_comment: - types: [created] - -jobs: - slashCommandDispatch: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Slash Command Dispatch - uses: cloudposse/actions/github/slash-command-dispatch@0.15.0 - with: - token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} - reaction-token: ${{ secrets.GITHUB_TOKEN }} - repository: cloudposse/actions - commands: rebuild-readme, terraform-fmt - permission: none - issue-type: pull-request diff --git a/README.md b/README.md index f7f85de..b40fa98 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ # terraform-aws-lambda-elasticsearch-cleanup - [![Codefresh Build Status](https://g.codefresh.io/api/badges/pipeline/cloudposse/terraform-modules%2Fterraform-aws-lambda-elasticsearch-cleanup?type=cf-1)](https://g.codefresh.io/public/accounts/cloudposse/pipelines/5eaa33ff1dc82bb99faa3905) [![GitHub Action Build Status](https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/workflows/Lambda/badge.svg?branch=master)](https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/actions?query=workflow%3ALambda) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-lambda-elasticsearch-cleanup.svg)](https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) + [![GitHub Action Build Status](https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/workflows/Lambda/badge.svg?branch=master)](https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/actions?query=workflow%3ALambda) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-lambda-elasticsearch-cleanup.svg)](https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) Terraform module to provision a scheduled Lambda function which will diff --git a/README.yaml b/README.yaml index c66dbb8..ec66ddb 100644 --- a/README.yaml +++ b/README.yaml @@ -1,57 +1,34 @@ ---- -# -# This is the canonical configuration for the `README.md` -# Run `make readme` to rebuild the `README.md` -# - -# Name of this project name: terraform-aws-lambda-elasticsearch-cleanup - -# Logo for this project -#logo: docs/logo.png - -# License of this project -license: "APACHE2" - -# Canonical GitHub repo +license: APACHE2 github_repo: cloudposse/terraform-aws-lambda-elasticsearch-cleanup - -# Badges to display badges: - - name: "Codefresh Build Status" - image: "https://g.codefresh.io/api/badges/pipeline/cloudposse/terraform-modules%2Fterraform-aws-lambda-elasticsearch-cleanup?type=cf-1" - url: "https://g.codefresh.io/public/accounts/cloudposse/pipelines/5eaa33ff1dc82bb99faa3905" - - name: "GitHub Action Build Status" - image: "https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/workflows/Lambda/badge.svg?branch=master" - url: "https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/actions?query=workflow%3ALambda" - - name: "Latest Release" - image: "https://img.shields.io/github/release/cloudposse/terraform-aws-lambda-elasticsearch-cleanup.svg" - url: "https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/releases/latest" - - name: "Slack Community" - image: "https://slack.cloudposse.com/badge.svg" - url: "https://slack.cloudposse.com" - +- name: GitHub Action Build Status + image: https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/workflows/Lambda/badge.svg?branch=master + url: https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/actions?query=workflow%3ALambda +- name: Latest Release + image: https://img.shields.io/github/release/cloudposse/terraform-aws-lambda-elasticsearch-cleanup.svg + url: https://github.com/cloudposse/terraform-aws-lambda-elasticsearch-cleanup/releases/latest +- name: Slack Community + image: https://slack.cloudposse.com/badge.svg + url: https://slack.cloudposse.com related: - - name: "terraform-aws-vpc" - description: "Terraform Module that defines a VPC with public/private subnets across multiple AZs with Internet Gateways" - url: "https://github.com/cloudposse/terraform-aws-vpc" - - name: "terraform-aws-dynamic-subnets" - description: "Terraform module for dynamic subnets provisioning." - url: "https://github.com/cloudposse/terraform-aws-dynamic-subnets" - - name: "terraform-aws-elasticsearch" - description: "Terraform module for AWS Elasticsearch provisioning." - url: "https://github.com/cloudposse/terraform-aws-elasticsearch" - -# Short description of this project +- name: terraform-aws-vpc + description: Terraform Module that defines a VPC with public/private subnets across + multiple AZs with Internet Gateways + url: https://github.com/cloudposse/terraform-aws-vpc +- name: terraform-aws-dynamic-subnets + description: Terraform module for dynamic subnets provisioning. + url: https://github.com/cloudposse/terraform-aws-dynamic-subnets +- name: terraform-aws-elasticsearch + description: Terraform module for AWS Elasticsearch provisioning. + url: https://github.com/cloudposse/terraform-aws-elasticsearch description: |- Terraform module to provision a scheduled Lambda function which will delete old Elasticsearch indexes using [SigV4Auth](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) authentication. The lambda function can optionally send output to an SNS topic if the topic ARN is given. This module was largely inspired by [aws-lambda-es-cleanup](https://github.com/cloudreach/aws-lambda-es-cleanup) - -# How to use this project -usage: |- +usage: |2- For a complete example, see [examples/complete](examples/complete). @@ -69,18 +46,15 @@ usage: |- schedule = "rate(5 minutes)" } ``` - include: - - "docs/targets.md" - - "docs/terraform.md" - -# Contributors to this project +- docs/targets.md +- docs/terraform.md contributors: - - name: "Josh Myers" - github: "joshmyers" - - name: "Erik Osterman" - github: "osterman" - - name: "Andriy Knysh" - github: "aknysh" - - name: "Igor Rodionov" - github: "goruha" +- name: Josh Myers + github: joshmyers +- name: Erik Osterman + github: osterman +- name: Andriy Knysh + github: aknysh +- name: Igor Rodionov + github: goruha diff --git a/codefresh/test.yml b/codefresh/test.yml deleted file mode 100644 index 0c93b81..0000000 --- a/codefresh/test.yml +++ /dev/null @@ -1,74 +0,0 @@ -version: '1.0' - -stages: - - Prepare - - Test - -steps: - wait: - title: Wait - stage: Prepare - image: codefresh/cli:latest - commands: - - codefresh get builds --pipeline=${{CF_REPO_NAME}} --status running --limit 1000 -o json | jq --arg id ${{CF_BUILD_ID}} -ser 'flatten|.[-1].id==$id' - retry: - maxAttempts: 10 - delay: 20 - exponentialFactor: 1.1 - - main_clone: - title: "Clone repository" - type: git-clone - stage: Prepare - description: "Initialize" - repo: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}} - git: CF-default - revision: ${{CF_REVISION}} - - clean_init: - title: Prepare build-harness and test-harness - image: ${{TEST_IMAGE}} - stage: Prepare - commands: - - cf_export PATH="/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - - make init - - git -C build-harness checkout master - - make -C test/ clean init TEST_HARNESS_BRANCH=master - - make -C test/src clean init - - find . -type d -name '.terraform' | xargs rm -rf - - find . -type f -name 'terraform.tfstate*' -exec rm -f {} \; - - test: - type: "parallel" - title: "Run tests" - description: "Run all tests in parallel" - stage: Test - steps: - test_readme_lint: - title: "Test README.md updated" - stage: "Test" - image: ${{TEST_IMAGE}} - description: Test "readme/lint" - commands: - - make readme/lint - - test_module: - title: Test module with bats - image: ${{TEST_IMAGE}} - stage: Test - commands: - - make -C test/ module - - test_examples_complete: - title: Test "examples/complete" with bats - image: ${{TEST_IMAGE}} - stage: Test - commands: - - make -C test/ examples/complete - - test_examples_complete_terratest: - title: Test "examples/complete" with terratest - image: ${{TEST_IMAGE}} - stage: Test - commands: - - make -C test/src