Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
version: 0.1
cli:
version: 1.19.0
version: 1.22.12
plugins:
sources:
- id: trunk
ref: v1.4.2
ref: v1.6.8
uri: https://github.com/trunk-io/plugins
lint:
enabled:
- actionlint@1.6.26
- checkov@3.2.19
- trivy@0.49.1
- yamllint@1.34.0
- actionlint@1.7.7
- checkov@3.2.408
- trivy@0.61.1
- yamllint@1.37.0
- git-diff-check
- markdownlint@0.39.0
- prettier@3.2.5
- trufflehog@3.67.5
- markdownlint@0.44.0
- prettier@3.5.3
- trufflehog@3.88.25
runtimes:
enabled:
- node@18.12.1
- node@18.20.5
- python@3.10.8
actions:
disabled:
Expand Down
1 change: 1 addition & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ includes:
aws: lib/aws
components: lib/components
mixins: lib/mixins
os: lib/os-modules
snaplet: lib/snaplet
terraform:
taskfile: lib/terraform
Expand Down
51 changes: 51 additions & 0 deletions lib/os-modules/Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: "3"

tasks:
sync:
desc: |
Sync files from `terraform-module-template` to specified Terraform open-source module repos.
Example: `task os:sync -- terraform-spacelift-automation`
summary: |
This will sync the specified list of files and directories from the remote template repository
to each of the default Terraform module repositories listed in DEFAULT_MODULES.
The task will synchronize the hardoded list of common files and directories.
To sync to a specific repository (or a custom list of repositories), pass their names as arguments:
`task os:sync -- terraform-custom-module`
or for multiple modules: `task modules:sync -- "terraform-custom-module terraform-another-module"`

vars:
DEFAULT_MODULES: |
terraform-aws-ssm-agent \
terraform-aws-tailscale \
terraform-datadog-users \
terraform-github-teams \
terraform-github-organization \
terraform-postgres-automation \
terraform-secrets-helper \
terraform-spacelift-automation \
terraform-spacelift-aws-integrations \
terraform-spacelift-events-collector-audit-trail \
terraform-spacelift-policies
MODULES: "{{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}{{.DEFAULT_MODULES}}{{end}}"
FILES: >-
.github
.trunk
.coderabbit.yaml
.editorconfig
.gitignore
.terraform-docs.yaml
LICENSE
aqua.yaml
TMP_DIR: .tmp-template-sync
cmds:
- rm -rf {{.TMP_DIR}}
- git clone --depth 1 https://github.com/masterpointio/terraform-module-template.git {{.TMP_DIR}}
- |
for module in {{.MODULES}}; do
echo "Syncing files to ../$module..."
for file in {{.FILES}}; do
echo " Syncing $file"
rsync -av --delete {{.TMP_DIR}}/$file ../$module/
done
done
- rm -rf {{.TMP_DIR}}