Git Product home page Git Product logo

ciborg's Introduction

DEPRECATED!!!! Ciborg is no longer under active development.

Ciborg: Your Chief Administrative Aide on Cloud City

Ciborg

Code Climate Build Status

Easily create your CI server on EC2

Lando Calrissian relies on a cyborg to keep Cloud City afloat, and now you can rely on Ciborg to get your continuous integration server running in the cloud. Ciborg is a gem that will help you spin-up, bootstrap, and install Jenkins CI for your Rails app on Amazon EC2.

What do I get?

  • Commands for creating, starting, stopping, or destroying your CI server on EC2
  • The full Travis CI environment on Ubuntu 12.04
  • A Jenkins frontend for monitoring your builds
Tasks:
  ciborg add_build <name> <repository> <branch> <command>  # Adds a build to Ciborg
  ciborg bootstrap          # Configures Ciborg's master node
  ciborg certificate        # Dump the certificate
  ciborg chef               # Uploads chef recipes and runs them
  ciborg config             # Dumps all configuration data for Ciborg
  ciborg create             # Create a new Ciborg server using EC2
  ciborg create_vagrant     # Creates a vagrant instance
  ciborg destroy_ec2        # Destroys all the ciborg resources on EC2
  ciborg help [TASK]        # Describe available tasks or one specific task
  ciborg open               # Open a browser to Ciborg
  ciborg setup              # Sets up ciborg through a series of questions
  ciborg ssh                # SSH into Ciborg
  ciborg trust_certificate  # Adds the current master's certificate to your OSX keychain

Read on for an explanation of what each one of these steps does.

Install

gem install ciborg

Ciborg runs independently of your project and is not a dependency.

Initial Setup

If this is your first time running ciborg and you do not have configuration file, yet, run:

ciborg setup

This will ask you a series of questions that will get you up and running. You will need the following information available:

  • The URL of your git repository. Jenkins needs to clone from this URL without supplying user authentication
  • An SSH key that has pull access to the repository
  • Any shell commands you want to run for your build
  • Your AWS credentials
  • The SSH key to access your EC2 instance

Your ciborg instance should now be up and running. You will be able to access it at: http://<your instance address>/ with the username and password you chose during configuration. Or, if you are on a Mac, run ciborg open. For more information about Jenkins CI, see http://jenkins-ci.org.

Updating your configuration

Ciborg stores your configuration in the file config/ciborg.yml, relative to where you ran ciborg setup. You can update your configuration by running ciborg chef after editing the following keys in this file:

node_attributes

This section contains the basic auth credentials for your EC2 instance and your jenkins build configuration. The jenkins.builds.command field is the shell command that will be run for your build. Here is an example build script for a ruby project:

#!/bin/bash -le

source .rvmrc
set -e
gem install bundler --no-ri --no-rdoc && bundle install
echo USER=$USER && ruby --version && which ruby && which bundle
bundle exec rake spec

recipes

The default chef recipes that ciborg uses are:

["pivotal_ci::jenkins", "pivotal_ci::limited_travis_ci_environment", "pivotal_ci"]

Because we're using the cookbooks from Travis CI, you can look through all the recipes Travis has available, and add any that you need.

cookbooks

If you need to write your own chef recipes to install your project's dependencies, you can add a cookbooks directory to the root of your project. Make sure that your cookbook_paths is either blank (to use the default values), or contains ./chef/project-cookbooks. So, to include a bacon recipe, you should have cookbooks/pork/recipes/bacon.rb file in your repository.

EC2 Configuration

Ciborg provides a set of default EC2 configuration parameters. For example, the instance size is set to "c1.medium". You can save on EC2 costs by using a tool like projectmonitor or ylastic to schedule when your instances are online. If you want to edit these parameters, you will need to destroy and re-create your ciborg instance.

Manually creating your ciborg instance

  1. Launch an instance, allocate and associate an elastic IP and update config/ciborg.yml:

     ciborg create
    
  2. Bootstrap the instance using the boostrap_server.sh script. The script installs ruby prerequisites and installs RVM:

     ciborg bootstrap
    
  3. Upload the contents of Ciborg's cookbooks, create a soloistrc, and run chef:

     ciborg chef
    

Troubleshooting

Shell access for your instance

ciborg ssh

Terminate all Ciborg instances on your account and deallocate their elastic IPs

ciborg destroy_ec2

Support

License

Ciborg is MIT Licensed and ยฉ Pivotal Labs. See LICENSE.txt for details.

ciborg's People

Contributors

devineje avatar hiremaga avatar hjhart avatar kmayer avatar lvarvel avatar michaelfairley avatar mkocher avatar moonmaster9000 avatar nertzy avatar ohrite avatar pivotalcommon avatar pivotalfoodydirect avatar srbartlett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ciborg's Issues

Jenkins shouldn't be extract to /tmp

Jenkins is being extracted to /tmp when being expanded from the WAR file. This is normally okay, but the default AMI has tmpreaper enabled to keep the /tmp dir clean by deleting things older than 7 days.

Vagrant support is dodgy

I was hoping ciborg could create a CI box using vagrant, and the docs mention it (albeit very briefly).

However I found that the support may be somewhat broken. For instance, when I ran 'ciborg create_vagrant' I found that CIBorg puts the .vagrant file inside the Gem directory of CIBorg itself. I'm pretty sure that's not right ๐Ÿ˜Ÿ

I've decided not to use CIBorg for this purpose, so I don't need the problem solved. This issue is just to note that the support is half-baked and/or the docs don't adequately address how to use ciborg with vagrant.

If indeed the vagrant support is half-baked, and nobody appears to be actively using it, it might makes sense to rip it out or at least document (in the README) that it has some problems.

Thanks!

Work together to generalize jenkins setup?

I've known about this awesome project for awhile, but I'm just now digging in to see how it works.

I've currently got a similar project that I'm planning to revamp, and was wondering whether y'all would be interested in at least entertaining the idea of collaborating.

Here's our project:
https://github.com/myplanetdigital/jenkins-inception

Obviously lots different, but I'm wondering if you'd be interested in discussing the sharing of a common "core". Our current setup uses a few rake tasks talking to various services (rackspace, dyndns, github), and delegating the spin-up to knife-solo, using librarian-chef to pull in our cookbooks. I was considering a second iteration to clean it up a bit (who am I kidding -- a lot), and thinking it would likely involve leveraging vagrant providers more fully (rather than knife-solo and using thor to wrap the project up as a gem (much like you've done).

Obviously the two of us have got some setup specific to how we operate (Drupal and build-pipelines), and you've got your own, but maybe we could somehow draw that out? Maybe we could create a way to pull in a few extra cookbooks via config and have them stand up the last mile of config? Or perhaps it's too much effort, and that's ok :) Just wanted to reach out

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.