Skip to content

Commit

Permalink
feat: make the aws tf code more modular
Browse files Browse the repository at this point in the history
Make the aws code more modular so that it can be used in CI.

Signed-off-by: Noel Georgi <[email protected]>
  • Loading branch information
frezbo committed Aug 9, 2023
1 parent cb41a08 commit 43ecfa1
Show file tree
Hide file tree
Showing 12 changed files with 685 additions and 104 deletions.
55 changes: 55 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
":dependencyDashboard",
":gitSignOff",
":semanticCommitScopeDisabled",
"schedule:earlyMondays"
],
"prHeader": "Update Request | Renovate Bot",
"regexManagers": [
{
"fileMatch": [
"Makefile"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?)(?:\\s+extractVersion=(?<extractVersion>.+?))?\\s+depName=(?<depName>.+?)\\s.*_VERSION\\s+\\?=\\s+(?<currentValue>.+)"
],
"versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}"
},
{
"fileMatch": [
"Makefile"
],
"matchStrings": [
"# renovate: depName=(?<depName>.+?)\\s.*_VERSION\\s+:=\\s+(?<currentValue>.+)"
],
"datasourceTemplate": "helm",
"versioningTemplate": "semver",
"registryUrlTemplate": "https://kubernetes.github.io/cloud-provider-aws"
}
],
"packageRules": [
{
"matchPackagePatterns": [
"*"
],
"matchDatasources": [
"helm"
],
"groupName": "helm charts"
},
{
"matchPackagePatterns": [
"*"
],
"matchDatasources": [
"git-refs",
"git-tags",
"github-tags",
"github-releases"
],
"groupName": "releases"
}
]
}
18 changes: 18 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: check-dirty
on:
pull_request:
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Helm
uses: azure/setup-helm@v3
- name: Set up Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_wrapper: false
- name: dirty-check
run: |
make check-dirty
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,10 @@ override.tf.json

# Ignore CLI configuration files
.terraformrc
terraform.rc
terraform.rc

# ignore sensitive terraform outputs
talosconfig
kubeconfig
vars*.json
patch*.yaml
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
TAG ?= $(shell git describe --tag --always --dirty)

# renovate: datasource=helm depName=aws-cloud-controller-manager
AWS_CCM_HELM_CHART_VERSION ?= 0.0.7
# renovate: datasource=github-releases depName=kubernetes/cloud-provider-aws
AWS_CCM_VERSION ?= v1.27.1

.PHONY: fmt
fmt:
terraform fmt -recursive

.PHONY: generate
generate: aws-ccm

.PHONY: check-dirty
check-dirty: fmt generate ## Verifies that source tree is not dirty
@if test -n "`git status --porcelain`"; then echo "Source tree is dirty"; git status; exit 1 ; fi

aws-ccm:
helm repo add aws-cloud-controller-manager https://kubernetes.github.io/cloud-provider-aws
helm repo update
helm template --version $(AWS_CCM_HELM_CHART_VERSION) aws-cloud-controller-manager aws-cloud-controller-manager/aws-cloud-controller-manager --set args="{--v=2,--cloud-provider=aws,--configure-cloud-routes=false}" --set image.tag=$(AWS_CCM_VERSION) > examples/terraform/aws/manifests/ccm.yaml
66 changes: 33 additions & 33 deletions examples/terraform/aws/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 43ecfa1

Please sign in to comment.