Skip to content

Commit f651035

Browse files
authored
Additional TF 0.13 Fixes (#23)
1 parent 63e7aee commit f651035

File tree

12 files changed

+159
-209
lines changed

12 files changed

+159
-209
lines changed

.github/auto-release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: '$RESOLVED_VERSION'
3+
version-template: '$MAJOR.$MINOR.$PATCH'
4+
version-resolver:
5+
major:
6+
labels:
7+
- 'major'
8+
minor:
9+
labels:
10+
- 'minor'
11+
- 'enhancement'
12+
patch:
13+
labels:
14+
- 'patch'
15+
- 'fix'
16+
- 'bugfix'
17+
- 'bug'
18+
- 'hotfix'
19+
default: 'minor'
20+
21+
categories:
22+
- title: '🚀 Enhancements'
23+
labels:
24+
- 'enhancement'
25+
- title: '🐛 Bug Fixes'
26+
labels:
27+
- 'fix'
28+
- 'bugfix'
29+
- 'bug'
30+
- 'hotfix'
31+
32+
change-template: |
33+
<details>
34+
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
35+
36+
$BODY
37+
</details>
38+
39+
template: |
40+
$CHANGES

.github/workflows/auto-release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: auto-release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
semver:
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Drafts your next Release notes as Pull Requests are merged into "master"
13+
- uses: release-drafter/release-drafter@v5
14+
with:
15+
publish: true
16+
prerelease: false
17+
config-name: auto-release.yml
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/slash-command-dispatch.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# terraform-github-repository-webhooks
22

3-
[![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)
3+
[![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)
44

55
[![README Header][readme_header_img]][readme_header_link]
66

@@ -106,7 +106,7 @@ Available targets:
106106

107107
| Name | Version |
108108
|------|---------|
109-
| terraform | ~> 0.12.0 |
109+
| terraform | >= 0.12.0 |
110110
| github | ~> 2.8.0 |
111111
| local | ~> 1.2 |
112112

README.yaml

Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,16 @@
1-
---
2-
#
3-
# This is the canonical configuration for the `README.md`
4-
# Run `make readme` to rebuild the `README.md`
5-
#
6-
7-
# Name of this project
81
name: terraform-github-repository-webhooks
9-
10-
# License of this project
11-
license: "APACHE2"
12-
13-
# Canonical GitHub repo
2+
license: APACHE2
143
github_repo: cloudposse/terraform-github-repository-webhooks
15-
16-
# Short description of this project
174
description: |-
185
Terraform module to provision webhooks on a set of GitHub repositories.
196
This is useful if you need to register a webhook en masse across dozens of repositories.
20-
21-
# Badges to display
227
badges:
23-
- name: "Codefresh Build Status"
24-
image: "https://g.codefresh.io/api/badges/pipeline/cloudposse/terraform-modules%2Fterraform-github-repository-webhooks?type=cf-1"
25-
url: "https://g.codefresh.io/public/accounts/cloudposse/pipelines/5d1bcc1a1bde727a7172235e"
26-
- name: "Latest Release"
27-
image: "https://img.shields.io/github/release/cloudposse/terraform-github-repository-webhooks.svg"
28-
url: "https://github.com/cloudposse/terraform-github-repository-webhooks/releases/latest"
29-
- name: "Slack Community"
30-
image: "https://slack.cloudposse.com/badge.svg"
31-
url: "https://slack.cloudposse.com"
32-
33-
# How to use this project
8+
- name: Latest Release
9+
image: https://img.shields.io/github/release/cloudposse/terraform-github-repository-webhooks.svg
10+
url: https://github.com/cloudposse/terraform-github-repository-webhooks/releases/latest
11+
- name: Slack Community
12+
image: https://slack.cloudposse.com/badge.svg
13+
url: https://slack.cloudposse.com
3414
usage: |-
3515
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.
3616
@@ -47,32 +27,27 @@ usage: |-
4727
events = ["issues"]
4828
}
4929
```
50-
5130
include:
52-
- "docs/targets.md"
53-
- "docs/terraform.md"
54-
31+
- docs/targets.md
32+
- docs/terraform.md
5533
related:
56-
- name: "terraform-aws-cicd"
57-
description: "Terraform Module for CI/CD with AWS Code Pipeline and Code Build"
58-
url: "https://github.com/cloudposse/terraform-aws-cicd"
59-
- name: "terraform-aws-codebuild"
60-
description: "Terraform Module to easily leverage AWS CodeBuild for Continuous Integration"
61-
url: "https://github.com/cloudposse/terraform-aws-codebuild"
62-
34+
- name: terraform-aws-cicd
35+
description: Terraform Module for CI/CD with AWS Code Pipeline and Code Build
36+
url: https://github.com/cloudposse/terraform-aws-cicd
37+
- name: terraform-aws-codebuild
38+
description: Terraform Module to easily leverage AWS CodeBuild for Continuous Integration
39+
url: https://github.com/cloudposse/terraform-aws-codebuild
6340
references:
64-
- name: "GitHub Event Types"
65-
description: "The list of supported event types which can trigger a webhook"
66-
url: "https://developer.github.com/v3/activity/events/types/"
67-
- name: "GitHub Hook Types"
68-
description: "The type of the webhooks."
69-
url: "https://api.github.com/hooks"
70-
71-
# Contributors to this project
41+
- name: GitHub Event Types
42+
description: The list of supported event types which can trigger a webhook
43+
url: https://developer.github.com/v3/activity/events/types/
44+
- name: GitHub Hook Types
45+
description: The type of the webhooks.
46+
url: https://api.github.com/hooks
7247
contributors:
73-
- name: "Erik Osterman"
74-
github: "osterman"
75-
- name: "Igor Rodionov"
76-
github: "goruha"
77-
- name: "Andriy Knysh"
78-
github: "aknysh"
48+
- name: Erik Osterman
49+
github: osterman
50+
- name: Igor Rodionov
51+
github: goruha
52+
- name: Andriy Knysh
53+
github: aknysh

docs/terraform.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| Name | Version |
44
|------|---------|
5-
| terraform | ~> 0.12.0 |
5+
| terraform | >= 0.12.0 |
66
| github | ~> 2.8.0 |
77
| local | ~> 1.2 |
88

test/src/Gopkg.lock

Lines changed: 0 additions & 92 deletions
This file was deleted.

test/src/Gopkg.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/src/Makefile

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,30 @@
1-
PACKAGE = terraform-github-repository-webhooks
2-
GOEXE ?= /usr/bin/go
3-
GOPATH = $(CURDIR)/.gopath
4-
GOBIN = $(GOPATH)/bin
5-
BASE = $(GOPATH)/src/$(PACKAGE)
6-
PATH := $(PATH):$(GOBIN)
7-
8-
export TF_DATA_DIR ?= $(CURDIR)/.terraform
91
export TF_CLI_ARGS_init ?= -get-plugins=true
10-
export GOPATH
2+
export TERRAFORM_VERSION ?= $(shell curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version' | cut -d. -f1-2)
3+
4+
.DEFAULT_GOAL : all
115

126
.PHONY: all
137
## Default target
148
all: test
159

16-
ifneq (,$(wildcard /sbin/apk))
17-
## Install go, if not installed
18-
$(GOEXE):
19-
apk add --update go
20-
endif
21-
22-
ifeq ($(shell uname -s),Linux)
23-
## Install all `dep`, if not installed
24-
$(GOBIN)/dep:
25-
@mkdir -p $(GOBIN)
26-
@curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
27-
endif
28-
29-
## Prepare the GOPATH
30-
$(BASE): $(GOEXE)
31-
@mkdir -p $(dir $@)
32-
@ln -sf $(CURDIR) $@
33-
34-
## Download vendor dependencies to vendor/
35-
$(BASE)/vendor: $(BASE) $(GOBIN)/dep
36-
cd $(BASE) && dep ensure
37-
3810
.PHONY : init
3911
## Initialize tests
40-
init: $(BASE)/vendor
12+
init:
13+
@exit 0
4114

4215
.PHONY : test
4316
## Run tests
4417
test: init
45-
cd $(BASE) && go test -v -timeout 30m -run TestExamplesComplete
18+
go mod download
19+
go test -v -timeout 60m -run TestExamplesComplete
20+
21+
## Run tests in docker container
22+
docker/test:
23+
docker run --name terratest --rm -it -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e GITHUB_TOKEN \
24+
-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" \
25+
-v $(CURDIR)/../../:/module/ cloudposse/test-harness:latest -C /module/test/src test
4626

4727
.PHONY : clean
4828
## Clean up files
4929
clean:
50-
rm -rf .gopath/ vendor/ $(TF_DATA_DIR)
30+
rm -rf ../../examples/complete/*.tfstate*

test/src/go.mod

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module github.com/cloudposse/terraform-github-repository-webhooks
2+
3+
go 1.13
4+
5+
require (
6+
github.com/aws/aws-sdk-go v1.34.7 // indirect
7+
github.com/davecgh/go-spew v1.1.1 // indirect
8+
github.com/google/uuid v1.1.1 // indirect
9+
github.com/gruntwork-io/terratest v0.16.0
10+
github.com/pquerna/otp v1.2.0 // indirect
11+
github.com/stretchr/testify v1.5.1
12+
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f // indirect
13+
golang.org/x/sys v0.0.0-20190527104216-9cd6430ef91e // indirect
14+
)

0 commit comments

Comments
 (0)