-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert to TF 0.12. Add tests. Add Codefresh test pipeline (#29)
* Convert to TF 0.12. Add tests. Add Codefresh test pipeline * Convert to TF 0.12. Add tests. Add Codefresh test pipeline * Convert to TF 0.12. Add tests. Add Codefresh test pipeline * Convert to TF 0.12. Add tests. Add Codefresh test pipeline
- Loading branch information
Showing
24 changed files
with
488 additions
and
190 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 |
---|---|---|
|
@@ -5,9 +5,6 @@ | |
*.tfstate | ||
*.tfstate.* | ||
|
||
# .tfvars files | ||
*.tfvars | ||
|
||
**/.idea | ||
**/*.iml | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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
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
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
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,74 @@ | ||
version: '1.0' | ||
|
||
stages: | ||
- Prepare | ||
- Test | ||
|
||
steps: | ||
wait: | ||
title: Wait | ||
stage: Prepare | ||
image: codefresh/cli:latest | ||
commands: | ||
- codefresh get builds --pipeline=${{CF_REPO_NAME}} --status running --limit 1000 -o json | jq --arg id ${{CF_BUILD_ID}} -ser 'flatten|.[-1].id==$id' | ||
retry: | ||
maxAttempts: 10 | ||
delay: 20 | ||
exponentialFactor: 1.1 | ||
|
||
main_clone: | ||
title: "Clone repository" | ||
type: git-clone | ||
stage: Prepare | ||
description: "Initialize" | ||
repo: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}} | ||
git: CF-default | ||
revision: ${{CF_REVISION}} | ||
|
||
clean_init: | ||
title: Prepare build-harness and test-harness | ||
image: ${{TEST_IMAGE}} | ||
stage: Prepare | ||
commands: | ||
- cf_export PATH="/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
- make init | ||
- git -C build-harness checkout master | ||
- make -C test/ clean init TEST_HARNESS_BRANCH=master | ||
- make -C test/src clean init | ||
- find . -type d -name '.terraform' | xargs rm -rf | ||
- find . -type f -name 'terraform.tfstate*' -exec rm -f {} \; | ||
|
||
test: | ||
type: "parallel" | ||
title: "Run tests" | ||
description: "Run all tests in parallel" | ||
stage: Test | ||
steps: | ||
test_readme_lint: | ||
title: "Test README.md updated" | ||
stage: "Test" | ||
image: ${{TEST_IMAGE}} | ||
description: Test "readme/lint" | ||
commands: | ||
- make readme/lint | ||
|
||
test_module: | ||
title: Test module with bats | ||
image: ${{TEST_IMAGE}} | ||
stage: Test | ||
commands: | ||
- make -C test/ module | ||
|
||
test_examples_complete: | ||
title: Test "examples/complete" with bats | ||
image: ${{TEST_IMAGE}} | ||
stage: Test | ||
commands: | ||
- make -C test/ examples/complete | ||
|
||
test_examples_complete_terratest: | ||
title: Test "examples/complete" with terratest | ||
image: ${{TEST_IMAGE}} | ||
stage: Test | ||
commands: | ||
- make -C test/src |
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
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,7 @@ | ||
region = "us-west-1" | ||
|
||
namespace = "eg" | ||
|
||
stage = "test" | ||
|
||
name = "ecr-test" |
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,10 @@ | ||
provider "aws" { | ||
region = var.region | ||
} | ||
|
||
module "ecr" { | ||
source = "../../" | ||
namespace = var.namespace | ||
stage = var.stage | ||
name = var.name | ||
} |
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,14 @@ | ||
output "registry_id" { | ||
value = module.ecr.registry_id | ||
description = "Registry ID" | ||
} | ||
|
||
output "registry_url" { | ||
value = module.ecr.registry_url | ||
description = "Registry URL" | ||
} | ||
|
||
output "repository_name" { | ||
value = module.ecr.repository_name | ||
description = "Registry name" | ||
} |
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,15 @@ | ||
variable "region" { | ||
type = string | ||
} | ||
|
||
variable "namespace" { | ||
type = string | ||
} | ||
|
||
variable "name" { | ||
type = string | ||
} | ||
|
||
variable "stage" { | ||
type = string | ||
} |
Oops, something went wrong.