Thursday, May 12, 2016

How to continuously integrate with Jenkins

Hi there!

"Continuous integration" gets thrown around a lot, but what does it really mean?

Unless you've been in a development role, it can be a little hard to define.

In short, it's a service that will automatically try to merge developer branches and test them before they are integrated into the main project code.

It's all in the effort to detect issues before they can cause real problems.

Let's get started then!

Jenkins is a time-tested tool for managing build servers, and by natural extension, continuous integration as well.

Jenkins can look a little ugly, but it gets the job done!
First, provision a server with any OS of your choosing. (Jenkins has some options now!)

Next, follow the instructions on the Jenkins site to download for your OS.

Install and let me know if you have any issues!  At the time of writing, Jenkins is now releasing v2.3 which has major changes to the setup process.

After changing the admin password, you have the option to install some suggested plugins, which is what makes Jenkins the most flexible CI tool! I highly recommend it!

One of the plugins installed is git integration, so you can easily link a Github repository with a freestyle project.

One plugin I've used in the past is the pull request builder, a great integration for larger teams where you'll want finer controls over what's being built and why.

That's really it!  Make sure to (build if necessary, and) run your test suite during the jenkins job and finally package and store to application it in your build repository for easy deployment later!

Let me know if you experience any funny business during setup and I'll add more to this guide, enjoy!

How to integrate a Ruby script into ZeroMQ

Hey there!

I'm going to walk you through the steps of integrating a basic Ruby script into a microservice architecture.

Microservices are typically managed via REST HTTP calls or a message queue.

In this example, I'll be using ZeroMQ a speedy message queue.

Be sure to understand what microservices are before we get too far into it!

First, let's make an example Ruby script to integrate.

This is an hello world example taken from the ZeroMQ documentation.

Here's the corresponding server side response.

As you can see, there's little overhead that you must include for a functioning message queue operating a simple request response pattern.

Give it a try, and let me know your thoughts!

Thursday, April 7, 2016

How to manage traffic with Elastic Load Balancing

Distributes application traffic over multiple EC2 instances.
  1. Knowledge
    1. Load balancing is the process of ditributing a large amount of traffic to multiple servers.
    2. Without load balancing, certain application servers would fail, while others go under utilized.
  2. Strategy
    1. The first step is to define the load balancer within AWS.
    2. Next, assign security groups to the load balancer.
    3. Then. configure health checks for the EC2 instances.
    4. Finally, tag, verify and create your new load balancer.
  3. Execution

Wednesday, April 6, 2016

How to deploy applications with Elastic Beanstalk

Easy to begin, impossible to outgrow.
  1. Knowledge
    1. Elastic Beanstalk is a Amazon Web Service for deploying and hosting software applications.
    2. If this sounds like Heroku, your intuition is correct.
  2. Strategy
    1. Here's a tutorial specific for deploying a Django application.
    2. Setup a python environment with Django.
    3. Create a Django project.
    4. Configure the app for Elastic Beanstalk.
    5. Deploy with the EB CLI.
  3. Execution
    1. Common issues:
      1. Powershell ExecutionPolicy
      2. EB CLI Could not find any platforms
      3. Server 404 response after deploy

Friday, March 11, 2016

How to create a JSON API with Rails

  1. Knowledge
    Optimizing for programmer happiness.
    1. Rails is a MVC framework, lending wonderfully for whipping up clean, RESTful interfaces.
    2. Not sure where to get started? Try this.
    3. Gems like jBuilder can greatly simplify the JSON declaration process. 
  2. Strategy
    1. Add a `northof` method to your `app/controllers/houses_controller.rb` file.  This will handle the input parameters and pass the variables to your JSON view.
    2. Create a `app/views/northof.json.jbuilder` file.  This defines the actual JSON response format. 
    3. Add a GET route to the resource member block within your `config/routes.rb` file.
  3. Execution

Wednesday, February 24, 2016

How to design behavior with user stories

  1. Knowledge
    Processes captured in the everyday language of the end user.
    1. User stories are written from a user's perspective, and describe how and why the user is using the software.
    2. User stories should satisfy the INVEST principles.
    3. For a user story to be ready for development, the team should be able to describe the technical tasks (develop, test, deploy) for the bug fixes and new features required to complete that user story.
  2. Strategy
    1. Just about all user stories follow this structure:
      1. As a <type of user>
      2. I want <some goal>
      3. so that <some reason>.
    2. User stories must be prioritized by the product owner so that highest value features are completed and delivered first.
  3. Execution

How to visualize users with personas

  1. Knowledge
    Biographies of fictitious users of the future product.
    1. Personas are a way to visualize all the future users of an application.
    2. With personas and BDD, we can design user stories based around these understood roles.
  2. Strategy
    1. Begin with a table 3 columns wide. 
    2. Title the columns:
      1. Picture & Name
      2. Personal Information
      3. Goals & Responsibilities
    3. Create semi-fictional personas for all possible users; considering chief officer, investor, auditor, regulator and manager in addition to the usual buyer and seller.
    4. Google image searching for the job title is a quick hack for believable pictures.
    5. Enter semi-fictional personal data to complete the personas. 
  3. Execution