-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
106 lines (98 loc) · 2.62 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
resource "github_repository" "twindb_repo" {
name = "${var.name}"
description = "${var.description}"
homepage_url = "${var.homepage_url}"
has_downloads = "${var.has_downloads}"
has_issues = "${var.has_issues}"
private = "${var.private}"
allow_rebase_merge = "${var.allow_rebase_merge}"
allow_squash_merge = "${var.allow_squash_merge}"
}
resource "github_branch_protection" "default_branch" {
count = "${var.has_branch_protection}"
repository = "${github_repository.twindb_repo.name}"
branch = "${var.default_branch}"
enforce_admins = true
required_status_checks = {
strict = true
contexts = [
"Travis CI - Branch",
"Travis CI - Pull Request"
]
}
}
resource "github_repository_webhook" "slack" {
events = [
"*"
]
name = "web"
repository = "${github_repository.twindb_repo.name}"
configuration {
url = "${var.slack_url}"
content_type = "json"
insecure_ssl = false
}
}
resource "github_repository_webhook" "rtd" {
count = "${var.has_documentation}"
events = [
"create",
"delete",
"push",
"pull_request"
]
name = "web"
repository = "${github_repository.twindb_repo.name}"
configuration {
url = "${var.rtd_url}"
content_type = "json"
insecure_ssl = false
}
}
resource "github_repository_webhook" "travis-ci" {
count = "${var.has_travis}"
events = [
"create",
"delete",
"issue_comment",
"member",
"public",
"pull_request",
"push",
"repository"
]
name = "web"
repository = "${github_repository.twindb_repo.name}"
configuration {
url = "https://notify.travis-ci.org"
content_type = "form"
insecure_ssl = false
}
}
resource "github_repository_webhook" "registry_docker_hub" {
count = "${var.has_docker_hub}"
events = [
"push"
]
name = "web"
repository = "${github_repository.twindb_repo.name}"
configuration {
url = "https://registry.hub.docker.com/hooks/github"
content_type = "json"
insecure_ssl = false
}
}
resource "github_repository_webhook" "cloud_docker_hub" {
count = "${var.has_docker_hub}"
events = [
"pull_request",
"push"
]
name = "web"
repository = "${github_repository.twindb_repo.name}"
configuration {
url = "${var.docker_hub_url}"
content_type = "json"
insecure_ssl = false
}
}