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
1418A Terraform module to setup a serverless GitHub CI build environment with pull
1519request 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
3923You 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
5438module "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
156128The 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
225152This module first integrated with AWS CodePipeline but switched to CodeBuild,
0 commit comments