-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathop.yml
53 lines (53 loc) · 1.42 KB
/
op.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
description: gets login credentials for any AWS ECR registry your IAM principal has access to.
inputs:
accessKeyId:
string:
constraints: { minLength: 20 }
description: access key for AWS
region:
string:
constraints: { minLength: 1 }
description: default region
default: us-west-2
secretAccessKey:
string:
constraints: { minLength: 20 }
description: secret access key for AWS
isSecret: true
sessionToken:
string:
isSecret: true
description: session token for AWS
default: " "
outputs:
creds:
object:
description: username & password for any AWS ECR registry your IAM principal has access to
isSecret: true
constraints:
properties:
username:
minLength: 1
password:
minLength: 1
run:
container:
image: { ref: 'opspecpkgs/aws.ecr.get-login-creds:1.0.0' }
cmd:
- sh
- -ce
- |
if [[ "$(sessionToken)" != " " ]]; then
export AWS_SESSION_TOKEN="$(sessionToken)"
fi
password=\$(aws ecr get-login-password)
echo -n "{\"username\": \"AWS\",\"password\": \"${password}\"}" > /creds
envVars:
AWS_ACCESS_KEY_ID: $(accessKeyId)
AWS_DEFAULT_REGION: $(region)
AWS_SECRET_ACCESS_KEY: $(secretAccessKey)
files:
/creds: $(creds)
name: github.com/opspec-pkgs/aws.ecr.get-login-creds
opspec: 0.1.6
version: 1.0.0