sops
This module provides functionality for working with [Mozilla SOPS](https://github.com/getsops/sops)in a Dagger pipeline. It supports encrypting and decrypting files using an AGE key.
Files are mounted into a container and processed using the `sops` CLI tool.
The `DecryptSops` function decrypts a file with the given SOPS key and returns its plaintext content.
The `EncryptSops` function encrypts a plaintext file using the same SOPS key and returns the encrypted content.
Installation
dagger install github.com/stuttgart-things/dagger/sops@v0.72.0Entrypoint
Return Type
Sops Example
dagger -m github.com/stuttgart-things/dagger/sops@488630cce28f59ee0bf3f1612a75e988012225f8 call \
func (m *MyModule) Example() *dagger.Sops {
return dag.
Sops()
}@function
def example() -> dagger.Sops:
return (
dag.sops()
)@func()
example(): Sops {
return dag
.sops()
}Types
Sops 🔗
baseImage() 🔗
Return Type
String ! Example
dagger -m github.com/stuttgart-things/dagger/sops@488630cce28f59ee0bf3f1612a75e988012225f8 call \
base-imagefunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Sops().
Baseimage(ctx)
}@function
async def example() -> str:
return await (
dag.sops()
.baseimage()
)@func()
async example(): Promise<string> {
return dag
.sops()
.baseImage()
}decryptSops() 🔗
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| sopsKey | Secret ! | - | No description provided |
| encryptedFile | File ! | - | No description provided |
Example
dagger -m github.com/stuttgart-things/dagger/sops@488630cce28f59ee0bf3f1612a75e988012225f8 call \
decrypt-sops --sops-key env:MYSECRET --encrypted-file file:pathfunc (m *MyModule) Example(ctx context.Context, sopsKey *dagger.Secret, encryptedFile *dagger.File) string {
return dag.
Sops().
Decryptsops(ctx, sopsKey, encryptedFile)
}@function
async def example(sopskey: dagger.Secret, encryptedfile: dagger.File) -> str:
return await (
dag.sops()
.decryptsops(sopskey, encryptedfile)
)@func()
async example(sopsKey: Secret, encryptedFile: File): Promise<string> {
return dag
.sops()
.decryptSops(sopsKey, encryptedFile)
}encrypt() 🔗
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ageKey | Secret ! | - | No description provided |
| plaintextFile | File ! | - | No description provided |
| fileExtension | String ! | - | e.g., “yaml”, “json”, “env” |
| sopsConfig | File ! | - | Optional: ~/.sops.yaml config file |
Example
dagger -m github.com/stuttgart-things/dagger/sops@488630cce28f59ee0bf3f1612a75e988012225f8 call \
encrypt --age-key env:MYSECRET --plaintext-file file:path --file-extension string --sops-config file:pathfunc (m *MyModule) Example(ageKey *dagger.Secret, plaintextFile *dagger.File, fileExtension string, sopsConfig *dagger.File) *dagger.File {
return dag.
Sops().
Encrypt(ageKey, plaintextFile, fileExtension, sopsConfig)
}@function
def example(agekey: dagger.Secret, plaintextfile: dagger.File, fileextension: str, sopsconfig: dagger.File) -> dagger.File:
return (
dag.sops()
.encrypt(agekey, plaintextfile, fileextension, sopsconfig)
)@func()
example(ageKey: Secret, plaintextFile: File, fileExtension: string, sopsConfig: File): File {
return dag
.sops()
.encrypt(ageKey, plaintextFile, fileExtension, sopsConfig)
}