Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to automate deployment on AWS S3 with bitbucket (or github) and wercker

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

        - s3sync:
            key-id: $S3_ACCESS_KEY_ID
            key-secret: $S3_SECRET_KEY
            bucket-url: $S3_BUCKET_NAME

Get your AWS credentials

  • on AWS, go to Security Credentials
  • 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 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
  • 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:// as text (change 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.

Copy link

I added here also an example wercker.yml for a s3sync

Copy link

Running into a Wercker error following a bitbucket commit:

Failed step: setup environment - No pipeline named build

I'm not finding where the 'build' pipeline is in my new wercker application.

Copy link

murwa commented May 18, 2016

Looks like wercker install a default workflow; removed it and all is working for me.

Copy link

I'm having the same issue that @ericpeters0n was having. I followed these steps exactly and I get the following error after a git push:

setup environment No pipeline named wercker.yml

Yet right after that it shows exactly what is in my wercker.yml file that is commited to the root of the repo.

Copy link

riceo commented Feb 20, 2017

Wercker employee here!

This tutorial is for a deprecated version of Wercker. We now no longer enforce a pipeline named "build" & "deploy", nor have a notion of deployment targets configured on the web interface.

Instead, we allow you to arbitrarily name your pipelines (but create a default one called "build"), and join them together (in series or parallel) on the web interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment