Skip to content

Environment variables not available for custom cache command #3438

@adox

Description

@adox

AWS S3 custom cache fails (configuration taken from the docs):

[Cache]
RetrieveCommand="aws s3 cp s3://YOUR-OWN-CACHE-BUCKET/please/$CACHE_KEY -"
StoreCommand="aws s3 cp - s3://YOUR-OWN-CACHE-BUCKET/please/$CACHE_KEY"

It looks like no external environment variables are available during the cache phase (ie AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) and authorization fails.
Adding them with PassEnv / PassUnsafeEnv doesn't help.

Workaround was to store secrets in a file and modify the command to:

RetrieveCommand="source aws.sh && aws s3 cp s3://YOUR-OWN-CACHE-BUCKET/please/$CACHE_KEY -"

but this is ugly.
I guess, PassEnv / PassUnsafeEnv should be respected during the cache phase or pharaphs all host environment variables should be made available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions