14

I want to set up an webhook from our Github account so it automatically starts an deployment task in OpsWorks. It seems to be possible according to the documentation - but can't find any examples or smart lib which is unusual for the Internets. ;)

Christian Landgren
  • 13,127
  • 6
  • 35
  • 31

3 Answers3

23

This process is much simpler now. All you have to do is provide the required values per the Webhook, and it will be done for you. opsworks webhook details

Steps :

  1. GitHub repository -> Settings
  2. Webhooks & Services
  3. AWS Opsworks
  4. Provide AWS::IAM keys, Stack and App ID , and branch you want to deploy.

Be aware that by this process you deploy a specific app to ALL the layers in a stack. This means that if you have custom layers with ruby, they will also deploy the specific app to those layers too. Useful for worker layer, however, increased deployment time when you have multiple rails apps in different layers.

Ensure that your user has proper permissions to deploy on the specific stack. enter image description here

Imran Ahmed
  • 1,066
  • 6
  • 6
  • Thanks, I did a comment on my old answer with the same thing but this answer now describes it much better. – Christian Landgren Mar 12 '14 at 04:49
  • I set this up too, but I don't think I know what it does. When building an app for deployment in OpsWorks, you already specify which Github repo to pull from the deploy the app. Is this supposed to trigger a redeploy on push? – owensmartin Apr 08 '14 at 18:28
  • 1
    @owensmartin - for a given branch name on github, it will auto deploy to AWS OPSWORKS for the configured stack and app id, using the AWS access key and secret key that is given on screen. – Imran Ahmed Apr 13 '14 at 23:19
  • @ImranAhmed We have testing it On github, it says okay. We have set both sides correct (opsworks and github). I am not sure how am I gonna test this auto deployment. Everything looks ready. I am changing index.php and then press commit button on github built in application. And then waiting for a deployment process. But nothing happen. What am I doing wrong? – littlealien Nov 01 '14 at 12:25
  • 2
    @littlealien make sure your user has permission to do deploys for the specific stack. That is controlled under the "Permissions" area. – Imran Ahmed Nov 04 '14 at 00:41
  • Is there a way to debug this? I got it all set up but it won't trigger – Gianni Carlo Nov 10 '16 at 23:13
3

Internets saved me once again: http://blog.codeship.io/2013/09/18/how-to-deploy-to-amazon-opsworks-using-codeship.html

Christian Landgren
  • 13,127
  • 6
  • 35
  • 31
  • 2
    For anyone interested, now there's a built-in web hook in github for deploying directly to AWS Opsworks. Very very convenient! – Christian Landgren Jan 26 '14 at 19:38
  • Could you add the link to the github / opsworks webhook? – Jeff Sisson Feb 12 '14 at 04:33
  • 1
    Since the list of web hooks are only available for the owner I can't link to it but here are a screenshot so you know what to look for. The information needed to enter are all available in your stack and layers in Opsworks: http://cl.ly/image/2a2h000k0S2n – Christian Landgren Feb 13 '14 at 05:57
0

Small addition to Imran answer: now on github it called Integration & Services.