зеркало из https://github.com/mozilla/MozDef.git
Enable dmake to use all AWS environment variables
This commit is contained in:
Родитель
5488b7c6e4
Коммит
cecd79c598
|
@ -29,13 +29,25 @@ function check_img() {
|
|||
|
||||
check_img || exit 127
|
||||
|
||||
if [ -n "$AWS_CONFIG_FILE" ]; then
|
||||
config_file_mount="-v ${AWS_CONFIG_FILE}:${AWS_CONFIG_FILE}"
|
||||
fi
|
||||
|
||||
if [ -n "$AWS_SHARED_CREDENTIALS_FILE" ]; then
|
||||
config_file_mount="${config_file_mount} -v ${AWS_SHARED_CREDENTIALS_FILE}:${AWS_SHARED_CREDENTIALS_FILE}"
|
||||
fi
|
||||
|
||||
dmake_env_file="`mktemp`"
|
||||
trap "{ rm -f \"$dmake_env_file\"; }" EXIT
|
||||
env | egrep "^AWS" > "$dmake_env_file"
|
||||
|
||||
cat $dmake_env_file
|
||||
|
||||
exec docker run --rm --name ${CONTAINER_NAME} \
|
||||
-u $(id -u) \
|
||||
-v ${AWS_CREDS_DIR}:/root/.aws \
|
||||
${config_file_mount} \
|
||||
-v $(pwd):${DOCKER_PROJECT_DIR} \
|
||||
-e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" \
|
||||
-e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" \
|
||||
-e "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}" \
|
||||
-e "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}" \
|
||||
-e "OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET}"
|
||||
--env-file "$dmake_env_file" \
|
||||
-e "OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET}" \
|
||||
${HUB}/${IMG_NAME}:latest make $@
|
||||
|
|
Загрузка…
Ссылка в новой задаче