Skip to content

Commit 1e0cd40

Browse files
author
IA Automator
committed
(automated) Updates from project type
1 parent 126b842 commit 1e0cd40

File tree

16 files changed

+122
-441
lines changed

16 files changed

+122
-441
lines changed

.copier-answers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is auto-generated, changes will be overwritten
2-
_commit: v0.0.1
3-
_src_path: /task/fcc9ea5c-e927-11ed-bba8-5e3d76a82673/projecttype
2+
_commit: v0.0.6
3+
_src_path: /task/85181ca7-edb8-11ed-83ce-460647dd8021/projecttype
44
starting_version: v0.0.0
55
version_file: VERSION
66

.header.md

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

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
fail_fast: false
3+
minimum_pre_commit_version: "2.6.0"
4+
repos:
5+
-
6+
repo: https://github.com/terraform-docs/terraform-docs
7+
# To update run:
8+
# pre-commit autoupdate --freeze
9+
rev: 212db41760d7fc45d736d5eb94a483d0d2a12049 # frozen: v0.16.0
10+
hooks:
11+
- id: terraform-docs-go
12+
args:
13+
- "--config=.terraform-docs.yaml"
14+
- "--lockfile=false"
15+
- "--recursive"
16+
- "--recursive-path=examples/"
17+
- "./"

.project_automation/functional_tests/entrypoint.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
PROJECT_PATH=${BASE_PATH}/project
66
PROJECT_TYPE_PATH=${BASE_PATH}/projecttype
77

8+
echo "Starting Funtional Tests"
9+
810
echo "Starting Functional Tests"
911

1012
cd ${PROJECT_PATH}
@@ -38,9 +40,4 @@ go mod tidy
3840
go install github.com/gruntwork-io/terratest/modules/terraform
3941
go test -timeout 45m
4042

41-
#********** CLEANUP *************
42-
echo "Cleaning up all temp files and artifacts"
43-
cd ${PROJECT_PATH}
44-
make clean
45-
4643
echo "End of Functional Tests"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff a/.project_automation/functional_tests/entrypoint.sh b/.project_automation/functional_tests/entrypoint.sh (rejected hunks)
2+
@@ -1,2 +1,2 @@
3+
-#!/bin/bash -ex
4+
+#!/bin/bash -e
5+
6+
@@ -25,25 +40,7 @@ go test -timeout 45m
7+
8+
-#********** Terratest execution **********
9+
+#********** CLEANUP *************
10+
+echo "Cleaning up all temp files and artifacts"
11+
cd ${PROJECT_PATH}
12+
-echo "Building readme.md file"
13+
-UPDATE_BRANCH="ephemeral_readme-updates"
14+
-
15+
-export GH_DEBUG=1
16+
-REMOTE=$(git remote -v | awk '{print $2}' | head -n 1)
17+
-git remote remove origin
18+
-git remote add origin ${REMOTE}
19+
-git fetch --all
20+
-
21+
-git push origin -d $UPDATE_BRANCH || true
22+
-git checkout -b "$UPDATE_BRANCH"
23+
-terraform-docs --lockfile=false ./
24+
-
25+
-if [ -n "${BASE_PATH}" ]
26+
-then
27+
- git add . --all
28+
- git commit -m "(automated) Updates from project type"
29+
- git push -f --set-upstream origin $UPDATE_BRANCH
30+
- gh pr create --title "Updates from functional tests " --body "_This is an automated PR incorporating updates to this project's readme.md file. Please review and either approve/merge or reject as appropriate_"
31+
-else
32+
- echo "Local build mode (skipping git commit)"
33+
-fi
34+
\ No newline at end of file
35+
+make clean
36+
+
37+
+echo "End of Functional Tests"
38+
\ No newline at end of file

.project_automation/publication/entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ else
1818
echo "creating new version"
1919
gh release create ${VERSION} --target ${BRANCH} --generate-notes
2020
fi
21+
22+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
diff a/.project_automation/static_tests/Dockerfile b/.project_automation/static_tests/Dockerfile (rejected hunks)
2+
@@ -23 +23,5 @@ RUN curl -s https://raw.githubusercontent.com/aquasecurity/tfsec/master/scripts/
3+
RUN gem install mdl
4+
+
5+
+ENV TERRAFORM_DOCS_VERSION=v0.16.0
6+
+RUN wget https://github.com/terraform-docs/terraform-docs/releases/download/${TERRAFORM_DOCS_VERSION}/terraform-docs-${TERRAFORM_DOCS_VERSION}-linux-amd64.tar.gz && \
7+
+ tar -C /usr/local/bin -xzf terraform-docs-${TERRAFORM_DOCS_VERSION}-linux-amd64.tar.gz && chmod +x /usr/local/bin/terraform-docs
8+
\ No newline at end of file
Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash -ex
1+
#!/bin/bash -e
22

33
## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between
44
# managed and local tasks always use these variables for the project and project type path
@@ -7,17 +7,51 @@ PROJECT_TYPE_PATH=${BASE_PATH}/projecttype
77

88
echo "Starting Static Tests"
99

10+
echo "Starting Static Tests"
11+
1012
cd ${PROJECT_PATH}
1113
terraform init
1214
terraform validate
1315

16+
#********** tflint ********************
17+
echo 'Starting tflint'
1418
tflint --init
15-
tflint
16-
19+
MYLINT=$(tflint --force)
20+
if [ -z "$MYLINT" ]
21+
then
22+
echo "Success - tflint found no linting issues!"
23+
else
24+
echo "Failure - tflint found linting issues!"
25+
echo "$MYLINT"
26+
exit 1
27+
fi
28+
#********** tfsec *********************
29+
# tfsec will report to the console with success or Failure
30+
# therefore there is no need to provide such conditional stetements
31+
echo 'Starting tfsec'
1732
tfsec .
18-
19-
mdl .header.md
20-
21-
terraform-docs --lockfile=false ./
22-
33+
#********** Markdown Lint **************
34+
echo 'Starting markdown lint'
35+
MYMDL=$(mdl .header.md || true)
36+
if [ -z "$MYMDL" ]
37+
then
38+
echo "Success - markdown lint found no linting issues!"
39+
else
40+
echo "Failure - markdown lint found linting issues!"
41+
echo "$MYMDL"
42+
exit 1
43+
fi
44+
#********** Terraform Docs *************
45+
echo 'Starting terraform-docs'
46+
TDOCS="$(terraform-docs --lockfile=false ./)"
47+
git add -N README.md
48+
GDIFF="$(git diff --compact-summary)"
49+
if [ -z "$GDIFF" ]
50+
then
51+
echo "Success - Terraform Docs creation verified!"
52+
else
53+
echo "Failure - Terraform Docs creation failed, ensure you have precommit installed and running before submitting the Pull Request"
54+
exit 1
55+
fi
56+
#***************************************
2357
echo "End of Static Tests"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff a/.project_automation/static_tests/entrypoint.sh b/.project_automation/static_tests/entrypoint.sh (rejected hunks)
2+
@@ -16,2 +18,6 @@ tfsec .
3+
4+
-mdl .header.md
5+
\ No newline at end of file
6+
+mdl .header.md
7+
+
8+
+terraform-docs --lockfile=false ./
9+
+
10+
+echo "End of Static Tests"
11+
\ No newline at end of file

CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)