Browse Source

Remove chef cookbooks and vagrant file

Both are now maintained in a seperate repository: https://github.com/elijah/cookbook-huginn
Dominik Sander 9 years ago
parent
commit
9f260d6c21

+ 0 - 3
deployment/.chef/knife.rb

@@ -1,3 +0,0 @@
-cookbook_path ["cookbooks", "site-cookbooks"]
-role_path     "roles"
-data_bag_path "data_bags"

+ 0 - 11
deployment/Cheffile

@@ -1,11 +0,0 @@
-#!/usr/bin/env ruby
-#^syntax detection
-
-site 'http://community.opscode.com/api/v1'
-
-cookbook 'ark'
-cookbook 'runit'
-cookbook 'git', :git => 'git://github.com/opscode-cookbooks/git.git'
-cookbook 'nginx', :git => 'git://github.com/opscode-cookbooks/nginx.git'
-cookbook 'mysql', :git => 'git://github.com/opscode-cookbooks/mysql.git'
-cookbook 'nodejs', :git => 'git://github.com/redguide/nodejs.git'

+ 0 - 71
deployment/Cheffile.lock

@@ -1,71 +0,0 @@
-SITE
-  remote: http://community.opscode.com/api/v1
-  specs:
-    apt (2.4.0)
-    bluepill (2.3.1)
-      rsyslog (>= 0.0.0)
-    build-essential (2.0.2)
-    chef_handler (1.1.6)
-    dmg (2.2.0)
-    ohai (2.0.0)
-    rsyslog (1.12.2)
-    runit (1.5.10)
-      build-essential (>= 0.0.0)
-      yum (~> 3.0)
-      yum-epel (>= 0.0.0)
-    windows (1.31.0)
-      chef_handler (>= 0.0.0)
-    yum (3.2.0)
-    yum-epel (0.3.6)
-      yum (~> 3.0)
-
-GIT
-  remote: git://github.com/redguide/nodejs.git
-  ref: master
-  sha: 91d8d11f189d13815d56af5700168e1cad88ae7f
-  specs:
-    nodejs (1.3.0)
-      apt (>= 0.0.0)
-      build-essential (>= 0.0.0)
-      yum-epel (>= 0.0.0)
-
-GIT
-  remote: git://github.com/opscode-cookbooks/git.git
-  ref: master
-  sha: b1bca76aaf3a3a2131744f17f6e5087e22fa3c40
-  specs:
-    git (4.0.3)
-      build-essential (>= 0.0.0)
-      dmg (>= 0.0.0)
-      runit (>= 1.0)
-      windows (>= 0.0.0)
-      yum (~> 3.0)
-      yum-epel (>= 0.0.0)
-
-GIT
-  remote: git://github.com/opscode-cookbooks/mysql.git
-  ref: master
-  sha: 4b70e99730ab4a7ce6c1dd7a35654a764fb6e0fe
-  specs:
-    mysql (5.2.13)
-
-GIT
-  remote: git://github.com/opscode-cookbooks/nginx.git
-  ref: master
-  sha: 45588ee2a5c7144a0ef2a5992e7f273542236d27
-  specs:
-    nginx (2.7.3)
-      apt (~> 2.2)
-      bluepill (~> 2.3)
-      build-essential (~> 2.0)
-      ohai (~> 2.0)
-      runit (~> 1.2)
-      yum-epel (~> 0.3)
-
-DEPENDENCIES
-  git (>= 0)
-  mysql (>= 0)
-  nginx (>= 0)
-  nodejs (>= 0)
-  runit (>= 0)
-

+ 0 - 40
deployment/Vagrantfile

@@ -1,40 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-Vagrant.configure("2") do |config|
-  config.omnibus.chef_version = :latest
-
-  config.vm.provision :chef_solo do |chef|
-    chef.roles_path = "roles"
-    chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
-    chef.add_role("huginn_development")
-    # chef.add_role("huginn_production")
-  end
-
-  config.vm.provider :virtualbox do |vb, override|
-    #vb.memory = 1024
-    #vb.cpus = 4
-    override.vm.box = "hashicorp/precise64"
-    override.vm.network :forwarded_port, host: 3000, guest: 3000
-  end
-
-  config.vm.provider :parallels do |prl, override|
-    override.vm.box = "parallels/ubuntu-12.04"
-  end
-
-  config.vm.provider :aws do |aws, override|
-    aws.ami = ENV['AWS_AMI'] || "ami-828675f5"
-    aws.region = ENV['AWS_REGION'] || "eu-west-1"
-    aws.instance_type = "t1.micro"
-
-    override.vm.box = "dummy"
-    override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
-    override.ssh.private_key_path = ENV["AWS_SSH_PRIVKEY"]
-    override.ssh.username = ENV['AWS_SSH_USER'] || "ubuntu"
-
-    aws.access_key_id = ENV["AWS_ACCESS_KEY_ID"]
-    aws.secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"]
-    aws.keypair_name = ENV["AWS_KEYPAIR_NAME"]
-    aws.security_groups = [ ENV["AWS_SECURITY_GROUP"] ]
-  end
-end

+ 0 - 0
deployment/nodes/.gitignore


+ 0 - 30
deployment/roles/huginn_development.json

@@ -1,30 +0,0 @@
-{
-
-"name" : "huginn_development",
-
-"chef_type" : "role",
-
-"json_class" : "Chef::Role",
-
-"description" : "Huginn Development Environment",
-
-"default_attributes" : {
-    "mysql" : {
-      "server_root_password" : "",
-      "server_repl_password" : "",
-      "server_debian_password" : ""
-    },
-    "nginx" : {
-       "init_style" : "upstart"
-    }
-},
-
-"run_list":[
-             "recipe[git]",
-             "recipe[apt]",
-             "recipe[mysql::server]",
-             "recipe[mysql::client]",
-             "recipe[nodejs::nodejs_from_binary]",
-             "recipe[huginn_development]"
-           ]
-}

+ 0 - 30
deployment/roles/huginn_production.json

@@ -1,30 +0,0 @@
-{
-
-"name" : "huginn_production",
-
-"chef_type" : "role",
-
-"json_class" : "Chef::Role",
-
-"description" : "Huginn Production Environment",
-
-"default_attributes" : {
-  "mysql": {
-    "server_root_password": "password",
-    "server_repl_password": "",
-    "server_debian_password": ""
-  },
-    "nginx" : {
-       "init_style" : "upstart"
-    }
-},
-
-"run_list":[
-             "recipe[git]",
-             "recipe[apt]",
-             "recipe[mysql::server]",
-             "recipe[nodejs::nodejs_from_binary]",
-             "recipe[nginx]",
-             "recipe[huginn_production]"
-           ]
-}

+ 0 - 78
deployment/site-cookbooks/huginn_development/recipes/default.rb

@@ -1,78 +0,0 @@
-include_recipe 'apt'
-include_recipe 'build-essential'
-
-user "huginn" do
-  action :create
-  system true
-  home "/home/huginn"
-  password "$6$ZwO6b.6tij$SMa8UIwtESGDxB37NwHsct.gJfXWmmflNbH.oypwJ9y0KkzMkCdw7D14iK7GX9C4CWSEcpGOFUow7p01rQFu5."
-  supports :manage_home => true
-  gid "sudo"
-  shell "/bin/bash"
-end
-
-group "huginn" do
-  members ["huginn"]
-  action :create
-end
-
-%w("ruby1.9.1" "ruby1.9.1-dev" "libxslt-dev" "libxml2-dev" "curl" "libmysqlclient-dev" "libffi-dev" "libssl-dev").each do |pkg|
-  package pkg do
-    action :install
-  end
-end
-
-bash "Setting default ruby and gem versions to 1.9" do
-  code <<-EOH
-    if [ $(readlink /usr/bin/ruby) != "ruby1.9.1" ]
-    then
-      update-alternatives --set ruby /usr/bin/ruby1.9.1
-    fi
-
-    if [ $(readlink /usr/bin/gem) != "gem1.9.1" ]
-    then
-      update-alternatives --set gem /usr/bin/gem1.9.1
-    fi
-  EOH
-end
-
-git "/home/huginn/huginn" do
-  repository 'git://github.com/cantino/huginn.git'
-  reference 'master'
-  action :sync
-  user "huginn"
-end
-
-gem_package("rake")
-gem_package("bundle")
-
-bash "Setting huginn user with NOPASSWD option" do
-  cwd "/etc/sudoers.d"
-  code <<-EOH
-    touch huginn
-    chmod 0440 huginn
-    echo "huginn ALL=(ALL) NOPASSWD:ALL" >> huginn
-    EOH
-end
-
-bash "huginn dependencies" do
-  user "huginn"
-  cwd "/home/huginn/huginn"
-  code <<-EOH
-    export LANG="en_US.UTF-8"
-    export LC_ALL="en_US.UTF-8"
-    sudo bundle install
-    sed s/REPLACE_ME_NOW\!/$(sudo bundle exec rake secret)/ .env.example > .env
-    sudo bundle exec rake db:create
-    sudo bundle exec rake db:migrate
-    sudo bundle exec rake db:seed
-    EOH
-end
-
-bash "huginn has been installed and will start in a minute" do
-  user "huginn"
-  cwd "/home/huginn/huginn"
-  code <<-EOH
-    sudo nohup foreman start &
-    EOH
-end

+ 0 - 2
deployment/site-cookbooks/huginn_production/files/default/Procfile

@@ -1,2 +0,0 @@
-web: sudo bundle exec unicorn_rails -c config/unicorn.rb -E production
-jobs: sudo RAILS_ENV=production bundle exec rails runner bin/threaded.rb

+ 0 - 110
deployment/site-cookbooks/huginn_production/files/default/env.example

@@ -1,110 +0,0 @@
-# ==== Required configuration settings for Huginn ====
-
-# Replace the following with the output from "rake secret"
-APP_SECRET_TOKEN=REPLACE_ME_NOW!
-
-# This is the domain where your Huginn instance will be running. The default should work
-# for development, but it needs to be changed to your Huginn domain when you deploy to a
-# production environment (e.g., yourdomain.com, possibly including a port).
-#DOMAIN=localhost:3000
-
-############################
-#      Database Setup      #
-############################
-
-DATABASE_ADAPTER=mysql2
-DATABASE_ENCODING=utf8
-DATABASE_RECONNECT=true
-DATABASE_NAME=huginn_production
-DATABASE_POOL=5
-DATABASE_USERNAME=root
-DATABASE_PASSWORD=password
-#DATABASE_HOST=your-domain-here.com
-#DATABASE_PORT=3306
-#DATABASE_SOCKET=/tmp/mysql.sock
-
-# ==== Additional required production settings ====
-
-# Configure Rails environment.  This should only be needed in production and may cause errors in development.
-RAILS_ENV=production
-
-# Should Rails force all requests to use SSL?
-FORCE_SSL=false
-
-############################
-#     Allowing Signups     #
-############################
-
-# This invitation code will be required for users to signup with your Huginn installation.
-# You can see its use in user.rb.  PLEASE CHANGE THIS!
-INVITATION_CODE=try-huginn
-
-# If you don't want to require users to have an invitation code, set this to true
-SKIP_INVITATION_CODE=false
-
-#############################
-#    Email Configuration    #
-#############################
-
-# Outgoing email settings.  To use Gmail or Google Apps, put your Google Apps domain or gmail.com
-# as the SMTP_DOMAIN and your Gmail username and password as the SMTP_USER_NAME and SMTP_PASSWORD.
-# 
-# PLEASE NOTE: In order to enable sending real emails via SMTP locally (e.g., when not in the production Rails environment),
-# you must also set SEND_EMAIL_IN_DEVELOPMENT to true below.
-
-SMTP_DOMAIN=your-domain-here.com
-SMTP_USER_NAME=you@gmail.com
-SMTP_PASSWORD=somepassword
-SMTP_SERVER=smtp.gmail.com
-SMTP_PORT=587
-SMTP_AUTHENTICATION=plain
-SMTP_ENABLE_STARTTLS_AUTO=true
-
-# Set to true to send real emails via SMTP when running in the development Rails environment.
-# Set to false to have emails intercepted in development and displayed at http://localhost:3000/letter_opener
-SEND_EMAIL_IN_DEVELOPMENT=false
-
-# The address from which system emails will appear to be sent.
-EMAIL_FROM_ADDRESS=from_address@gmail.com
-
-###########################
-#      Agent Logging      #
-###########################
-
-# Number of lines of log messages to keep per Agent
-AGENT_LOG_LENGTH=200
-
-#############################
-#  AWS and Mechanical Turk  #
-#############################
-
-# AWS Credentials for MTurk
-AWS_ACCESS_KEY_ID=YOUR-AWS-ACCESS-KEY-ID
-AWS_ACCESS_KEY=YOUR-AWS-ACCESS-KEY
-
-# Set AWS_SANDBOX to true if you're developing Huginn code.
-AWS_SANDBOX=false
-
-########################
-#   Various Settings   #
-########################
-
-# Specify the HTTP backend library for Faraday, used in WebsiteAgent.
-# You can change this depending on the performance and stability you
-# need for your service.  Any choice other than "typhoeus",
-# "net_http", or "em_http" should require you to bundle a corresponding
-# gem via Gemfile.
-FARADAY_HTTP_BACKEND=typhoeus
-
-# Allow JSONPath eval expresions. i.e., $..price[?(@ < 20)]
-# You should not allow this on a shared Huginn box because it is not secure.
-ALLOW_JSONPATH_EVAL=false
-
-# Enable this setting to allow insecure Agents like the ShellCommandAgent.  Only do this
-# when you trust everyone using your Huginn installation.
-ENABLE_INSECURE_AGENTS=false
-
-# Use Graphviz for generating diagrams instead of using Google Chart
-# Tools.  Specify a dot(1) command path built with SVG support
-# enabled.
-#USE_GRAPHVIZ_DOT=dot

+ 0 - 36
deployment/site-cookbooks/huginn_production/files/default/nginx.conf

@@ -1,36 +0,0 @@
-#worker_process 2;
-user huginn huginn;
-
-events {
-  worker_connections 1024;
-  accept_mutex on;
-}
-
-http {
-  types_hash_max_size 2048;
-  include    mime.types;
-
-  upstream huginn_server {
-    server unix:/home/huginn/shared/tmp/sockets/unicorn.sock;
-  }
-
-  server {
-    listen 80;
-    server_name _;
-    keepalive_timeout 5;
-    root /home/huginn/current/public;
-    try_files $uri/index.html $uri.html $uri @app;
-    error_page 500 502 503 504 /500.html;
-    location = /500.html {
-      root /home/huginn/current/public;
-    }
-    location @app {
-      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-      proxy_set_header X-Forwarded-Proto $scheme;
-      proxy_set_header Host $http_host;
-      proxy_redirect off;
-      proxy_pass http://huginn_server;
-    }
-}
-}
-

+ 0 - 35
deployment/site-cookbooks/huginn_production/files/default/unicorn.rb

@@ -1,35 +0,0 @@
-app_path = "/home/huginn/current"
-
-worker_processes 2
-preload_app true
-timeout 180
-listen '/home/huginn/shared/tmp/sockets/unicorn.sock'
-
-working_directory app_path
-
-rails_env = ENV['RAILS_ENV'] || 'production'
-
-# Log everything to one file
-stderr_path "log/unicorn_out.log"
-stdout_path "log/unicorn_err.log"
-
-# Set master PID location
-pid '/home/huginn/shared/tmp/pids/unicorn.pid'
-
-before_fork do |server, worker|
-  defined?(ActiveRecord::Base) and
-    ActiveRecord::Base.connection.disconnect!
-  old_pid = "#{server.config[:pid]}.oldbin"
-  if File.exist?(old_pid) && server.pid != old_pid
-    begin
-      Process.kill("QUIT", File.read(old_pid).to_i)
-    rescue Errno::ENOENT, Errno::ESRCH
-      # someone else did our job for us
-    end
-  end
-end
-
-after_fork do |server, worker|
-  defined?(ActiveRecord::Base) and
-    ActiveRecord::Base.establish_connection
-end

+ 0 - 111
deployment/site-cookbooks/huginn_production/recipes/default.rb

@@ -1,111 +0,0 @@
-include_recipe 'apt'
-include_recipe 'build-essential'
-
-user "huginn" do
-  system true
-  home "/home/huginn"
-  password "$6$ZwO6b.6tij$SMa8UIwtESGDxB37NwHsct.gJfXWmmflNbH.oypwJ9y0KkzMkCdw7D14iK7GX9C4CWSEcpGOFUow7p01rQFu5."
-  supports :manage_home => true
-  shell "/bin/bash"
-  gid "sudo"
-end
-
-group "huginn" do
-  members ["huginn"]
-end
-
-%w("ruby1.9.1" "ruby1.9.1-dev" "libxslt-dev" "libxml2-dev" "curl" "libmysqlclient-dev" "libffi-dev" "libssl-dev").each do |pkg|
-  package("#{pkg}")
-end
-
-bash "Setting default ruby and gem versions to 1.9" do
-  code <<-EOH
-    if [ $(readlink /usr/bin/ruby) != "ruby1.9.1" ]
-    then
-      update-alternatives --set ruby /usr/bin/ruby1.9.1
-    fi
-
-    if [ $(readlink /usr/bin/gem) != "gem1.9.1" ]
-    then
-      update-alternatives --set gem /usr/bin/gem1.9.1
-    fi
-  EOH
-end
-
-gem_package("rake")
-gem_package("bundle")
-
-service "nginx" do
-  supports :restart => true, :start => true, :stop => true, :reload => true
-  action :nothing
-end
-
-bash "Setting huginn user with NOPASSWD option" do
-  cwd "/etc/sudoers.d"
-  code <<-EOH
-    touch huginn && chmod 0440 huginn 
-    echo "huginn ALL=(ALL) NOPASSWD:ALL" >> huginn
-  EOH
-end
-
-deploy "/home/huginn" do
-  repo "https://github.com/cantino/huginn.git"
-  branch "master"
-  user "huginn"
-  group "huginn"
-  environment "RAILS_ENV" => "production"
-  keep_releases 5
-  create_dirs_before_symlink []
-  symlinks "log" => "log"
-  symlink_before_migrate({})
-  rollback_on_error true
-  notifies :enable, "service[nginx]"
-  notifies :start, "service[nginx]"
-  before_symlink do
-    %w(config log tmp).each do |dir|
-      directory "/home/huginn/shared/#{dir}" do
-      owner "huginn"
-      group "huginn"
-      recursive true
-      end
-    end
-    directory("/home/huginn/shared/tmp/pids")
-    directory("/home/huginn/shared/tmp/sockets")
-    %w(Procfile unicorn.rb nginx.conf).each do |file|
-      cookbook_file "/home/huginn/shared/config/#{file}" do
-      owner "huginn"
-      action :create_if_missing
-      end
-    end
-    cookbook_file "home/huginn/shared/config/.env" do
-    source "env.example"
-    mode "666"
-    owner "huginn"
-    action :create_if_missing
-    end
-  end
-  before_restart do
-    bash "huginn dependencies" do
-      cwd "/home/huginn/current"
-      user "huginn"
-      group "huginn"
-      code <<-EOH
-      export LANG="en_US.UTF-8"
-      export LC_ALL="en_US.UTF-8"
-      ln -nfs /home/huginn/shared/config/Procfile ./Procfile
-      ln -nfs /home/huginn/shared/config/.env ./.env
-      ln -nfs /home/huginn/shared/config/unicorn.rb ./config/unicorn.rb
-      sudo cp /home/huginn/shared/config/nginx.conf /etc/nginx/
-      echo 'gem "unicorn", :group => :production' >> Gemfile
-      sudo bundle install --without=development --without=test
-      sed -i s/REPLACE_ME_NOW\!/$(sudo bundle exec rake secret)/ /home/huginn/shared/config/.env
-      sudo RAILS_ENV=production bundle exec rake db:create
-      sudo RAILS_ENV=production bundle exec rake db:migrate
-      sudo RAILS_ENV=production bundle exec rake db:seed
-      sudo RAILS_ENV=production bundle exec rake assets:precompile
-      sudo foreman export upstart /etc/init -a huginn -u huginn -l log
-      sudo start huginn
-      EOH
-    end
-  end
-end