How to run aws configure in a travis deploy script?

后端 未结 2 542
一生所求
一生所求 2021-01-01 14:48

I am trying to get travis-ci to run a custom deploy script that uses awscli to push a deployment up to my staging server.

In my .travis.yml file I have

2条回答
  •  臣服心动
    2021-01-01 15:17

    You can set these in a couple of ways.

    Firstly, by creating a file at ~/.aws/config (or ~/.aws/credentials).

    For example:

    [default]
    aws_access_key_id=foo
    aws_secret_access_key=bar
    region=us-west-2
    

    Secondly, you can add environment variables for each of your settings.

    For example, create the following environment variables:

    AWS_DEFAULT_REGION
    AWS_ACCESS_KEY_ID
    AWS_SECRET_ACCESS_KEY
    

    Thirdly, you can pass region in as a command line argument. For example:

    aws eb deploy --region us-west-2
    

    You won't need to run aws configure in these cases as the cli is configured.

    There is further AWS documentation on this page.

提交回复
热议问题