docker.#Run now use secrets from dagger.#Secret

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau
2021-06-03 13:59:22 +02:00
parent ca03cd6e58
commit a39e87b179
18 changed files with 123 additions and 151 deletions

View File

@@ -52,13 +52,13 @@ import (
port: *22 | int @dagger(input)
// Ssh private key
key: dagger.#Artifact @dagger(input)
key: dagger.#Secret @dagger(input)
// User fingerprint
fingerprint?: string @dagger(input)
// Ssh passphrase
passphrase?: string @dagger(input)
passphrase?: dagger.#Secret @dagger(input)
// Image reference (e.g: nginx:alpine)
ref: string @dagger(input)
@@ -114,24 +114,10 @@ import (
#up: [
op.#Load & {from: #Client},
op.#WriteFile & {
content: key
dest: "/key"
mode: 0o400
},
if registry != _|_ {
op.#DockerLogin & {registry}
},
if passphrase != _|_ {
op.#WriteFile & {
content: passphrase
dest: "/passphrase"
mode: 0o400
}
},
if passphrase != _|_ {
op.#WriteFile & {
content: #"""
@@ -172,6 +158,12 @@ import (
FINGERPRINT: fingerprint
}
}
mount: {
"/key": secret: key
if passphrase != _|_ {
"/passphrase": secret: passphrase
}
}
},
]
}