Code Monkey home page Code Monkey logo

pewpew's Introduction

pewpew - quick way of deploying your source code to an ec2 cluster.

Introduction

I needed a way of deploying code to a bunch of EC2 instances and execute bash commands after the code shipped. I started writing this out in python but quickly realized that bash made much more sense. Because some people who must remain unnamed would argue that it's okay to use python for this kind of things, I've left both the python and the bash code so they can judge for themselves.

Overall I guess this is a good example of why using bash often makes more sense than using python when you endup with lots of system calls in your python code :)

Deploy

You need to pass 4 arguments to this script:

  • The path to the repo you want to deploy.

  • The S3 bucket to deploy the code to.

  • The path to the EC2 keypair

  • The path to the bash file you want to execute in prod

To deploy :

$ ./deploy.sh /path/to/repo s3_bucket ~/.amazon/ec2-keypair.pem /path/to/file/to/execute/in/prod.sh

It requires the ec2-api-tools to be installed.

How this works ?

It basically grabs your hg repo, clones it, removes the .hg/ folder, make a tarball of your code and ship it to a S3 bucket. Then it sends a signal to all your EC2 instances to grab that code and to execute a bash file (which could reload apache or supervisor or whatever you want it to do.)

pewpew's People

Contributors

maraca avatar

Stargazers

 avatar

Watchers

 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.