added private repo test
Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
parent
1384b025b7
commit
a49d794409
@ -97,6 +97,8 @@ setup() {
|
|||||||
cd "$TESTDIR"/tasks/gitPull/
|
cd "$TESTDIR"/tasks/gitPull/
|
||||||
"$DAGGER" --europa up ./exists.cue
|
"$DAGGER" --europa up ./exists.cue
|
||||||
"$DAGGER" --europa up ./gitdir.cue
|
"$DAGGER" --europa up ./gitdir.cue
|
||||||
|
"$DAGGER" --europa up ./privateRepo.cue
|
||||||
|
|
||||||
run "$DAGGER" --europa up ./invalid.cue
|
run "$DAGGER" --europa up ./invalid.cue
|
||||||
assert_failure
|
assert_failure
|
||||||
run "$DAGGER" --europa up ./badremote.cue
|
run "$DAGGER" --europa up ./badremote.cue
|
||||||
|
31
tests/tasks/gitPull/privateRepo.cue
Normal file
31
tests/tasks/gitPull/privateRepo.cue
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "alpha.dagger.io/europa/dagger/engine"
|
||||||
|
|
||||||
|
engine.#Plan & {
|
||||||
|
inputs: secrets: TestPAT: command: {
|
||||||
|
name: "sops"
|
||||||
|
args: ["exec-env", "./privateRepo.enc.yaml", "echo $data"]
|
||||||
|
}
|
||||||
|
actions: {
|
||||||
|
alpine: engine.#Pull & {
|
||||||
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
|
}
|
||||||
|
|
||||||
|
testRepo: engine.#GitPull & {
|
||||||
|
remote: "https://github.com/dagger/dagger.git"
|
||||||
|
ref: "main"
|
||||||
|
authToken: inputs.secrets.TestPAT.contents
|
||||||
|
}
|
||||||
|
|
||||||
|
testContent: engine.#Exec & {
|
||||||
|
input: alpine.output
|
||||||
|
always: true
|
||||||
|
args: ["ls", "-l", "/input/repo | grep 'universe -> stdlib'"]
|
||||||
|
mounts: inputRepo: {
|
||||||
|
dest: "/input/repo"
|
||||||
|
contents: testRepo.output
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
20
tests/tasks/gitPull/privateRepo.enc.yaml
Normal file
20
tests/tasks/gitPull/privateRepo.enc.yaml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"data": "ENC[AES256_GCM,data:bdiZfZl5DUcmEeQz5FYmY7LKMaFqu8tRuImNtM2kofw1JVeFeoyDRA==,iv:ovbCLds/NAzl9dfkLSrkV5qWsQG9uJJjlw8psXLgJ+w=,tag:QvmQeMmPv6+JtOC5/wSr0Q==,type:str]",
|
||||||
|
"sops": {
|
||||||
|
"kms": null,
|
||||||
|
"gcp_kms": null,
|
||||||
|
"azure_kv": null,
|
||||||
|
"hc_vault": null,
|
||||||
|
"age": [
|
||||||
|
{
|
||||||
|
"recipient": "age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk",
|
||||||
|
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBRc1VaM281bjRUand4V2hz\nMnNIbW8rbUt5Q05LS0RuYVJ2Q09JZU9lZWcwCk8yTVRWYlQvR1Rvb3d4Skx0K2I5\nRXB6MmxnTEtFaThRWU13L05hQWdGblUKLS0tIHpUTll5aFgwSXdzVnMvWG11MDZ4\nbXBNWVVraDI5TmZHMlFSc2VSWSsrTkEKT6gyiklm5eQ04Q2p81+FACg+aRlfgaK6\nqT3aI/pLBrQXIKp5oYpyvY+5WPvM5uQHm5wH7FKXxoxxiZOaIOwgIQ==\n-----END AGE ENCRYPTED FILE-----\n"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"lastmodified": "2021-12-20T21:36:38Z",
|
||||||
|
"mac": "ENC[AES256_GCM,data:dxvXu9DDdWOG8pMJlh85OBSe5LePSFy8E1PYw8fQMGQFBVl9dHifTQuZ6eQeGluXtbqetgwa1ZHek1E7UO/WjtWYBtU1tBmlVqmcJ0MIJ67ULFwMHUb5yQqCh7JgymmsHRynqOQ4S2azIbqjmwz6eOyxxqNyJDA6l1NHsrVSeEU=,iv:UC02CgdM30+KOO0KDPkSFKM1HR+t2tenu0j5gYqx1FY=,tag:QB89K6zbWHjk6DCgMz8Lwg==,type:str]",
|
||||||
|
"pgp": null,
|
||||||
|
"unencrypted_suffix": "_unencrypted",
|
||||||
|
"version": "3.7.1"
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user