Skip to content

Commit

Permalink
add sample buildspec files
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegalbraith committed Jun 28, 2018
1 parent 16f863d commit bb90352
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/basic-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ $>cd slalom-devops
$>echo 'hello world' > touch.txt
$>git commit -a -m 'init master'
$>git push -u origin master
```
```

### Sample buildspec files
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.
14 changes: 14 additions & 0 deletions examples/basic-example/buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 0.2
phases:
install:
commands:
- echo "install step"
pre_build:
commands:
- echo "pre_build step"
build:
commands:
- echo "build command"
post_build:
commands:
- echo "post_build step"
17 changes: 17 additions & 0 deletions examples/basic-example/buildspec_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 0.2
phases:
install:
commands:
- echo "install step"
pre_build:
commands:
- echo "pre_build step"
build:
commands:
- echo "skip build step"
post_build:
commands:
- echo "post_build step"
artifacts:
files:
- '**/*'
70 changes: 70 additions & 0 deletions examples/basic-example/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# ---------------------------------------------------------------------------------------------------------------------
# ENVIRONMENT VARIABLES
# Define these secrets as environment variables
# ---------------------------------------------------------------------------------------------------------------------
# AWS_ACCESS_KEY_ID
# AWS_SECRET_ACCESS_KEY
# ---------------------------------------------------------------------------------------------------------------------

# OPTIONAL PARAMETERS
# These parameters have reasonable defaults.
# ---------------------------------------------------------------------------------------------------------------------
variable "aws_region" {
description = "The AWS region to deploy into (default: us-west-2)."
default = "us-west-2"
}

variable "organization_name" {
description = "The organization name provisioning the template (e.g. acme)"
default = "acme"
}

variable "char_delimiter" {
description = "The delimiter to use for unique names (default: -)"
default = "-"
}

variable "repo_name" {
description = "The name of the CodeCommit repository (e.g. new-repo)."
default = ""
}

variable "repo_default_branch" {
description = "The name of the default repository branch (default: master)"
default = "master"
}

variable "force_artifact_destroy" {
description = "Force the removal of the artifact S3 bucket on destroy (default: false)."
default = "false"
}

variable "environment" {
description = "The environment being deployed (default: dev)"
default = "dev"
}

variable "build_timeout" {
description = "The time to wait for a CodeBuild to complete before timing out in minutes (default: 5)"
default = "5"
}

variable "build_compute_type" {
description = "The build instance type for CodeBuild (default: BUILD_GENERAL1_SMALL)"
default = "BUILD_GENERAL1_SMALL"
}

variable "build_image" {
description = "The build image for CodeBuild to use (default: aws/codebuild/nodejs:6.3.1)"
default = "aws/codebuild/nodejs:6.3.1"
}

variable "test_buildspec" {
description = "The buildspec to be used for the Test stage (default: buildspec_test.yml)"
default = "buildspec_test.yml"
}

variable "package_buildspec" {
description = "The buildspec to be used for the Package stage (default: buildspec.yml)"
default = "buildspec.yml"
}

0 comments on commit bb90352

Please sign in to comment.