Skip to content

Instantly share code, notes, and snippets.

@NicolasRitouet
Last active June 13, 2018 19:03
Show Gist options
  • Select an option

  • Save NicolasRitouet/6578f699cf859ec1de30 to your computer and use it in GitHub Desktop.

Select an option

Save NicolasRitouet/6578f699cf859ec1de30 to your computer and use it in GitHub Desktop.

Revisions

  1. NicolasRitouet revised this gist May 2, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cd-aws-s3-wercker.md
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ deploy:
    - Go to `Access Keys (Access Key ID and Secret Access Key)`
    - Create a new key and keep the `Access key ID` and the `Secret Access Key` in a safe place.

    #### Setup Wercker to use these credentials
    #### Setup Deployment on Wercker
    - on Wercker, go to the settings of your app
    - in `Deploy targets`, click on `add deploy target` and choose `custom deploy`
    - Target name can be `production`
  2. NicolasRitouet renamed this gist May 2, 2015. 1 changed file with 10 additions and 6 deletions.
    16 changes: 10 additions & 6 deletions cd-aws-s3.md → cd-aws-s3-wercker.md
    Original file line number Diff line number Diff line change
    @@ -15,9 +15,9 @@ box: wercker/default
    deploy:
    steps:
    - s3sync:
    key-id: $S3_KEY
    key-secret: $S3_SECRETKEY
    bucket-url: $S3_BUCKETNAME
    key-id: $S3_ACCESS_KEY_ID
    key-secret: $S3_SECRET_KEY
    bucket-url: $S3_BUCKET_NAME
    ```

    #### Get your AWS credentials
    @@ -27,9 +27,13 @@ deploy:

    #### Setup Wercker to use these credentials
    - on Wercker, go to the settings of your app
    - in `pipeline`, click on add a new variable with the name `S3_KEY` and your access key id as text
    - Create another new variable with the name `S3_SECRETKEY` and your secret access key as text
    - Create another variable with the name `S3_BUCKETNAME` and `s3://example.com` as text (change example.com with the name of your bucket)
    - in `Deploy targets`, click on `add deploy target` and choose `custom deploy`
    - Target name can be `production`
    - Select Autodeploy
    - Branch name is `master`
    - Click on `add new variable` and create a new environement variable with the name `S3_ACCESS_KEY_ID` and your access key id as text
    - Create another new variable with the name `S3_SECRET_KEY` and your secret access key as text
    - Create another variable with the name `S3_BUCKET_NAME` and `s3://example.com` as text (change example.com with the name of your bucket)

    #### Push your files to bitbucket
    Wercker should run the build (that does nothing so far) and deploy on s3.
  3. NicolasRitouet created this gist May 2, 2015.
    35 changes: 35 additions & 0 deletions cd-aws-s3.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    This tutorial explains how to deploy automatically from bitbucket (or github) to AWS S3.

    #### Create a bitbucket repository (public or private).

    #### Add this repo on Wercker
    - Go to Create Application
    - Select use bitbucket (or github)
    - Choose your repo
    - For the next questions, choose the default answers

    #### Add a file wercker.yml in your project
    ```
    box: wercker/default
    deploy:
    steps:
    - s3sync:
    key-id: $S3_KEY
    key-secret: $S3_SECRETKEY
    bucket-url: $S3_BUCKETNAME
    ```

    #### Get your AWS credentials
    - on AWS, go to [`Security Credentials`](https://console.aws.amazon.com/iam/home?region=eu-west-1#security_credential)
    - Go to `Access Keys (Access Key ID and Secret Access Key)`
    - Create a new key and keep the `Access key ID` and the `Secret Access Key` in a safe place.

    #### Setup Wercker to use these credentials
    - on Wercker, go to the settings of your app
    - in `pipeline`, click on add a new variable with the name `S3_KEY` and your access key id as text
    - Create another new variable with the name `S3_SECRETKEY` and your secret access key as text
    - Create another variable with the name `S3_BUCKETNAME` and `s3://example.com` as text (change example.com with the name of your bucket)

    #### Push your files to bitbucket
    Wercker should run the build (that does nothing so far) and deploy on s3.