Skip to content

Commit 75fa811

Browse files
committed
Fixes #9: Add support for Terraform 0.12
#9 Fixed helper scripts, tests. Cleanup
1 parent aa3ae39 commit 75fa811

File tree

13 files changed

+797
-99
lines changed

13 files changed

+797
-99
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ terraform.tfstate
44
credentials.json
55
*.iml
66
.idea
7+
*.pyc
8+
.kitchen
79

810
examples/**/*.zip
911
examples/**/terraform.tfvars

Makefile

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ DOCKER_TAG_BASE_KITCHEN_TERRAFORM ?= 0.11.11_235.0.0_1.19.1_0.1.10
2222
DOCKER_REPO_BASE_KITCHEN_TERRAFORM := ${DOCKER_ORG}/cft/kitchen-terraform:${DOCKER_TAG_BASE_KITCHEN_TERRAFORM}
2323

2424
# All is the first target in the file so it will get picked up when you just run 'make' on its own
25-
all: check_shell check_python check_golang check_terraform check_docker check_base_files test_check_headers check_headers check_trailing_whitespace generate_docs
25+
all: check generate_docs
26+
27+
.PHONY: check
28+
check: check_shell check_python check_golang check_terraform check_docker check_base_files test_check_headers check_headers check_trailing_whitespace
29+
2630

2731
# The .PHONY directive tells make that this isn't a real target and so
2832
# the presence of a file named 'check_shell' won't cause this target to stop
@@ -82,53 +86,59 @@ version:
8286
.PHONY: docker_run
8387
docker_run:
8488
docker run --rm -it \
85-
-e CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=${CREDENTIALS_PATH} \
89+
-e PROJECT_ID \
90+
-e SERVICE_ACCOUNT_JSON \
8691
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
87-
-e TF_VAR_project_id \
8892
-v $(CURDIR):/cft/workdir \
8993
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
90-
/bin/bash
94+
/bin/bash -c "source test/ci_integration.sh && setup_environment && exec /bin/bash"
9195

9296
.PHONY: docker_create
9397
docker_create:
9498
docker run --rm -it \
95-
-e CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=${CREDENTIALS_PATH} \
99+
-e PROJECT_ID \
100+
-e SERVICE_ACCOUNT_JSON \
96101
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
97-
-e TF_VAR_project_id \
98102
-v $(CURDIR):/cft/workdir \
99103
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
100-
/bin/bash -c "kitchen create"
104+
/bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen create"
101105

102106
.PHONY: docker_converge
103107
docker_converge:
104108
docker run --rm -it \
105-
-e CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=${CREDENTIALS_PATH} \
109+
-e PROJECT_ID \
110+
-e SERVICE_ACCOUNT_JSON \
106111
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
107-
-e TF_VAR_project_id \
108112
-v $(CURDIR):/cft/workdir \
109113
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
110-
/bin/bash -c "kitchen converge && kitchen converge"
114+
/bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen converge"
111115

112116
.PHONY: docker_verify
113117
docker_verify:
114118
docker run --rm -it \
115-
-e CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=${CREDENTIALS_PATH} \
119+
-e PROJECT_ID \
120+
-e SERVICE_ACCOUNT_JSON \
116121
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
117-
-e TF_VAR_project_id \
118122
-v $(CURDIR):/cft/workdir \
119123
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
120-
/bin/bash -c "kitchen verify"
124+
/bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen verify"
121125

122126
.PHONY: docker_destroy
123127
docker_destroy:
124128
docker run --rm -it \
125-
-e CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=${CREDENTIALS_PATH} \
129+
-e PROJECT_ID \
130+
-e SERVICE_ACCOUNT_JSON \
126131
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
127-
-e TF_VAR_project_id \
128132
-v $(CURDIR):/cft/workdir \
129133
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
130-
/bin/bash -c "kitchen destroy"
134+
/bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen destroy"
131135

132136
.PHONY: test_integration_docker
133-
test_integration_docker: docker_create docker_converge docker_verify docker_destroy
134-
@echo "Running test-kitchen tests in docker"
137+
test_integration_docker:
138+
docker run --rm -it \
139+
-e PROJECT_ID \
140+
-e SERVICE_ACCOUNT_JSON \
141+
-e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \
142+
-v $(CURDIR):/cft/workdir \
143+
${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \
144+
make test_integration

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ Then perform the following commands on the root folder:
6666
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) plugin v2.1
6767

6868
### App Engine
69-
Note that this module requires App Engine being configured in the specified project/region.
69+
Note that this module requires App Engine being configured in the specified project/region.
7070
This is because Google Cloud Scheduler is dependent on the project being configured with App Engine.
71-
Refer to the [Google Cloud Scheduler documentation](https://cloud.google.com/scheduler/docs/) for more information on the App Engine dependency.
71+
Refer to the [Google Cloud Scheduler documentation](https://cloud.google.com/scheduler/docs/) for more
72+
information on the App Engine dependency.
7273

73-
The recommended way to create projects with App Engine enabled is via the [Project Factory module](https://github.com/terraform-google-modules/terraform-google-project-factory).
74+
The recommended way to create projects with App Engine enabled is via the [Project Factory module](https://github.com/terraform-google-modules/terraform-google-project-factory).
7475
There is an example of how to create the project [within that module](https://github.com/terraform-google-modules/terraform-google-project-factory/tree/master/examples/app_engine)
7576

7677
### Configure a Service Account

examples/pubsub_scheduled/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This example module schedules a job to publish a message to a Pub/Sub topic every 5 minutes, which will trigger a CloudFunctions function.
44

5-
Running this module requires an App Engine app in the specified project/region, which is not handled by this example.
5+
Running this module requires an App Engine app in the specified project/region, which is not handled by this example.
66
More information is in the [root readme](../../README.md#app-engine).
77

88
[^]: (autogen_docs_start)
-869 Bytes
Binary file not shown.

helpers/combine_docfiles.py

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)