Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Commit bb90352

Browse files
committed
add sample buildspec files
1 parent 16f863d commit bb90352

File tree

4 files changed

+105
-1
lines changed

4 files changed

+105
-1
lines changed

examples/basic-example/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ $>cd slalom-devops
1515
$>echo 'hello world' > touch.txt
1616
$>git commit -a -m 'init master'
1717
$>git push -u origin master
18-
```
18+
```
19+
20+
### Sample buildspec files
21+
In this example directory there is `buildspec_test.yml` and `buildspec.yml`. These are sample build spec files you can add to the root of your new repository in CodeCommit. The test buildspec files contains the `artifacts` section that copies the entire repo to the build stage to be used there.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 0.2
2+
phases:
3+
install:
4+
commands:
5+
- echo "install step"
6+
pre_build:
7+
commands:
8+
- echo "pre_build step"
9+
build:
10+
commands:
11+
- echo "build command"
12+
post_build:
13+
commands:
14+
- echo "post_build step"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 0.2
2+
phases:
3+
install:
4+
commands:
5+
- echo "install step"
6+
pre_build:
7+
commands:
8+
- echo "pre_build step"
9+
build:
10+
commands:
11+
- echo "skip build step"
12+
post_build:
13+
commands:
14+
- echo "post_build step"
15+
artifacts:
16+
files:
17+
- '**/*'
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# ---------------------------------------------------------------------------------------------------------------------
2+
# ENVIRONMENT VARIABLES
3+
# Define these secrets as environment variables
4+
# ---------------------------------------------------------------------------------------------------------------------
5+
# AWS_ACCESS_KEY_ID
6+
# AWS_SECRET_ACCESS_KEY
7+
# ---------------------------------------------------------------------------------------------------------------------
8+
9+
# OPTIONAL PARAMETERS
10+
# These parameters have reasonable defaults.
11+
# ---------------------------------------------------------------------------------------------------------------------
12+
variable "aws_region" {
13+
description = "The AWS region to deploy into (default: us-west-2)."
14+
default = "us-west-2"
15+
}
16+
17+
variable "organization_name" {
18+
description = "The organization name provisioning the template (e.g. acme)"
19+
default = "acme"
20+
}
21+
22+
variable "char_delimiter" {
23+
description = "The delimiter to use for unique names (default: -)"
24+
default = "-"
25+
}
26+
27+
variable "repo_name" {
28+
description = "The name of the CodeCommit repository (e.g. new-repo)."
29+
default = ""
30+
}
31+
32+
variable "repo_default_branch" {
33+
description = "The name of the default repository branch (default: master)"
34+
default = "master"
35+
}
36+
37+
variable "force_artifact_destroy" {
38+
description = "Force the removal of the artifact S3 bucket on destroy (default: false)."
39+
default = "false"
40+
}
41+
42+
variable "environment" {
43+
description = "The environment being deployed (default: dev)"
44+
default = "dev"
45+
}
46+
47+
variable "build_timeout" {
48+
description = "The time to wait for a CodeBuild to complete before timing out in minutes (default: 5)"
49+
default = "5"
50+
}
51+
52+
variable "build_compute_type" {
53+
description = "The build instance type for CodeBuild (default: BUILD_GENERAL1_SMALL)"
54+
default = "BUILD_GENERAL1_SMALL"
55+
}
56+
57+
variable "build_image" {
58+
description = "The build image for CodeBuild to use (default: aws/codebuild/nodejs:6.3.1)"
59+
default = "aws/codebuild/nodejs:6.3.1"
60+
}
61+
62+
variable "test_buildspec" {
63+
description = "The buildspec to be used for the Test stage (default: buildspec_test.yml)"
64+
default = "buildspec_test.yml"
65+
}
66+
67+
variable "package_buildspec" {
68+
description = "The buildspec to be used for the Package stage (default: buildspec.yml)"
69+
default = "buildspec.yml"
70+
}

0 commit comments

Comments
 (0)