Skip to content

Instantly share code, notes, and snippets.

@kkemple
Forked from dwwoelfel/gist:b859cee4b5f41af37ffd
Last active August 29, 2015 14:25
Show Gist options
  • Select an option

  • Save kkemple/b1aa0ce612330b5028cf to your computer and use it in GitHub Desktop.

Select an option

Save kkemple/b1aa0ce612330b5028cf to your computer and use it in GitHub Desktop.

Revisions

  1. @dwwoelfel dwwoelfel revised this gist Aug 1, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    In your repo's root directory, check in a requirements.txt with

    ```
    boto==2.30.0
    ```

    Then, from the project's Project Settings > Environment Variables page, add the two env vars: AWS_ACCESS_KEY_ID and AWS_SECRET_KEY, with an IAM key that can deploy to eb.

  2. @dwwoelfel dwwoelfel created this gist Aug 1, 2014.
    40 changes: 40 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    In your repo's root directory, check in a requirements.txt with

    boto==2.30.0

    Then, from the project's Project Settings > Environment Variables page, add the two env vars: AWS_ACCESS_KEY_ID and AWS_SECRET_KEY, with an IAM key that can deploy to eb.

    Then create a bash script to set up eb:

    setup-eb.sh:
    ```
    #!/usr/bin/env bash
    set -x
    set -e
    wget https://s3.amazonaws.com/elasticbeanstalk/cli/AWS-ElasticBeanstalk-CLI-2.6.3.zip -O /home/ubuntu/AWS-ElasticBeanstalk-CLI-2.6.3.zip
    cd /home/ubuntu && unzip AWS-ElasticBeanstalk-CLI-2.6.3.zip
    echo 'export PATH=$PATH:/home/ubuntu/AWS-ElasticBeanstalk-CLI-2.6.3/eb/linux/python2.7/' >> ~/.circlerc
    cd /home/ubuntu/$CIRCLE_PROJECT_REPONAME && bash /home/ubuntu/AWS-ElasticBeanstalk-CLI-2.6.3/AWSDevTools/Linux/AWSDevTools-RepositorySetup.sh
    # set up credentials
    touch /home/ubuntu/.aws-credentials
    chmod 600 /home/ubuntu/.aws-credentials
    echo "AWSAccessKeyId=$AWS_ACCESS_KEY_ID" > /home/ubuntu/.aws-credentials
    echo "AWSSecretKey=$AWS_SECRET_KEY" >> /home/ubuntu/.aws-credentials
    echo 'export AWS_CREDENTIAL_FILE=/home/ubuntu/.aws-credentials' >> ~/.circlerc
    ```

    And then, in the deployment section of your circle.yml add the following:

    ```
    deployment:
    production:
    branch: master
    commands:
    - bash ./setup-eb.sh
    - git aws.push
    ```