GithubHelp home page GithubHelp logo

zakkg3 / drone-lambda-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omerxx/drone-lambda-plugin

0.0 1.0 0.0 15 KB

Deploying Lambda code with drone.io to an existing function

License: MIT License

Standard ML 26.19% Dockerfile 6.17% Go 67.64%

drone-lambda-plugin's Introduction

Drone Lambda Plugin

The plugin utilizes AWS go-sdk to update an existing function's code; build your code, zip it with dependencies and upload it to S3. Then trigger the plugin for deploy.

Build Status

Build:

Build the binary:

go build main.go

Docker:

Build the container:

docker build --rm=true -t omerxx/drone-lambda-plugin .

Usage:

Execute from the working directory;

This will update my-function with a zip file under S3://some-bucket/lambda-dir/lambda-project-1.zip:

docker run --rm \
  -e PLUGIN_FUNCTION_NAME=my-function \
  -e PLUGIN_S3_BUCKET=some-bucket \
  -e PLUGIN_FILE_NAME=lambda-directory/lambda-project-1.zip \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  --privileged \
  plugins/docker --dry-run

Example:

pipeline:
  deploy-lambda:
    image: omerxx/drone-lambda-plugin
    pull: true
    function_region: eu-west-1
    function_name: my-function
    s3_bucket: some-bucket
    file_name: lambda-dir/lambda-project-${DRONE_BUILD_NUMBER}.zip

Example of a complete Lambda project's pipeline:

pipeline:
  build:
    image: python:2.7-alpine
    commands:
      - apk update && apk add zip
      - pip install -r requirements.txt -t .
      - zip -r -9 lambda-project-${DRONE_BUILD_NUMBER}.zip *

  s3-publish:
    image: plugins/s3
    acl: private
    region: us-east-1
    bucket: some-bucket
    target: lambda-dir
    source: lambda-project-${DRONE_BUILD_NUMBER}.zip

  deploy-lambda:
    image: omerxx/drone-lambda-plugin
    pull: true
    function_name: my-function
    s3_bucket: some-bucket
    file_name: lambda-dir/revenue-report-${DRONE_BUILD_NUMBER}.zip

  notify-slack-releases:
    image: plugins/slack
    channel: product-releases
    webhook: https://hooks.slack.com/services/ABCD/XYZ
    username: Drone-CI

drone-lambda-plugin's People

Contributors

omerxx avatar zakkg3 avatar

Watchers

 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.