Update docker push tests
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
parent
7cc1c8e5dd
commit
eabf1b52e5
@ -655,7 +655,7 @@ func (p *Pipeline) DockerLogin(ctx context.Context, op *compiler.Value, st llb.S
|
|||||||
// FIXME If we could create secret directly in `cue`, we could clean up
|
// FIXME If we could create secret directly in `cue`, we could clean up
|
||||||
// that condition
|
// that condition
|
||||||
// But currently it's not possible because ECR secret's is a string
|
// But currently it's not possible because ECR secret's is a string
|
||||||
// so we need to handle both option (string & secrets)
|
// so we need to handle both options (string & secret)
|
||||||
secretValue, err := op.Lookup("secret").String()
|
secretValue, err := op.Lookup("secret").String()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Retrieve secret
|
// Retrieve secret
|
||||||
|
@ -23,7 +23,6 @@ func NewSecretsStoreProvider(st *state.State) SecretsStore {
|
|||||||
Secrets: secretsprovider.NewSecretProvider(store),
|
Secrets: secretsprovider.NewSecretProvider(store),
|
||||||
Store: store,
|
Store: store,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type inputStore struct {
|
type inputStore struct {
|
||||||
|
6
stdlib/.dagger/env/docker-pull/values.yaml
vendored
6
stdlib/.dagger/env/docker-pull/values.yaml
vendored
@ -3,7 +3,7 @@ plan:
|
|||||||
name: docker-pull
|
name: docker-pull
|
||||||
inputs:
|
inputs:
|
||||||
ref:
|
ref:
|
||||||
text: docker.io/daggerio/ci-test:xtyzsocvpici@sha256:35fc94d52b4fa53c2caa38ff11e13182e6f88c651eb0846728d1007d931f0d3c
|
text: docker.io/daggerio/ci-test:pncdyzkdemof@sha256:b92cbbfef6b952befc38812cd88cf5c4c1012f6df2891595c226f56cc053334e
|
||||||
sops:
|
sops:
|
||||||
kms: []
|
kms: []
|
||||||
gcp_kms: []
|
gcp_kms: []
|
||||||
@ -19,8 +19,8 @@ sops:
|
|||||||
SG1raUVNTzZIWDltV1pOS3hySHlJeWcKg3blmstOGcxtPww513+mAEA0MWOXwNAT
|
SG1raUVNTzZIWDltV1pOS3hySHlJeWcKg3blmstOGcxtPww513+mAEA0MWOXwNAT
|
||||||
5ngRvG6MraW3g9dhIuUYOwjuJyz1Z07/DBEocSxnjSyw45ZCkM1/9Q==
|
5ngRvG6MraW3g9dhIuUYOwjuJyz1Z07/DBEocSxnjSyw45ZCkM1/9Q==
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
lastmodified: "2021-07-08T09:53:37Z"
|
lastmodified: "2021-08-31T10:10:02Z"
|
||||||
mac: ENC[AES256_GCM,data:kcONOT/cxu39rCrWtMEwHnSZU0o752WyrLMckPp4AGhkQ0CVb7vnnNQ0lLSzsUQfvf0Ze09kFZYuhlGqZ6EPCJvOw0girrdBi09hU2a7Nm8CZd/ku9gP08YsGV3yx0PgIYFuVQRJ60hwQEIZI5neEGV9x2FPUedy9lYbKvvboSE=,iv:ofZ605QYbEbtWNgGxNkp1QbK/VHtwchpFs4GxBU9rIg=,tag:Mo+0nfe2GaJcXpIOCl/cew==,type:str]
|
mac: ENC[AES256_GCM,data:30qNlAVLJunPEboTzeIxcsZ06LcLiDiXXJLVqHE328hcezcOYGsvhlYTiGEzxtAsv78Mwxw54oSbiFZmCKoew9bTZFUyb6FcFVk4GG8z2I8pn7FkZlcnEknWinVf9Tc/h5R/g4/BBGzsBf2dr4fx4ADewwO2z1Df/8wdup0PD4E=,iv:KJcMdpLCfSU1LvvPMXitSPzm0JPwrDWdLncdvVFngNk=,tag:X2/D+RhEnyizZHXJWYnmmg==,type:str]
|
||||||
pgp: []
|
pgp: []
|
||||||
encrypted_suffix: secret
|
encrypted_suffix: secret
|
||||||
version: 3.7.1
|
version: 3.7.1
|
||||||
|
@ -3,7 +3,7 @@ plan:
|
|||||||
name: docker-push-invalid-creds
|
name: docker-push-invalid-creds
|
||||||
inputs:
|
inputs:
|
||||||
TestRegistry.secret:
|
TestRegistry.secret:
|
||||||
text: ENC[AES256_GCM,data:PckymCtA/Q==,iv:to7XhUUcZrWDga7uT4C067BRzHEzmTPDUNAEb2TpS/I=,tag:jUTk8uGd185hmIvi/IHpww==,type:str]
|
secret: ENC[AES256_GCM,data:+gCg3g==,iv:TVQBLFvC1T+xNSJdmhEz+0cciIpCbo6D+twwghUU0ik=,tag:R7SoByjnyj6Aupw1/6c+8w==,type:str]
|
||||||
TestRegistry.username:
|
TestRegistry.username:
|
||||||
text: invalid
|
text: invalid
|
||||||
sops:
|
sops:
|
||||||
@ -21,8 +21,8 @@ sops:
|
|||||||
VC8wSTZvUE5UaDg2WE1CaGMzR3M1TEkK9v83AVI4lvFgjKCg8UmQrcxarlESWTfV
|
VC8wSTZvUE5UaDg2WE1CaGMzR3M1TEkK9v83AVI4lvFgjKCg8UmQrcxarlESWTfV
|
||||||
2cDdWgoH7ZqgXo5jFv2tn8qQWHKl8eTTeYUWn8GoNVPKrCroax2fiQ==
|
2cDdWgoH7ZqgXo5jFv2tn8qQWHKl8eTTeYUWn8GoNVPKrCroax2fiQ==
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
lastmodified: "2021-07-08T09:53:54Z"
|
lastmodified: "2021-08-31T10:07:27Z"
|
||||||
mac: ENC[AES256_GCM,data:hnVsqFM81iSA/VFPbwqtqw3jOB7H2+67VuXmKfU5fEf15D5WGLZi17HCfRJQ+Db8d0S8ICwFlzqemq+99GB0wf0QVGeOBfrLZ+/AW6Yhd7klhZZxtngXos0lcZreBWduiLkctS2lbx0aiRDBUrsKFcJmu0O9JbMkwC7Hj+nncBk=,iv:2PDO6MTSszlVwmEkAI5lI9cBoJW8JdL3Q+i+sQgtFAk=,tag:nW2OLjAhSot7VyolrXbV5Q==,type:str]
|
mac: ENC[AES256_GCM,data:sdycrW51n0tHL76DroLAUR33Fis5Hixn6dQ7LofNoIcdAj334MTWIf0jxnbzrv4Dkm/MsU90asiGwQyHI56t8mBUqrLJmd8PBE/t6S4RghCAIlM3mcHB4iHsC8Sib2URn3wKztcIuobfU8e9IvZoW4X8R/QWc1jWNmIt8VGdwfw=,iv:g7ri14SRxhsd1SSibYzDig6mZRG7LJ+R6CPDNmNOAfI=,tag:wM1DVa3LL9zFcHKAJJjugg==,type:str]
|
||||||
pgp: []
|
pgp: []
|
||||||
encrypted_suffix: secret
|
encrypted_suffix: secret
|
||||||
version: 3.7.1
|
version: 3.7.1
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package docker
|
package docker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"alpha.dagger.io/dagger"
|
||||||
"alpha.dagger.io/random"
|
"alpha.dagger.io/random"
|
||||||
)
|
)
|
||||||
|
|
||||||
TestRegistry: {
|
TestRegistry: {
|
||||||
username: string @dagger(input)
|
username: dagger.#Input & {string}
|
||||||
secret: string @dagger(input)
|
secret: dagger.#Input & {dagger.#Secret}
|
||||||
}
|
}
|
||||||
|
|
||||||
TestPush: {
|
TestPush: {
|
||||||
|
@ -4,9 +4,7 @@ import (
|
|||||||
"alpha.dagger.io/aws"
|
"alpha.dagger.io/aws"
|
||||||
"alpha.dagger.io/aws/ecr"
|
"alpha.dagger.io/aws/ecr"
|
||||||
"alpha.dagger.io/dagger"
|
"alpha.dagger.io/dagger"
|
||||||
"alpha.dagger.io/dagger/op"
|
|
||||||
"alpha.dagger.io/random"
|
"alpha.dagger.io/random"
|
||||||
"alpha.dagger.io/alpine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -48,36 +46,10 @@ TestRemoteAWS: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#TestGetSecret: {
|
|
||||||
secret: dagger.#Artifact
|
|
||||||
|
|
||||||
out: {
|
|
||||||
string
|
|
||||||
|
|
||||||
#up: [
|
|
||||||
op.#Load & {from: alpine.#Image},
|
|
||||||
|
|
||||||
op.#Exec & {
|
|
||||||
always: true
|
|
||||||
args: ["sh", "-c", "cp /input/secret /secret"]
|
|
||||||
mount: "/input/secret": "secret": secret
|
|
||||||
},
|
|
||||||
|
|
||||||
op.#Export & {
|
|
||||||
source: "/secret"
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TestRemoteDocker: {
|
TestRemoteDocker: {
|
||||||
dockerConfig: {
|
dockerConfig: {
|
||||||
username: string & dagger.#Input
|
username: dagger.#Input & {string}
|
||||||
secret: dagger.#Secret & dagger.#Input
|
secret: dagger.#Input & {dagger.#Secret}
|
||||||
}
|
|
||||||
|
|
||||||
secret: #TestGetSecret & {
|
|
||||||
secret: dockerConfig.secret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
target: "daggerio/ci-test:test-docker-\(TestResources.suffix.out)"
|
target: "daggerio/ci-test:test-docker-\(TestResources.suffix.out)"
|
||||||
@ -87,7 +59,7 @@ TestRemoteDocker: {
|
|||||||
source: TestResources.image
|
source: TestResources.image
|
||||||
auth: {
|
auth: {
|
||||||
username: dockerConfig.username
|
username: dockerConfig.username
|
||||||
"secret": secret.out
|
secret: dockerConfig.secret
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,37 +1,13 @@
|
|||||||
package docker
|
package docker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"alpha.dagger.io/dagger/op"
|
|
||||||
"alpha.dagger.io/dagger"
|
"alpha.dagger.io/dagger"
|
||||||
"alpha.dagger.io/alpine"
|
|
||||||
"alpha.dagger.io/random"
|
"alpha.dagger.io/random"
|
||||||
)
|
)
|
||||||
|
|
||||||
TestRegistry: {
|
TestRegistry: {
|
||||||
username: string @dagger(input)
|
username: dagger.#Input & {string}
|
||||||
secret: dagger.#Secret @dagger(input)
|
secret: dagger.#Input & {dagger.#Secret}
|
||||||
}
|
|
||||||
|
|
||||||
#TestGetSecret: {
|
|
||||||
secret: dagger.#Artifact
|
|
||||||
|
|
||||||
out: {
|
|
||||||
string
|
|
||||||
|
|
||||||
#up: [
|
|
||||||
op.#Load & {from: alpine.#Image},
|
|
||||||
|
|
||||||
op.#Exec & {
|
|
||||||
always: true
|
|
||||||
args: ["sh", "-c", "cp /input/secret /secret"]
|
|
||||||
mount: "/input/secret": "secret": secret
|
|
||||||
},
|
|
||||||
|
|
||||||
op.#Export & {
|
|
||||||
source: "/secret"
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TestPush: {
|
TestPush: {
|
||||||
@ -41,10 +17,6 @@ TestPush: {
|
|||||||
|
|
||||||
target: "daggerio/ci-test:\(tag.out)"
|
target: "daggerio/ci-test:\(tag.out)"
|
||||||
|
|
||||||
secret: #TestGetSecret & {
|
|
||||||
secret: TestRegistry.secret
|
|
||||||
}
|
|
||||||
|
|
||||||
image: #ImageFromDockerfile & {
|
image: #ImageFromDockerfile & {
|
||||||
dockerfile: """
|
dockerfile: """
|
||||||
FROM alpine
|
FROM alpine
|
||||||
@ -58,7 +30,7 @@ TestPush: {
|
|||||||
source: image
|
source: image
|
||||||
auth: {
|
auth: {
|
||||||
username: TestRegistry.username
|
username: TestRegistry.username
|
||||||
"secret": secret.out
|
secret: TestRegistry.secret
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user