Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit 21930ba

Browse files
authored
Add Terragrunt integration and general parser (#24)
* - add kw parser - add tg command methods * - add plan_all parse output progress - replace terra* command func cli params with **kw * add tgbinary to ci * - add tg shared doc string decorator - separate some of the public methods tg_xxx() | tf_xxx() - fix parse_args() styling * - Rollback parse_args() - Add tg global args to parse_args() - Add tg global args decorator - Add all param to tg_xxx methods * - mv tg flags before tf flags for cli args - add common tg args to tg methods * - fix tg source module warning - add output() fixture to tg test
1 parent d48599c commit 21930ba

File tree

6 files changed

+381
-51
lines changed

6 files changed

+381
-51
lines changed

.ci/cloudbuild.test.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ steps:
2323
wget https://releases.hashicorp.com/terraform/${_TERRAFORM_VERSION}/terraform_${_TERRAFORM_VERSION}_linux_amd64.zip &&
2424
unzip terraform_${_TERRAFORM_VERSION}_linux_amd64.zip -d /builder/home/.local/bin &&
2525
rm terraform_${_TERRAFORM_VERSION}_linux_amd64.zip &&
26-
chmod 755 /builder/home/.local/bin/terraform
26+
wget -O /builder/home/.local/bin/terragrunt https://github.com/gruntwork-io/terragrunt/releases/download/v${_TERRAGRUNT_VERSION}/terragrunt_linux_amd64 &&
27+
chmod 755 /builder/home/.local/bin/terraform &&
28+
chmod 755 /builder/home/.local/bin/terragrunt
2729
# TODO(ludoo): split into two triggers with different filters
2830
- name: python:3.6-alpine
2931
id: test
@@ -36,6 +38,7 @@ steps:
3638

3739
substitutions:
3840
_TERRAFORM_VERSION: 0.13.5
41+
_TERRAGRUNT_VERSION: 0.28.2
3942

4043
tags:
4144
- "ci"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
include {
2+
path = find_in_parent_folders()
3+
}
4+
5+
terraform {
6+
source = "../..//apply"
7+
}
8+
9+
inputs = {
10+
names = ["bar"]
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
include {
2+
path = find_in_parent_folders()
3+
}
4+
5+
terraform {
6+
source = "../..//apply"
7+
}
8+
9+
inputs = {
10+
names = ["foo"]
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
terraform {
2+
source = "..//apply"
3+
}
4+
5+
generate "provider" {
6+
path = "provider.tf"
7+
if_exists = "overwrite_terragrunt"
8+
contents = <<EOF
9+
provider "null" {}
10+
EOF
11+
}

test/test_tg_all.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import pytest
16+
import tftest
17+
18+
import os
19+
import sys
20+
21+
@pytest.fixture
22+
def output(fixtures_dir):
23+
tf = tftest.TerraformTest('tg_apply_all', fixtures_dir, binary='terragrunt')
24+
tf.setup()
25+
tf.tg_apply(all=True, output=False)
26+
yield tf.tg_output(all=True)
27+
28+
# TODO: Add output test

0 commit comments

Comments
 (0)