forked from hashicorp/consul
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade to terraform 0.12 * Add terraform to the Test.dockerfile * Add CircleCI config * Rename .circleci/config.yaml to .circleci/config.yml * Use env variable for the terraform version * Switch to hashicorpdev/consul-helm-test Docker image * Specify directory for terraform commands Also, add a clarifying comment describing which image is being used * Update .circleci/config.yml Co-Authored-By: Luke Kysow <1034429+lkysow@users.noreply.github.com> * Only run acceptance tests on the changes to master Plus, minor changes to terraform commands. * Split out acceptance tests into multiple steps for clarity * use multiple steps rather than a single step * 'terraform destroy' step runs always, even if previous steps fail * decrease GKE cluster node pool from 5 to 3 to make spin ups faster * wait for Helm to initialize to make sure tiller is ready * use the latest consul-helm-test docker image
- Loading branch information
Showing
4 changed files
with
74 additions
and
17 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 @@ | ||
version: 2 | ||
jobs: | ||
unit: | ||
docker: | ||
# This image is built from test/docker/Test.dockerfile | ||
- image: hashicorpdev/consul-helm-test:0.3.0 | ||
|
||
steps: | ||
- checkout | ||
|
||
- run: | ||
name: Run Unit Tests | ||
command: bats ./test/unit | ||
|
||
acceptance: | ||
docker: | ||
# This image is build from test/docker/Test.dockerfile | ||
- image: hashicorpdev/consul-helm-test:0.3.0 | ||
|
||
steps: | ||
- checkout | ||
|
||
- run: | ||
name: terraform init & apply | ||
command: | | ||
terraform init test/terraform | ||
echo "${GOOGLE_CREDENTIALS}" | gcloud auth activate-service-account --key-file=- | ||
terraform apply -var project=${CLOUDSDK_CORE_PROJECT} -var init_cli=true -auto-approve test/terraform | ||
- run: | ||
name: Run acceptance tests | ||
command: bats ./test/acceptance | ||
|
||
- run: | ||
name: terraform destroy | ||
command: | | ||
terraform destroy -auto-approve | ||
when: always | ||
|
||
workflows: | ||
version: 2 | ||
test: | ||
jobs: | ||
- unit | ||
- acceptance: | ||
requires: | ||
- unit | ||
filters: | ||
branches: | ||
only: master |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
output "cluster_id" { | ||
value = "${google_container_cluster.cluster.id}" | ||
value = google_container_cluster.cluster.id | ||
} | ||
|
||
output "cluster_name" { | ||
value = "${google_container_cluster.cluster.name}" | ||
value = google_container_cluster.cluster.name | ||
} |