-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #572 from knutgoetz/fix/expect-gpg-key-ring-as-path
Fix signing commits with GPG key
- Loading branch information
Showing
9 changed files
with
97 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
provider "flux" { | ||
kubernetes = { | ||
host = kind_cluster.this.endpoint | ||
client_certificate = kind_cluster.this.client_certificate | ||
client_key = kind_cluster.this.client_key | ||
cluster_ca_certificate = kind_cluster.this.cluster_ca_certificate | ||
} | ||
git = { | ||
url = "ssh://[email protected]/${var.github_org}/${var.github_repository}.git" | ||
ssh = { | ||
username = "git" | ||
private_key = tls_private_key.flux.private_key_pem | ||
} | ||
gpg_key_ring = var.flux_gpg_key_ring | ||
gpg_key_id = var.flux_gpg_key_id | ||
gpg_passphrase = var.flux_gpg_passphrase | ||
} | ||
} | ||
|
||
resource "flux_bootstrap_git" "this" { | ||
depends_on = [github_repository_deploy_key.this] | ||
|
||
path = "clusters/my-cluster" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
provider "github" { | ||
owner = var.github_org | ||
token = var.github_token | ||
} | ||
|
||
resource "tls_private_key" "flux" { | ||
algorithm = "ECDSA" | ||
ecdsa_curve = "P256" | ||
} | ||
|
||
resource "github_repository_deploy_key" "this" { | ||
title = "Flux" | ||
repository = var.github_repository | ||
key = tls_private_key.flux.public_key_openssh | ||
read_only = "false" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
provider "kind" {} | ||
|
||
resource "kind_cluster" "this" { | ||
name = "flux-e2e" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
terraform { | ||
required_version = ">=1.1.5" | ||
|
||
required_providers { | ||
flux = { | ||
source = "fluxcd/flux" | ||
} | ||
kind = { | ||
source = "tehcyx/kind" | ||
version = ">=0.0.16" | ||
} | ||
github = { | ||
source = "integrations/github" | ||
version = ">=5.18.0" | ||
} | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
variable "flux_gpg_key_id" { | ||
type = string | ||
description = "The ID of the GPG key to use for signing commits when bootstraping FluxCD." | ||
} | ||
|
||
variable "flux_gpg_key_ring" { | ||
type = string | ||
description = "The path to the exported GPG key ring." | ||
} | ||
|
||
variable "flux_gpg_passphrase" { | ||
sensitive = true | ||
type = string | ||
description = "The passphrase of the GPG key." | ||
default = "" | ||
} | ||
|
||
variable "github_token" { | ||
sensitive = true | ||
type = string | ||
description = "The GitHub token to use for authenticating with the GitHub API." | ||
} | ||
|
||
variable "github_org" { | ||
type = string | ||
description = "The name of the GitHub organization/username for the repository." | ||
} | ||
|
||
variable "github_repository" { | ||
type = string | ||
description = "The name of the GitHub repository to create the FluxCD manifests in." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters