Skip to content

Commit

Permalink
Additional TF 0.13 Fixes (cloudposse#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
osterman authored Aug 19, 2020
1 parent 63e7aee commit f651035
Show file tree
Hide file tree
Showing 12 changed files with 159 additions and 209 deletions.
40 changes: 40 additions & 0 deletions .github/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
version-template: '$MAJOR.$MINOR.$PATCH'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'enhancement'
patch:
labels:
- 'patch'
- 'fix'
- 'bugfix'
- 'bug'
- 'hotfix'
default: 'minor'

categories:
- title: '🚀 Enhancements'
labels:
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- 'hotfix'

change-template: |
<details>
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
$BODY
</details>
template: |
$CHANGES
19 changes: 19 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: auto-release

on:
push:
branches:
- master

jobs:
semver:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
with:
publish: true
prerelease: false
config-name: auto-release.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 0 additions & 20 deletions .github/workflows/slash-command-dispatch.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# terraform-github-repository-webhooks

[![Codefresh Build Status](https://g.codefresh.io/api/badges/pipeline/cloudposse/terraform-modules%2Fterraform-github-repository-webhooks?type=cf-1)](https://g.codefresh.io/public/accounts/cloudposse/pipelines/5d1bcc1a1bde727a7172235e) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-github-repository-webhooks.svg)](https://github.com/cloudposse/terraform-github-repository-webhooks/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
[![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-github-repository-webhooks.svg)](https://github.com/cloudposse/terraform-github-repository-webhooks/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)

[![README Header][readme_header_img]][readme_header_link]

Expand Down Expand Up @@ -106,7 +106,7 @@ Available targets:

| Name | Version |
|------|---------|
| terraform | ~> 0.12.0 |
| terraform | >= 0.12.0 |
| github | ~> 2.8.0 |
| local | ~> 1.2 |

Expand Down
79 changes: 27 additions & 52 deletions README.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,16 @@
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#

# Name of this project
name: terraform-github-repository-webhooks

# License of this project
license: "APACHE2"

# Canonical GitHub repo
license: APACHE2
github_repo: cloudposse/terraform-github-repository-webhooks

# Short description of this project
description: |-
Terraform module to provision webhooks on a set of GitHub repositories.
This is useful if you need to register a webhook en masse across dozens of repositories.
# Badges to display
badges:
- name: "Codefresh Build Status"
image: "https://g.codefresh.io/api/badges/pipeline/cloudposse/terraform-modules%2Fterraform-github-repository-webhooks?type=cf-1"
url: "https://g.codefresh.io/public/accounts/cloudposse/pipelines/5d1bcc1a1bde727a7172235e"
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/terraform-github-repository-webhooks.svg"
url: "https://github.com/cloudposse/terraform-github-repository-webhooks/releases/latest"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"

# How to use this project
- name: Latest Release
image: https://img.shields.io/github/release/cloudposse/terraform-github-repository-webhooks.svg
url: https://github.com/cloudposse/terraform-github-repository-webhooks/releases/latest
- name: Slack Community
image: https://slack.cloudposse.com/badge.svg
url: https://slack.cloudposse.com
usage: |-
Create a GitHub Personal Access Token that has `admin:repo_hook` for full control of repository hooks; in otherwords, we need `write:repo_hook` to write repository hooks and `read:repo_hook` to read repository hooks.
Expand All @@ -47,32 +27,27 @@ usage: |-
events = ["issues"]
}
```
include:
- "docs/targets.md"
- "docs/terraform.md"

- docs/targets.md
- docs/terraform.md
related:
- name: "terraform-aws-cicd"
description: "Terraform Module for CI/CD with AWS Code Pipeline and Code Build"
url: "https://github.com/cloudposse/terraform-aws-cicd"
- name: "terraform-aws-codebuild"
description: "Terraform Module to easily leverage AWS CodeBuild for Continuous Integration"
url: "https://github.com/cloudposse/terraform-aws-codebuild"

- name: terraform-aws-cicd
description: Terraform Module for CI/CD with AWS Code Pipeline and Code Build
url: https://github.com/cloudposse/terraform-aws-cicd
- name: terraform-aws-codebuild
description: Terraform Module to easily leverage AWS CodeBuild for Continuous Integration
url: https://github.com/cloudposse/terraform-aws-codebuild
references:
- name: "GitHub Event Types"
description: "The list of supported event types which can trigger a webhook"
url: "https://developer.github.com/v3/activity/events/types/"
- name: "GitHub Hook Types"
description: "The type of the webhooks."
url: "https://api.github.com/hooks"

# Contributors to this project
- name: GitHub Event Types
description: The list of supported event types which can trigger a webhook
url: https://developer.github.com/v3/activity/events/types/
- name: GitHub Hook Types
description: The type of the webhooks.
url: https://api.github.com/hooks
contributors:
- name: "Erik Osterman"
github: "osterman"
- name: "Igor Rodionov"
github: "goruha"
- name: "Andriy Knysh"
github: "aknysh"
- name: Erik Osterman
github: osterman
- name: Igor Rodionov
github: goruha
- name: Andriy Knysh
github: aknysh
2 changes: 1 addition & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Name | Version |
|------|---------|
| terraform | ~> 0.12.0 |
| terraform | >= 0.12.0 |
| github | ~> 2.8.0 |
| local | ~> 1.2 |

Expand Down
92 changes: 0 additions & 92 deletions test/src/Gopkg.lock

This file was deleted.

7 changes: 0 additions & 7 deletions test/src/Gopkg.toml

This file was deleted.

48 changes: 14 additions & 34 deletions test/src/Makefile
Original file line number Diff line number Diff line change
@@ -1,50 +1,30 @@
PACKAGE = terraform-github-repository-webhooks
GOEXE ?= /usr/bin/go
GOPATH = $(CURDIR)/.gopath
GOBIN = $(GOPATH)/bin
BASE = $(GOPATH)/src/$(PACKAGE)
PATH := $(PATH):$(GOBIN)

export TF_DATA_DIR ?= $(CURDIR)/.terraform
export TF_CLI_ARGS_init ?= -get-plugins=true
export GOPATH
export TERRAFORM_VERSION ?= $(shell curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version' | cut -d. -f1-2)

.DEFAULT_GOAL : all

.PHONY: all
## Default target
all: test

ifneq (,$(wildcard /sbin/apk))
## Install go, if not installed
$(GOEXE):
apk add --update go
endif

ifeq ($(shell uname -s),Linux)
## Install all `dep`, if not installed
$(GOBIN)/dep:
@mkdir -p $(GOBIN)
@curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
endif

## Prepare the GOPATH
$(BASE): $(GOEXE)
@mkdir -p $(dir $@)
@ln -sf $(CURDIR) $@

## Download vendor dependencies to vendor/
$(BASE)/vendor: $(BASE) $(GOBIN)/dep
cd $(BASE) && dep ensure

.PHONY : init
## Initialize tests
init: $(BASE)/vendor
init:
@exit 0

.PHONY : test
## Run tests
test: init
cd $(BASE) && go test -v -timeout 30m -run TestExamplesComplete
go mod download
go test -v -timeout 60m -run TestExamplesComplete

## Run tests in docker container
docker/test:
docker run --name terratest --rm -it -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e GITHUB_TOKEN \
-e PATH="/usr/local/terraform/$(TERRAFORM_VERSION)/bin:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
-v $(CURDIR)/../../:/module/ cloudposse/test-harness:latest -C /module/test/src test

.PHONY : clean
## Clean up files
clean:
rm -rf .gopath/ vendor/ $(TF_DATA_DIR)
rm -rf ../../examples/complete/*.tfstate*
14 changes: 14 additions & 0 deletions test/src/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module github.com/cloudposse/terraform-github-repository-webhooks

go 1.13

require (
github.com/aws/aws-sdk-go v1.34.7 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/uuid v1.1.1 // indirect
github.com/gruntwork-io/terratest v0.16.0
github.com/pquerna/otp v1.2.0 // indirect
github.com/stretchr/testify v1.5.1
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f // indirect
golang.org/x/sys v0.0.0-20190527104216-9cd6430ef91e // indirect
)
Loading

0 comments on commit f651035

Please sign in to comment.