From bb903524ee091c35bd7c294e42d9aaf350250f20 Mon Sep 17 00:00:00 2001 From: Kyle Galbraith Date: Thu, 28 Jun 2018 13:58:48 -0700 Subject: [PATCH] add sample buildspec files --- examples/basic-example/README.md | 5 +- examples/basic-example/buildspec.yml | 14 +++++ examples/basic-example/buildspec_test.yml | 17 ++++++ examples/basic-example/variables.tf | 70 +++++++++++++++++++++++ 4 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 examples/basic-example/buildspec.yml create mode 100644 examples/basic-example/buildspec_test.yml create mode 100644 examples/basic-example/variables.tf diff --git a/examples/basic-example/README.md b/examples/basic-example/README.md index 38711df..6768e78 100644 --- a/examples/basic-example/README.md +++ b/examples/basic-example/README.md @@ -15,4 +15,7 @@ $>cd slalom-devops $>echo 'hello world' > touch.txt $>git commit -a -m 'init master' $>git push -u origin master -``` \ No newline at end of file +``` + +### 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. \ No newline at end of file diff --git a/examples/basic-example/buildspec.yml b/examples/basic-example/buildspec.yml new file mode 100644 index 0000000..983f82e --- /dev/null +++ b/examples/basic-example/buildspec.yml @@ -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" \ No newline at end of file diff --git a/examples/basic-example/buildspec_test.yml b/examples/basic-example/buildspec_test.yml new file mode 100644 index 0000000..b4e5dfe --- /dev/null +++ b/examples/basic-example/buildspec_test.yml @@ -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: + - '**/*' \ No newline at end of file diff --git a/examples/basic-example/variables.tf b/examples/basic-example/variables.tf new file mode 100644 index 0000000..5f5f5a7 --- /dev/null +++ b/examples/basic-example/variables.tf @@ -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" +}