GithubHelp home page GithubHelp logo

isabella232 / anno-lambda-publish Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nprapps/anno-lambda-publish

0.0 0.0 0.0 13 KB

AWS lambda function that publishes a factcheck from stage

Python 45.71% HTML 54.29%

anno-lambda-publish's Introduction

anno-lambda-publish

What is this?

AWS lambda function that publishes a stage factcheck to production, its main purpose is to offer a more autonomous way of publishing non-live annotations on the editorial side.

This is a work in progress repo.

Assumptions

The following things are assumed to be true in this documentation.

  • You are running OSX.
  • You are using Python 2.7. (Probably the version that came OSX.)
  • You have virtualenv and virtualenvwrapper installed and working.
  • You have NPR's AWS credentials stored as environment variables locally.

For more details on the technology stack used with the app-template, see our development environment blog post.

What's in here?

The project contains the following folders and important files:

  • code -- Where are lambda function code lives
  • test-- local tests to check that our code runs locally
  • fabfile.py -- Fabric commands for automating setup and deployment
  • requirements.txt -- Python requirements.

Bootstrap the project

Create a lambda function inside AWS using the AWS Console and write down the name you gave to that function and

Also write down the name ot the handler you used.

For example if you have used lambda.lambda_handler then you will need to create a file on code called lambda.py that should have a function with name lambda_handler in it, that receives as arguments an event and a context. That will be the entry point for your lambda execution.

To bootstrap the project:

cd anno-lambda-publish
mkvirtualenv anno-lambda-publish
pip install -r requirements.txt

Run the project

  • Review the code for your lambda function, include all the required libraries in code/requirements.txt

Since some of the code on this repo should be identical to that of the origin anno-docs repo there's a fabric task that will grab the latest pushed files from master and place them in their corresponding place in the code folder. To sync those files run manually:

fab sync_anno_docs_files
  • Create a function in your AWS lambda environment.

  • Finally run:

fab deploy:function=FUNCTION_NAME

Where FUNCTION_NAME is the name of the created lambda function

The deploy function automatically invokes the sync task mentioned above.

anno-lambda-publish's People

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.