-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci-staging): provision codebuild project (#641)
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Manual steps required after provisioning a project: | ||
// - Connect the GitHub App of the organization, indicating the repositories. | ||
// - Set webhooks with event type `WORKFLOW_JOB_QUEUED` in the filter group. | ||
// | ||
// These manual steps are required because the terraform provider is missing | ||
// support for GitHub Actions runners. | ||
// See https://github.com/hashicorp/terraform-provider-aws/issues/39011 | ||
|
||
resource "aws_codebuild_project" "ubuntu_small" { | ||
name = "ubuntu-small" | ||
service_role = aws_iam_role.codebuild_role.arn | ||
|
||
artifacts { | ||
type = "NO_ARTIFACTS" | ||
} | ||
|
||
cache { | ||
type = "NO_CACHE" | ||
// TODO: evaluate if it's worth adding cache | ||
// modes = ["LOCAL_DOCKER_LAYER_CACHE", "LOCAL_SOURCE_CACHE"] | ||
} | ||
|
||
environment { | ||
compute_type = "BUILD_GENERAL1_SMALL" | ||
// ubuntu | ||
image = "aws/codebuild/standard:7.0-24.10.29" | ||
type = "LINUX_CONTAINER" | ||
image_pull_credentials_type = "CODEBUILD" | ||
|
||
// Whether to enable running the Docker daemon. | ||
// The Rust CI uses Docker to build linux artifacts, | ||
// so we need this if the target is linux. | ||
privileged_mode = true | ||
} | ||
|
||
// Disable cloudwatch logs for cost saving. | ||
// Logs are available in GitHub Actions. | ||
logs_config { | ||
cloudwatch_logs { | ||
status = "DISABLED" | ||
} | ||
} | ||
|
||
source { | ||
type = "GITHUB" | ||
// Dummy repository. | ||
// TODO: can we put the real repos even if we use github app? | ||
location = "https://github.com/rust-lang/infra-team.git" | ||
git_clone_depth = 1 | ||
} | ||
} |