mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-08 16:05:05 -04:00
add vagrant support to etherpad-lite
This commit is contained in:
parent
cfb58a80a3
commit
7492d1b19c
7 changed files with 171 additions and 0 deletions
1
vagrant/.gitignore
vendored
Normal file
1
vagrant/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.vagrant
|
20
vagrant/Vagrantfile
vendored
Normal file
20
vagrant/Vagrantfile
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
Vagrant::Config.run do |config|
|
||||||
|
config.vm.box = "lucid32"
|
||||||
|
config.vm.box_url = "http://files.vagrantup.com/lucid32.box"
|
||||||
|
config.vm.customize ["modifyvm", :id, "--memory", "512"]
|
||||||
|
config.vm.network :hostonly, "33.33.33.10"
|
||||||
|
|
||||||
|
# enable this to see the GUI if vagrant cannot connect
|
||||||
|
#config.vm.boot_mode = :gui
|
||||||
|
|
||||||
|
config.vm.provision :puppet do |puppet|
|
||||||
|
puppet.manifests_path = "puppet/manifests"
|
||||||
|
puppet.manifest_file = "init.pp"
|
||||||
|
# enable this to see verbose and debug puppet output
|
||||||
|
#puppet.options = "--verbose --debug"
|
||||||
|
end
|
||||||
|
Vagrant::Config.run do |config|
|
||||||
|
config.vm.share_folder("etherpad-code", "/home/etherpad/dev/etherpad", "../", :nfs => true)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
53
vagrant/puppet/manifests/classes/etherpad-lite.pp
Normal file
53
vagrant/puppet/manifests/classes/etherpad-lite.pp
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
class etherpad-lite {
|
||||||
|
package { "curl":
|
||||||
|
ensure => latest,
|
||||||
|
require => Exec["apt-get-update"];
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/home/etherpad":
|
||||||
|
require => User[etherpad],
|
||||||
|
owner => etherpad,
|
||||||
|
group => etherpad,
|
||||||
|
mode => 775,
|
||||||
|
recurse=> false,
|
||||||
|
ensure => directory;
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/home/etherpad/dev":
|
||||||
|
require => File["/home/etherpad"],
|
||||||
|
owner => etherpad,
|
||||||
|
group => etherpad,
|
||||||
|
mode => 775,
|
||||||
|
recurse=> false,
|
||||||
|
ensure => directory;
|
||||||
|
}
|
||||||
|
|
||||||
|
user { "etherpad":
|
||||||
|
ensure => "present",
|
||||||
|
uid => "10000",
|
||||||
|
shell => "/bin/bash",
|
||||||
|
managehome => true;
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { "/bin/bash bin/installDeps.sh":
|
||||||
|
alias => "install-etherpad-deps",
|
||||||
|
require => Exec["install-npm"],
|
||||||
|
environment => "HOME=/home/etherpad",
|
||||||
|
cwd => "/home/etherpad/dev/etherpad",
|
||||||
|
logoutput => on_failure,
|
||||||
|
user => "etherpad";
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { "/bin/bash bin/run.sh &":
|
||||||
|
alias => "run-etherpad-lite",
|
||||||
|
require => Exec["install-etherpad-deps"],
|
||||||
|
environment => "HOME=/home/etherpad",
|
||||||
|
cwd => "/home/etherpad/dev/etherpad",
|
||||||
|
logoutput => on_failure,
|
||||||
|
user => "etherpad";
|
||||||
|
}
|
||||||
|
|
||||||
|
group { "puppet":
|
||||||
|
ensure => "present",
|
||||||
|
}
|
||||||
|
}
|
54
vagrant/puppet/manifests/classes/node-js.pp
Normal file
54
vagrant/puppet/manifests/classes/node-js.pp
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
class node-js {
|
||||||
|
package { ["build-essential"]:
|
||||||
|
ensure => latest,
|
||||||
|
require => Exec["apt-get-update"];
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { "/usr/bin/apt-get update":
|
||||||
|
alias => "apt-get-update";
|
||||||
|
}
|
||||||
|
|
||||||
|
exec {
|
||||||
|
"/usr/bin/wget -N http://nodejs.org/dist/${node_version}/node-${node_version}.tar.gz":
|
||||||
|
alias => "download-node",
|
||||||
|
user => "etherpad",
|
||||||
|
cwd => "/home/etherpad/dev/",
|
||||||
|
require => File["/home/etherpad/dev"];
|
||||||
|
|
||||||
|
"/bin/tar zxf node-${node_version}.tar.gz":
|
||||||
|
alias => "unpack-node",
|
||||||
|
user => "etherpad",
|
||||||
|
cwd => "/home/etherpad/dev/",
|
||||||
|
creates => "/home/etherpad/dev/etherpad/node-${node_version}",
|
||||||
|
require => Exec["download-node"];
|
||||||
|
|
||||||
|
"/home/etherpad/dev/node-${node_version}/configure --prefix=/home/etherpad/node-${node_version} && /usr/bin/make install":
|
||||||
|
alias => "install-node",
|
||||||
|
environment => "HOME=/home/etherpad",
|
||||||
|
user => "etherpad",
|
||||||
|
cwd => "/home/etherpad/dev/node-${node_version}",
|
||||||
|
creates => "/home/etherpad/node-${node_version}",
|
||||||
|
timeout => 0,
|
||||||
|
require => [Exec["unpack-node"], Package["build-essential"]];
|
||||||
|
|
||||||
|
"/usr/bin/wget -N http://registry.npmjs.org/npm/-/npm-${npm_version}.tgz":
|
||||||
|
alias => "download-npm",
|
||||||
|
user => "etherpad",
|
||||||
|
cwd => "/home/etherpad/dev/",
|
||||||
|
require => Exec["install-node"];
|
||||||
|
|
||||||
|
"/bin/mkdir npm-${npm_version} && /bin/tar -C npm-${npm_version} -xf npm-${npm_version}.tgz":
|
||||||
|
alias => "unpack-npm",
|
||||||
|
user => "etherpad",
|
||||||
|
cwd => "/home/etherpad/dev/",
|
||||||
|
creates => "/home/etherpad/dev/npm-${npm_version}",
|
||||||
|
require => Exec["download-npm"];
|
||||||
|
|
||||||
|
"/usr/bin/make install":
|
||||||
|
alias => "install-npm",
|
||||||
|
environment => ["HOME=/home/etherpad", "UID=10000"],
|
||||||
|
user => "etherpad",
|
||||||
|
cwd => "/home/etherpad/dev/npm-${npm_version}/package",
|
||||||
|
require => Exec["unpack-npm"];
|
||||||
|
}
|
||||||
|
}
|
11
vagrant/puppet/manifests/init.pp
Normal file
11
vagrant/puppet/manifests/init.pp
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
$node_version = "v0.6.14"
|
||||||
|
$npm_version = "1.1.12"
|
||||||
|
|
||||||
|
Exec {
|
||||||
|
logoutput => on_failure,
|
||||||
|
path => "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/ruby/bin/:/home/etherpad/node-${node_version}/bin",
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
import "classes/*"
|
||||||
|
import "nodes/*"
|
4
vagrant/puppet/manifests/nodes/nodes.pp
Normal file
4
vagrant/puppet/manifests/nodes/nodes.pp
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
node default {
|
||||||
|
include node-js
|
||||||
|
include etherpad-lite
|
||||||
|
}
|
28
vagrant/puppet/ubuntu-bootstrap.sh
Normal file
28
vagrant/puppet/ubuntu-bootstrap.sh
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Quick bootstrap script for an Ubuntu Lucid host
|
||||||
|
#
|
||||||
|
# This allows you to bootstrap any Lucid box (VM, physical hardware, etc)
|
||||||
|
# using Puppet and automatically install a full Etherpad environment on it.
|
||||||
|
#
|
||||||
|
|
||||||
|
apt-get install git-core puppet rsync
|
||||||
|
|
||||||
|
GIT_REPO_URL="git://github.com/rhelmer/etherpad.git"
|
||||||
|
|
||||||
|
mkdir /puppet
|
||||||
|
|
||||||
|
# Clone the project from github
|
||||||
|
useradd etherpad
|
||||||
|
su - etherpad
|
||||||
|
mkdir dev
|
||||||
|
cd dev
|
||||||
|
git clone $GIT_REPO_URL etherpad
|
||||||
|
|
||||||
|
# copy the files from the git checkout to /puppet
|
||||||
|
rsync -a ./etherpad/puppet/ /puppet/
|
||||||
|
exit
|
||||||
|
|
||||||
|
# Let puppet take it from here...
|
||||||
|
puppet /home/etherpad/dev/puppet/manifests/*.pp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue