update stdlib tests that use secrets
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
committed by
Andrea Luzzardi
parent
40d4c95bff
commit
5fb7ded2d5
2
tests/stdlib/netlify/.dagger/env/net/.gitignore
vendored
Normal file
2
tests/stdlib/netlify/.dagger/env/net/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# dagger state
|
||||
state/**
|
46
tests/stdlib/netlify/.dagger/env/net/plan/netlify.cue
vendored
Normal file
46
tests/stdlib/netlify/.dagger/env/net/plan/netlify.cue
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
package netlify
|
||||
|
||||
import (
|
||||
"dagger.io/dagger/op"
|
||||
"dagger.io/alpine"
|
||||
"dagger.io/netlify"
|
||||
)
|
||||
|
||||
TestNetlify: {
|
||||
// Generate a website containing the random number
|
||||
html: #up: [
|
||||
op.#WriteFile & {
|
||||
content: random
|
||||
dest: "index.html"
|
||||
},
|
||||
]
|
||||
|
||||
// Deploy to netlify
|
||||
deploy: netlify.#Site & {
|
||||
contents: html
|
||||
name: "dagger-test"
|
||||
}
|
||||
|
||||
// Check if the deployed site has the random marker
|
||||
check: #up: [
|
||||
op.#Load & {
|
||||
from: alpine.#Image & {
|
||||
package: bash: "=~5.1"
|
||||
package: curl: true
|
||||
}
|
||||
},
|
||||
op.#Exec & {
|
||||
args: [
|
||||
"/bin/bash",
|
||||
"--noprofile",
|
||||
"--norc",
|
||||
"-eo",
|
||||
"pipefail",
|
||||
"-c",
|
||||
#"""
|
||||
test "$(curl \#(deploy.deployUrl))" = "\#(random)"
|
||||
"""#,
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
20
tests/stdlib/netlify/.dagger/env/net/plan/random.cue
vendored
Normal file
20
tests/stdlib/netlify/.dagger/env/net/plan/random.cue
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
package netlify
|
||||
|
||||
import (
|
||||
"dagger.io/alpine"
|
||||
"dagger.io/dagger/op"
|
||||
)
|
||||
|
||||
// Generate a random number
|
||||
random: {
|
||||
string
|
||||
#up: [
|
||||
op.#Load & {from: alpine.#Image},
|
||||
op.#Exec & {
|
||||
args: ["sh", "-c", "cat /dev/urandom | tr -dc 'a-z' | fold -w 10 | head -n 1 | tr -d '\n' > /rand"]
|
||||
},
|
||||
op.#Export & {
|
||||
source: "/rand"
|
||||
},
|
||||
]
|
||||
}
|
26
tests/stdlib/netlify/.dagger/env/net/values.yaml
vendored
Normal file
26
tests/stdlib/netlify/.dagger/env/net/values.yaml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: net
|
||||
inputs:
|
||||
TestNetlify.deploy.account.name:
|
||||
text: blocklayer
|
||||
TestNetlify.deploy.account.token:
|
||||
secret: ENC[AES256_GCM,data:oWKi8eqTUEs+YClokLKeAKsEj3qae4yQTn/67u6ga4Ptcq4+MyYS/6wAUg==,iv:Xfw+L/4p7vO+jb/EVyYOvsIZ9KxZbi30ms2Ckg4E8cE=,tag:G4EBBer04D6FHFP9e+feTw==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBwWHFLRUtscWVma0lQM3Qv
|
||||
M2czUFJhSEpnczdJTWhadnJHOWowaXd1dWtJCmk3aU15NDJYcmtUOE5pZ0lIQzRu
|
||||
dTYvRFdsM0ZoUjFWSG91UnZRVWdvZjgKLS0tIENhK2VWNHByY3hYNUVmWDRmOUFM
|
||||
SEdUK2RsaUxuVWg2aXUwdVJ0eUtrWWMKWkQDBuL5e4QDx5Wy6+fHiD+J4fp7QdMm
|
||||
lsqgmxRvJMWgEvm1U+hDAo/Pkn8PFUFJf0KxEvkdF4qGuguQePgzFQ==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2021-05-27T14:36:27Z"
|
||||
mac: ENC[AES256_GCM,data:S3l8tVat/Yp7fH5feeL4JxL+uQwZ0zwv8/LPsOoBebfDFWuE/j9sFZD304OT7XNCsfG8R/lqdpoxYmiyH6ToHeZyktXalpk0tAkwFXUV4VUZKyIn81UirbtWx4OT6fW7jusqqg2uX3nhvjGd+QerhEC4Qu4o8lQCKCMzLuQjmVw=,iv:4ucl0O+VgdK/SwtEad1jXIWJ4pQSxlWCCUzFbqNLDgg=,tag:xno2U/FIVW6KgSXW5RWDsw==,type:str]
|
||||
pgp: []
|
||||
encrypted_suffix: secret
|
||||
version: 3.7.1
|
Reference in New Issue
Block a user