Giter Site home page Giter Site logo

aws-jenkins-webhooks's Introduction

Introduction

WebHooks service provides a simple API for Jenkins SCM hooks, that can trigger your internal Jenkins instances from services that don`t have access to your local environment, like GitHub or BitBucket.

This terraform package contains 2 service - API Gateway, and Lambda.

API Gateway service parses incoming payload and then execute Lambda function that trigger list of Jenkins instances.

Lambda function call PollSCM plugin on Jenkins servers one-by-one

Deployment

Initialize terraform configuration

terraform init -backend-config=config.tfvars

Prepare Lambda package for deployment

zip -r webhooks_lambda.zip main.py

Perform deployment with default variables.tf configuration

terraform apply

Perform deployment with custom configuration

terraform apply \
    -var environment_prefix=company \
    -var lambda_webhook_subnets_id=subnet-xxxxxxx \
    -var lambda_webhook_sg_id=sg-xxxxxxx \
    -var lambda_webhook_timeout=20 \
    -var api_stage=v1 \
    -var webhook_domain=domain.com. \
    -var webhook_dns=domain.com \
    -var webhook_acm_certificate=domain.com

After deployment you got invocation URL for deployed API, so you can use it on your CI hooks.

Usage

  • POST: https://invoke_url/v1/{service}/{type}/
  • GET: https://invoke_url/v1/custom/{type}?remote={repository_url}

{service}

For {service} key you can specify service name, who invokes this hook:

  • github
  • bitbucket
  • custom

For bitbucket\github services - API gateways parse request payload and generate custom payload for Lambda

{type}

For {type} key you can specify Jenkins service type for invoke only this Jenkins instance:

  • any | all
  • ios
  • android
  • docker
  • windows

For custom hooks you should use GET method with remote argument that point to repository URL

https://invoke_url/v1/custom/docker?remote=ssh://repository/project.git

GitHub

GitHub webhook integration example

BitBucket

BitBucket webhook integration example

aws-jenkins-webhooks's People

Watchers

RomanCherednikov avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.