Doc update + linting + fix CI typo + fix port issue ECR
Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
This commit is contained in:
@@ -10,13 +10,13 @@ import (
|
||||
// AWS Config shared by all AWS packages
|
||||
#Config: {
|
||||
// AWS region
|
||||
region: dagger.#Input & { string }
|
||||
region: dagger.#Input & {string}
|
||||
// AWS access key
|
||||
accessKey: dagger.#Input & { dagger.#Secret }
|
||||
accessKey: dagger.#Input & {dagger.#Secret}
|
||||
// AWS secret key
|
||||
secretKey: dagger.#Input & { dagger.#Secret }
|
||||
secretKey: dagger.#Input & {dagger.#Secret}
|
||||
// AWS localstack mode
|
||||
localMode: dagger.#Input & { string | *null }
|
||||
localMode: dagger.#Input & {string | *null}
|
||||
}
|
||||
|
||||
// Re-usable aws-cli component
|
||||
@@ -33,7 +33,7 @@ import (
|
||||
"package": curl: true
|
||||
"package": "aws-cli": "=~1.18"
|
||||
if config.localMode != null {
|
||||
"package": "py3-pip": true
|
||||
package: "py3-pip": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -46,36 +46,36 @@ import (
|
||||
"pipefail",
|
||||
"-c",
|
||||
if config.localMode == null {
|
||||
#"""
|
||||
aws configure set aws_access_key_id "$(cat /run/secrets/access_key)"
|
||||
aws configure set aws_secret_access_key "$(cat /run/secrets/secret_key)"
|
||||
#"""
|
||||
aws configure set aws_access_key_id "$(cat /run/secrets/access_key)"
|
||||
aws configure set aws_secret_access_key "$(cat /run/secrets/secret_key)"
|
||||
|
||||
aws configure set default.region "$AWS_DEFAULT_REGION"
|
||||
aws configure set default.cli_pager ""
|
||||
aws configure set default.output "json"
|
||||
"""#,
|
||||
}
|
||||
if config.localMode != null {
|
||||
#"""
|
||||
# Download awscli v3 and override aws
|
||||
pip install awscli-local[v2]
|
||||
mv /usr/bin/awslocal /usr/bin/aws
|
||||
aws configure set default.region "$AWS_DEFAULT_REGION"
|
||||
aws configure set default.cli_pager ""
|
||||
aws configure set default.output "json"
|
||||
"""#
|
||||
},
|
||||
if config.localMode != null {
|
||||
#"""
|
||||
# Download awscli v3 and override aws
|
||||
pip install awscli-local[v2]
|
||||
mv /usr/bin/awslocal /usr/bin/aws
|
||||
|
||||
# Configure
|
||||
mkdir -p ~/.aws/
|
||||
# Configure
|
||||
mkdir -p ~/.aws/
|
||||
|
||||
# Set up ~/.aws/config
|
||||
echo "[default]" > ~/.aws/config
|
||||
echo "region = $AWS_DEFAULT_REGION" >> ~/.aws/config
|
||||
echo "cli_pager =" >> ~/.aws/config
|
||||
echo "output = json" >> ~/.aws/config
|
||||
# Set up ~/.aws/config
|
||||
echo "[default]" > ~/.aws/config
|
||||
echo "region = $AWS_DEFAULT_REGION" >> ~/.aws/config
|
||||
echo "cli_pager =" >> ~/.aws/config
|
||||
echo "output = json" >> ~/.aws/config
|
||||
|
||||
# Set up ~/.aws/credentials
|
||||
echo "[default]" > ~/.aws/credentials
|
||||
echo "aws_access_key_id = $(cat /run/secrets/access_key)" >> ~/.aws/credentials
|
||||
echo "aws_secret_access_key = $(cat /run/secrets/secret_key)" >> ~/.aws/credentials
|
||||
"""#,
|
||||
}
|
||||
# Set up ~/.aws/credentials
|
||||
echo "[default]" > ~/.aws/credentials
|
||||
echo "aws_access_key_id = $(cat /run/secrets/access_key)" >> ~/.aws/credentials
|
||||
echo "aws_secret_access_key = $(cat /run/secrets/secret_key)" >> ~/.aws/credentials
|
||||
"""#
|
||||
},
|
||||
]
|
||||
mount: "/run/secrets/access_key": secret: config.accessKey
|
||||
mount: "/run/secrets/secret_key": secret: config.secretKey
|
||||
|
@@ -17,14 +17,14 @@ TestECR: {
|
||||
seed: ""
|
||||
}
|
||||
|
||||
repository: string
|
||||
repository: string
|
||||
if localMode == null {
|
||||
repository: "125635003186.dkr.ecr.\(TestConfig.awsConfig.region).amazonaws.com/dagger-ci"
|
||||
}
|
||||
if localMode != null {
|
||||
repository: "localhost:4514/dagger-ci"
|
||||
repository: "localhost:4510/dagger-ci"
|
||||
}
|
||||
tag: "test-ecr-\(suffix.out)"
|
||||
tag: "test-ecr-\(suffix.out)"
|
||||
|
||||
creds: #Credentials & {
|
||||
config: TestConfig.awsConfig
|
||||
|
Reference in New Issue
Block a user