Skip to content
This repository was archived by the owner on Apr 18, 2020. It is now read-only.

Commit 9b5bb71

Browse files
committed
Adjusted README
1 parent c5062e6 commit 9b5bb71

File tree

4 files changed

+17
-100
lines changed

4 files changed

+17
-100
lines changed

README.md

Lines changed: 12 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,15 @@
99
[github-image]: https://img.shields.io/github/release/squidfunk/terraform-aws-github-ci.svg
1010
[github-link]: https://github.com/squidfunk/terraform-aws-github-ci/releases
1111

12-
# Terraform AWS GitHub CI
12+
# Terraform AWS GitHub CI <small style="color: #f44336">DEPRECATED</small>
13+
14+
> This project has been deprecated, as AWS CodeBuild now natively supports
15+
> automatic builds on new commits and reports status back to GitHub. However,
16+
> it may serve as a template for anyone trying to get AWS CodeBuild working.
1317
1418
A Terraform module to setup a serverless GitHub CI build environment with pull
1519
request and build status support using AWS CodeBuild.
1620

17-
## Architecture
18-
19-
![Architecture][1]
20-
21-
[1]: assets/architecture.png
22-
23-
This module registers a GitHub webhook which is triggered for `push` and
24-
`pull_request` events and starts the build for the respective branch. All
25-
builds run in parallel. The build progress and status for a respective commit
26-
is reported back to GitHub.
27-
28-
### Cost
29-
30-
Building with this CI server is unbelievably cheap - you only pay what you use.
31-
Pricings starts at **$ 0,005 per build minute**, and AWS CodeBuild offers 100
32-
free build minutes every month. The price for the other services (Lambda, SNS,
33-
S3 and CloudWatch) are negligible and should only add a few cents to your
34-
monthly bill. Compare that to the $ 69 that services like Travis cost every
35-
month, regardless of how much you use them.
36-
3721
## Usage
3822

3923
You need an AWS and GitHub account and a repository you want to be built. The
@@ -53,7 +37,7 @@ Next, add the following module to your Terraform configuration and apply it:
5337
``` hcl
5438
module "github_ci" {
5539
source = "github.com/squidfunk/terraform-aws-github-ci"
56-
version = "0.6.0"
40+
version = "1.0.0"
5741
5842
namespace = "<namespace>"
5943
github_owner = "<owner>"
@@ -107,50 +91,38 @@ The following variables can be configured:
10791

10892
### Optional
10993

110-
#### `github_reporter`
111-
112-
- **Description**: GitHub commit status reporter
113-
- **Default**: `"AWS CodeBuild"`
114-
115-
#### `codebuild_project`
116-
117-
- **Description**: CodeBuild project name (won't create [default project][7])
118-
- **Default**: `""`
119-
- **Conflicts with**: `codebuild_compute_type`, `codebuild_image`,
120-
`codebuild_buildspec`
121-
122-
[7]: #default-project
123-
12494
#### `codebuild_compute_type`
12595

12696
- **Description**: Compute resources used by the build
12797
- **Default**: `"BUILD_GENERAL1_SMALL"`
128-
- **Conflicts with**: `codebuild_project`
12998

13099
#### `codebuild_image`
131100

132101
- **Description**: Base image for provisioning (AWS Registry, Docker)
133102
- **Default**: `"aws/codebuild/ubuntu-base:14.04"`
134-
- **Conflicts with**: `codebuild_project`
135103

136104
#### `codebuild_buildspec`
137105

138106
- **Description**: Build specification file location ([file format][2])
139107
- **Default**: `"buildspec.yml"` (at repository root)
140-
- **Conflicts with**: `codebuild_project`
141108

142109
#### `codebuild_privileged_mode`
143110

144111
- **Description**: If set to true, enables running the Docker daemon inside a
145112
Docker container.
146113
- **Default**: `false`
147-
- **Conflicts with**: `codebuild_project`
148114

149115
#### `codebuild_bucket`
150116

151117
- **Description**: S3 bucket to store status badge and artifacts
152118
- **Default**: `"${var.namespace}"` (equal to namespace)
153119

120+
#### `codebuild_badge_enabled`
121+
122+
- **Description**: Generates a publicly-accessible URL for the projects build
123+
badge
124+
- **Default**: `true`
125+
154126
### Outputs
155127

156128
The following outputs are exported:
@@ -175,51 +147,6 @@ The following outputs are exported:
175147

176148
- **Description**: CodeBuild project URL
177149

178-
### Default project
179-
180-
If you need more control over the CodeBuild project, you can pass the name of
181-
an external CodeBuild project in this variable. This will avoid the creation
182-
of the default project which has the following configuration:
183-
184-
``` hcl
185-
resource "aws_codebuild_project" "codebuild" {
186-
name = "${var.github_repository}"
187-
188-
build_timeout = "5"
189-
service_role = "${aws_iam_role.codebuild.arn}"
190-
191-
source {
192-
type = "GITHUB"
193-
location = "https://github.com/$${owner}/$${repository}.git"
194-
195-
auth {
196-
type = "OAUTH"
197-
resource = "${var.github_oauth_token}"
198-
}
199-
}
200-
201-
environment {
202-
compute_type = "${var.codebuild_compute_type}"
203-
type = "LINUX_CONTAINER"
204-
image = "${var.codebuild_image}"
205-
}
206-
207-
artifacts {
208-
type = "S3"
209-
location = "${var.codebuild_bucket}"
210-
name = "${var.github_repository}"
211-
namespace_type = "BUILD_ID"
212-
packaging = "ZIP"
213-
}
214-
}
215-
```
216-
217-
The corresponding service role and the bucket are always created and exported
218-
as `codebuild_service_role_arn`, `codebuild_service_role_name` and
219-
`codebuild_bucket`. You can reference them in your CodeBuild resource
220-
definition, e.g. to attach further policies, and thus avoid the creation of
221-
your own service role and bucket.
222-
223150
## Limitations
224151

225152
This module first integrated with AWS CodePipeline but switched to CodeBuild,

main.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ resource "aws_s3_bucket" "_" {
9898

9999
# aws_codebuild_project._
100100
resource "aws_codebuild_project" "_" {
101-
count = "${length(var.codebuild_project) == 0 ? 1 : 0}"
102-
103101
name = "${var.github_repository}"
104102

105103
build_timeout = "5"

outputs.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ output "codebuild_bucket" {
3939

4040
# output.codebuild_badge_url
4141
output "codebuild_badge_url" {
42-
value = "${var.codebuild_badge_enabled == "true" ? aws_codebuild_project._.*.badge_url[0] : ""}"
42+
value = "${
43+
var.codebuild_badge_enabled == "true"
44+
? aws_codebuild_project._.*.badge_url[0]
45+
: ""
46+
}"
4347
}
4448

4549
# output.codebuild_url

variables.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,10 @@ variable "github_oauth_token" {
4646
description = "GitHub OAuth token for repository access"
4747
}
4848

49-
# var.github_reporter
50-
variable "github_reporter" {
51-
description = "GitHub commit status reporter"
52-
default = "AWS CodeBuild"
53-
}
54-
5549
# -----------------------------------------------------------------------------
5650
# Variables: CodeBuild
5751
# -----------------------------------------------------------------------------
5852

59-
# var.codebuild_project
60-
variable "codebuild_project" {
61-
description = "CodeBuild project name (won't create default project)"
62-
default = ""
63-
}
64-
6553
# var.codebuild_compute_type
6654
variable "codebuild_compute_type" {
6755
description = "Compute resources used by the build"

0 commit comments

Comments
 (0)