Git Product home page Git Product logo

jiff's Introduction

Jiff

Jiff is a server management tool which can manage Apache based web servers running Rails apps. It integrates with Uptime Robot, New Relic and Github to provide a central place to manage and view info on hosted sites and servers.

Dev Info

Install the gems through bundler as usual and then ensure Vagrant is set up.

Setting up Vagrant

  1. Install Vagrant (https://www.vagrantup.com/downloads.html) and VirtualBox (https://www.virtualbox.org/wiki/Downloads).

  2. Install the following Vagrant plugins:

    vagrant plugin install vagrant-omnibus
    vagrant plugin install vagrant-librarian-chef
    
  3. Insert the following into ~/.ssh/config

    Host default
    	HostName 127.0.0.1
    	User vagrant
    	Port 2222
    	UserKnownHostsFile /dev/null
    	StrictHostKeyChecking no
    	PasswordAuthentication no
    	IdentityFile ~/.vagrant.d/insecure_private_key
    	IdentitiesOnly yes
    	LogLevel FATAL
    
  4. Ensure the environment variables with the New Relic, Uptime Robot and GitHub API Keys are added to ~/.bash_profile

  5. Run vagrant up within the project directory.

Deploying a Test Site

An existing Rails site can be made to deploy to the Vagrant box.

  1. Add gem 'capistrano-rbenv', '1.0.5' to the development group in the site's Gemfile and run a bundle install

  2. Add require 'capistrano-rbenv' to config/deploy.rb

  3. Add a vagrant block to config/database.yml with the following details (make sure to change the DB name):

    vagrant:
    	adapter: mysql2
    	host: 127.0.0.1
    	username: root
    	database: DB NAME
    
  4. Create the file config/deploy/vagrant.rb and enter the following (make sure to change the site name):

    # The name of your application.  Used for deployment directory and filenames
    # and Apache configs. Should be unique on the Brightbox
    set :application, 'SITE NAME'
    
    set :domain, 'SITE NAME.default'
    
    ## List of servers
    server 'default', :app, :web, :db, primary: true
    set :rails_env, 'staging'
    set :branch, 'develop'
    set :user, 'vagrant'
    
    set :rbenv_type, :user # or :system, depends on your rbenv setup
    set :rbenv_ruby, '2.1.1-p76'
    set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
    set :rbenv_map_bins, %w{rake gem bundle ruby rails}
    set :rbenv_roles, :all # default value
    
  5. Run cap vagrant deploy

  6. SSH into the Vagrant box and CD into the site's current directory. Once in there, run rake db:create if the database is not already created.

  7. Create a Virtual Host config file for the site if it does not already exist. Nothing special is required for the config so one can be copied from another server.

  8. After a reload of Apache, the site should now be accessible at SITE NAME.localhost:8080

Finishing up

Once Vagrant is fully up and running, run the rake task jiff:launch which will load in some default data. Everything should now be ready to go.

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.