generated from snout-router/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
repos-unique.tf
154 lines (122 loc) · 4.17 KB
/
repos-unique.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
resource "github_repository" "dot_github" {
archive_on_destroy = true
name = ".github"
description = "The community health files for the Snout organization"
homepage_url = module.constants.primary_url
has_issues = true
has_projects = false
has_wiki = false
delete_branch_on_merge = true
vulnerability_alerts = true
}
data "github_repository" "dot_github" {
depends_on = [
github_repository.dot_github
]
name = github_repository.dot_github.name
}
resource "github_branch_protection" "dot_github_default_branch" {
repository_id = github_repository.dot_github.node_id
pattern = data.github_repository.dot_github.default_branch
enforce_admins = true
}
resource "github_repository_file" "dot_github_license" {
commit_author = module.constants.committer.name
commit_email = module.constants.committer.email
repository = github_repository.dot_github.name
file = "LICENSE"
content = module.constants.license
commit_message = "Update license"
overwrite_on_create = true
}
resource "github_repository_file" "dot_github_dot_github_renovate_json" {
commit_author = module.constants.committer.name
commit_email = module.constants.committer.email
repository = github_repository.dot_github.name
file = ".github/renovate.json"
commit_message = "Update Renovate configuration"
overwrite_on_create = true
content = templatefile("dot-github/renovate.json", {
org = module.constants.org
})
}
module "dot_github_issue_labels" {
source = "./modules/issue-labels"
repository = github_repository.dot_github.name
}
resource "github_repository" "dot_github_dot_io" {
archive_on_destroy = true
name = "${module.constants.org}.github.io"
description = "The Snout website"
homepage_url = module.constants.primary_url
has_issues = false
has_projects = false
has_wiki = false
delete_branch_on_merge = true
vulnerability_alerts = true
template {
owner = local.template.owner
repository = local.template.repository
}
pages {
cname = module.constants.primary_domain
source {
branch = "main"
}
}
}
data "github_repository" "dot_github_dot_io" {
depends_on = [
github_repository.dot_github_dot_io
]
name = github_repository.dot_github_dot_io.name
}
resource "github_branch_protection" "dot_github_dot_io_default_branch" {
repository_id = github_repository.dot_github_dot_io.node_id
pattern = data.github_repository.dot_github_dot_io.default_branch
enforce_admins = true
}
resource "github_repository_file" "dot_github_dot_io_license" {
commit_author = module.constants.committer.name
commit_email = module.constants.committer.email
repository = github_repository.dot_github_dot_io.name
file = "LICENSE"
content = module.constants.license
commit_message = "Update license"
overwrite_on_create = true
}
resource "github_repository" "renovate" {
archive_on_destroy = true
name = "renovate"
description = "Self-hosted Renovate for Snout"
homepage_url = "https://github.com/snout-router/renovate/actions/workflows/renovate.yml"
has_issues = true
has_projects = false
has_wiki = false
delete_branch_on_merge = true
vulnerability_alerts = true
}
data "github_repository" "renovate" {
depends_on = [
github_repository.renovate
]
name = github_repository.renovate.name
}
resource "github_branch_protection" "renovate_default_branch" {
repository_id = github_repository.renovate.node_id
pattern = data.github_repository.renovate.default_branch
enforce_admins = true
}
resource "github_repository_file" "renovate_license" {
commit_author = module.constants.committer.name
commit_email = module.constants.committer.email
repository = github_repository.renovate.name
file = "LICENSE"
content = module.constants.license
commit_message = "Update license"
overwrite_on_create = true
}
module "renovate_labels" {
source = "./modules/issue-labels"
repository = github_repository.renovate.name
}