Skip to content

Commit

Permalink
chore: use dagger module for terraform/opentofu validation tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Smana committed Jul 2, 2024
1 parent ad95fde commit b23a36b
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 12,505 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/cache-testing.yaml

This file was deleted.

16 changes: 8 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ jobs:
with:
fetch-depth: 0

- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Write required vault files
run: |
mkdir -p terraform/vault/cluster/.tls
echo 'keep' > terraform/vault/cluster/.tls/vault.pem
echo 'keep' > terraform/vault/cluster/.tls/vault-key.pem
echo 'keep' > terraform/vault/cluster/.tls/ca-chain.pem
- name: pre-commit checks
run: task pre-commit
- name: Validate Terraform Opentofu configuration
uses: dagger/dagger-for-github@v5
with:
version: "latest"
verb: call
module: github.com/Smana/daggerverse/pre-commit-tf@pre-commit-tf/v0.0.1
args: run --dir "." --tf-binary="tofu"
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }}

kubernetes-validation:
name: Kubernetes validation ☸
Expand Down
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ This repository provides a comprehensive guide and set of tools for building, ma
- [🔗 VPN connection using Tailscale](#-vpn-connection-using-tailscale)
- [🔑 Private PKI with Vault](#-private-pki-with-vault)
- [🧪 CI](#-ci)
- [🚧 Transition to Dagger](#-transition-to-dagger)
- [Overview](#overview)
- [Goal](#goal)
- [Overview](#overview)
- [🏠 Using Self-Hosted Runners](#-using-self-hosted-runners)
- [Overview](#overview-1)
- [Enabling Self-Hosted Runners](#enabling-self-hosted-runners)
Expand Down Expand Up @@ -126,21 +124,12 @@ The Vault creation is made in 2 steps:

## 🧪 CI

### 🚧 Transition to Dagger
### Overview

#### Overview
Our CI currently supports two ways of declaring tasks. We are in the process of transitioning to using [Dagger](https://dagger.io/) exclusively. Here's a breakdown of the current methods:

1. **[Task](https://taskfile.dev/installation/)**:
- Utilized for Terraform code quality, conformance, and security.
- Integrates with [pre-commit-terraform](https://github.com/antonbabenko/pre-commit-terraform) to ensure best practices and security standards are met.

2. **[Dagger](https://dagger.io/)**:
- Used for Kustomize and Kubernetes conformance.
- Employs `kubeconform` for Kubernetes configuration validation.
We leverage **[Dagger](https://dagger.io/)** for all our CI tasks. Here's what is currently run:

#### Goal
We aim to standardize our CI tasks using Dagger across all processes. This transition is currently a work in progress.
* Validation of Kubernetes and Kustomize manifests using `kubeconform`
* Validation of Terraform/Opentofu configurations using the [pre-commit-terraform](https://github.com/antonbabenko/pre-commit-terraform)

### 🏠 Using Self-Hosted Runners

Expand Down
Loading

0 comments on commit b23a36b

Please sign in to comment.